feat(operators): conform tenant IRSA role tags to tagging standard#41
Merged
Conversation
The operator creates per-tenant IRSA roles via the AWS SDK, outside landing-zone's terraform — so they are the one cloud-tag surface cloudgov's gate would flag if they don't carry the required keys. They were tagged ad-hoc (PlatformId / Tenant / Persona / Environment / ManagedBy). tenantRoleTags (platform_iam.go) now builds the full set: it keeps the load-bearing keys — PlatformId (the BudgetPolicy reconciler groups Cost Explorer by it), Tenant, Persona — and adds the required-tier resource-tagging keys (Project, Repository, Component, Team, CostCenter, BusinessUnit, DataClassification, Compliance). ManagedBy is "eks-agent-platform" (the operator owns these roles' lifecycle, unlike opentofu-managed roles). The four org-level dims (cost-center / business-unit / data-classification / compliance) come from the operator's deploy config: new AGENTS_* flags/env wired through main.go into IAMConfig and set by the operator chart (config.tags.* values emitted as env in the deployment). tenantRoleTags falls back to the landing-zone env.hcl defaults when unset. Tagging only — keys are added, none renamed, so the kill-switch suspension contract and BudgetPolicy cost attribution are untouched. Verified: go build + vet + gofmt clean; controller unit tests green including the new TestTenantRoleTags; helm template renders the env block.
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.
Phase 3 of the tagging rollout — the surface the cloudgov gate actually forces. The operator creates per-tenant IRSA roles via the AWS SDK outside landing-zone's terraform, so they're the one cloud-tag surface the gate would flag if untagged. They were tagged ad-hoc (
PlatformId/Tenant/Persona/Environment/ManagedBy).What changed
tenantRoleTags(platform_iam.go) builds the full tag set:PlatformId(BudgetPolicy groups Cost Explorer by it),Tenant,Persona. None renamed.Project,Repository,Component,Team,CostCenter,BusinessUnit,DataClassification,Compliance.The four org dims come from the operator's deploy config (new
AGENTS_COST_CENTERetc. flags/env throughmain.go→IAMConfig, set by the operator chart'sconfig.tags.*), falling back to the landing-zoneenv.hcldefaults when unset — so a role always carries the keys.Verification
go build+go vet+ gofmt clean · controller unit tests green incl. the newTestTenantRoleTags·helm templaterenders the env block. (Thetest/conformanceenvtest suite needs kubebuilder assets absent locally — unrelated, runs in CI.)Deferred (will file an issue)
Migrating the operator's
eks-agent-platform/*k8s label prefix to the standard'sagents.nanohype.dev/*is a cross-repo contract change (bedrock-egress NetworkPolicy selector, cloudgov's platform audit, the tenant chart, agentctl, examples) needing a coordinated rollout — not gate-critical, not a drop-in. Tracked separately.