fix(gemini-enterprise): parse hyphenated tenant ids and the FAST tenant bucket name in brownfield discovery - #217
Open
scottonix wants to merge 1 commit into
Conversation
…nt bucket name in brownfield discovery deploy.sh derived the tenant from a brownfield project id with 'cut -d- -f3', so a FAST tenant named ten-1 (project prefix-prod-ten-1-main-0) came back as 'ten' and every derived name (iac-core project, state bucket, keyring) pointed at resources that do not exist; discovery then fell through to the custom-brownfield path. Take everything between the environment and the '-main-0' suffix instead, and treat a non-matching id as no tenant. The state bucket check also looked for <prefix>-<env>-<tenant>-iac-0, while 1-resman creates the tenant state bucket as <prefix>-tn-<env>-<tenant>-0 (branch-tenants.tf, module tenant-core-gcs); use that name. Signed-off-by: Scott McDonald <scott.mcdonald@onixnet.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brownfield discovery in
blueprints/fedramp-high/gemini-enterprise/deploy.shdoes not recognise a standard Stellar Engine (FAST) tenant:cut -d'-' -f3). FAST tenants are typically named with a hyphen (ten-1,ten-2), so forprefix-prod-ten-1-main-0the tenant comes back asten, every derived name (<prefix>-prod-ten-iac-core-0, the state bucket, the keyring) points at resources that do not exist, and discovery falls through to the "Standard Stellar Engine Landing Zone framework not detected" path. The tenant is now everything between the environment and the-main-0suffix; an id that does not match the pattern yields an empty tenant, which the existing check already reports.<prefix>-<env>-<tenant>-iac-0, while1-resmancreates the tenant state bucket as<prefix>-tn-<env>-<tenant>-0(branch-tenants.tf, moduletenant-core-gcs), so the bucket was never found and a second one was created. Use the FAST name.The remaining brownfield assumption — a
usmulti-region keyring named<Env>-<tenant>-keyringholdinggcsandgemini-enterprisekeys, where1-resmancreates a regional<Env>-<tenant>-keyringinregions.primarywithgcsanddefaultkeys — is left as is; that is a design question rather than a parsing bug and I will open an issue for it separately.Type of Change
Deployment & Compliance Impact
Checklist
Code Quality & Reusability
modules/orfast/can be leveraged for this change.documentation/naming-convention.md.Documentation
README.mdof the modified module or blueprint. (Not applicable — the README does not describe the parsing.)Security
Testing
Testing Performed
bash -n deploy.sh: OK.shellcheck -S warning: the same 17 pre-existing findings before and after, none introduced.The extraction, run on sample project ids:
acme-prod-ten-1-main-0prodtenten-1acme-int-ten-2-main-0inttenten-2sedev-prod-g4g-main-0prodg4gg4gacme-prod-tenant-main-0prodtenanttenantnot-a-matchmatchObserved originally against a FAST deployment with tenants
ten-1/ten-2: discovery reported the tenant IaC project as missing although<prefix>-prod-ten-1-iac-core-0existed.