Skip to content

feat(operators): conform tenant IRSA role tags to tagging standard#41

Merged
stxkxs merged 1 commit into
mainfrom
irsa-tag-conformance
Jun 15, 2026
Merged

feat(operators): conform tenant IRSA role tags to tagging standard#41
stxkxs merged 1 commit into
mainfrom
irsa-tag-conformance

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 15, 2026

Copy link
Copy Markdown
Member

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:

  • Keeps the load-bearing keys — PlatformId (BudgetPolicy groups Cost Explorer by it), Tenant, Persona. None renamed.
  • Adds the required-tier keys cloudgov gates on — Project, Repository, Component, Team, CostCenter, BusinessUnit, DataClassification, Compliance.

The four org dims come from the operator's deploy config (new AGENTS_COST_CENTER etc. flags/env through main.goIAMConfig, set by the operator chart's config.tags.*), falling back to the landing-zone env.hcl defaults when unset — so a role always carries the keys.

Verification

go build + go vet + gofmt clean · controller unit tests green incl. the new TestTenantRoleTags · helm template renders the env block. (The test/conformance envtest 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's agents.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.

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.
@stxkxs stxkxs merged commit de0c4af into main Jun 15, 2026
12 checks passed
@stxkxs stxkxs deleted the irsa-tag-conformance branch June 15, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant