Skip to content

feat(agent): IAM assume-role support + multi-instance parametrization#386

Merged
davidf-null merged 22 commits into
mainfrom
feat/iam-assume-role
Jun 11, 2026
Merged

feat(agent): IAM assume-role support + multi-instance parametrization#386
davidf-null merged 22 commits into
mainfrom
feat/iam-assume-role

Conversation

@davidf-null

Copy link
Copy Markdown
Collaborator

Summary

Extends the agent modules (infrastructure/aws/iam/agent and nullplatform/agent) with two capabilities:

  1. IAM sts:AssumeRole support — the agent can be granted permission to assume a configurable list of IAM roles.
  2. Multi-instance parametrization — names of IAM/Helm resources are now configurable, so multiple agents can coexist in the same cluster without collisions.

Changes

infrastructure/aws/iam/agent

  • assume_role_arns (list(string), default []): creates a conditional sts:AssumeRole policy (count-gated) and attaches it to the agent role only when ARNs are provided. ARNs are format-validated. Covered by tests in tests/agent.tftest.hcl.
  • role_name / policies_name_prefix overrides — default to the existing nullplatform-{cluster_name} / nullplatform_{cluster_name} convention, so existing consumers see no diff.
  • service_account_name — the OIDC trust relationship now trusts this SA name instead of the hardcoded nullplatform-agent.

nullplatform/agent

  • release_name — the helm_release name is now configurable (was hardcoded nullplatform-agent).
  • service_account_name — the values template renders the serviceAccount block (create/automount/name).
  • image_repository — allows overriding the agent container image repository (previously only the tag).

Compatibility

All new variables default to the previous hardcoded behavior — no diff for existing consumers (the assume-role policy and SA/repository overrides are opt-in).

Notes

  • This branch also merges main up to v4.0.1 (includes the v4.0.0 breaking change feat(dns,ingress,iam)!, which does not touch the agent modules).
  • The local np-api-skill.token credential was added to .gitignore (never committed).

Testing

  • tofu test, tofu validate and tofu fmt pass via pre-commit hooks.
  • New tests assert the assume-role policy is absent by default and created (with correct name + valid JSON) when ARNs are provided.

🤖 Generated with Claude Code

David Fernandez and others added 20 commits April 9, 2026 15:55
Adds optional `assume_role_arns` variable (default []) to the agent IAM
module. When non-empty, creates a scoped sts:AssumeRole policy and attaches
it to the agent role alongside the existing Route53/ELB/EKS/AVP policies.
Includes ARN format validation and tftest coverage for both the default
(no policy created) and enabled (policy created and named correctly) cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…deploys

Allow running multiple nullplatform agents in the same cluster without name
collisions by making IAM and Helm resource names configurable.

- iam/agent: add role_name and policies_name_prefix overrides (default to the
  existing nullplatform-{cluster_name} convention); trust the configurable
  service_account_name in the OIDC provider trust relationship
- nullplatform/agent: add release_name, service_account_name and
  image_repository variables; render serviceAccount (create/automount/name)
  and image.repository in the Helm values template

Also ignore the local np-api-skill.token credential.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Track the provider lock file for reproducible builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davidf-null davidf-null merged commit b82df52 into main Jun 11, 2026
44 checks passed
@davidf-null davidf-null deleted the feat/iam-assume-role branch June 11, 2026 18:41
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.

2 participants