Skip to content

Split deployer IAM policy into scoped policies - #2320

Merged
theseanything merged 1 commit into
mainfrom
split-deployer-iam-policy
Oct 14, 2026
Merged

theseanything merged 1 commit into
mainfrom
split-deployer-iam-policy

Conversation

@theseanything

@theseanything theseanything commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

Applying #2314 to staging failed because the deployer's iam policy went over the 6,144 character limit for managed policies.

This splits it into three policies:

  • iam_ecs: ECS task roles and policies
  • iam_pipelines: CodeBuild, EventBridge and Lambda roles and policies
  • iam_service_access: roles and users for other AWS services and Auth0

The permissions are unchanged.

Things to consider when reviewing

  • moved blocks keep the existing policy as iam_ecs, so it's updated in place rather than replaced.

Reminders

If you've made changes to the deployer role (files in modules/deployer-access):

  • Remember to run make <environment> forms/account apply on the relevant environments (dev, staging and/or prod)
  • Check the #govuk-forms-deployment-notifications Slack channel to ensure the apply-forms-terraform-<environment> pipelines have run successfully

Adding the submission events role statement took the iam policy past
the 6,144 character managed policy limit. Split it into policies for
ECS tasks, pipelines and service access. The permissions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 14, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The policy split preserves existing permissions while resolving the managed-policy size limit.

0 open findings

What changed in this PR

Splits the oversized deployer IAM policy into smaller, scoped managed policies while preserving permissions and Terraform state.

Changes:

  • Separates ECS, pipeline, and service-access permissions.
  • Migrates the existing policy and attachment to iam_ecs.
  • Adds and attaches two new scoped policies.
File Description
infra/​modules/​deployer-access/​policy.tf Defines, migrates, and attaches the scoped IAM policies.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@theseanything
theseanything requested review from a team October 14, 2026 13:27
@theseanything
theseanything added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 75c1a34 Oct 14, 2026
21 checks passed
@theseanything
theseanything deleted the split-deployer-iam-policy branch October 14, 2026 14:24
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.

3 participants