Skip to content

Mutliple codestar connections#2030

Merged
cadmiumcat merged 2 commits into
mainfrom
mutliple-codestar-connections
Mar 19, 2026
Merged

Mutliple codestar connections#2030
cadmiumcat merged 2 commits into
mainfrom
mutliple-codestar-connections

Conversation

@cadmiumcat
Copy link
Copy Markdown
Contributor

@cadmiumcat cadmiumcat commented Mar 19, 2026

What problem does this pull request solve?

Allow for multiple codestar connections while we migrate our repos to a new GitHub organisation (alphagov--> govuk-forms).

Once we've finished migrating all repos, we can revert these code changes, and simple use the new codestar arns.

I am not adding a codestar connection for the integration account because we're no longer going to need it (#1959)

Trello card:

Things to consider when reviewing

This should be a no-op in most cases.
For anything referring to the forms-product-page repo, the codestar connection should be the one associated with the govuk-form repo.

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

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, user-research, and/or prod)
  • Check the #govuk-forms-deployment-notifications Slack channel to ensure the apply-forms-terraform-<environment> pipelines have run successfully

@cadmiumcat cadmiumcat marked this pull request as ready for review March 19, 2026 13:59
@cadmiumcat cadmiumcat force-pushed the mutliple-codestar-connections branch from d75b860 to 2b76359 Compare March 19, 2026 14:14
@cadmiumcat cadmiumcat marked this pull request as draft March 19, 2026 14:14
@cadmiumcat cadmiumcat marked this pull request as ready for review March 19, 2026 14:17
@whi-tw whi-tw requested review from Copilot and whi-tw March 19, 2026 14:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enable multiple AWS CodeStar/CodeConnections ARNs to support a phased migration of repositories from the alphagov GitHub org to govuk-forms, while selecting the appropriate connection per pipeline/module.

Changes:

  • Change codestar_connection_arn inputs from a single string to an object with alphagov and govuk-forms ARNs across integration/forms/deploy stacks.
  • Update CodePipeline/Image Builder/GHA runner wiring to reference the correct connection (.alphagov vs .govuk-forms) based on repository.
  • Update environment/account tfvars to provide both ARNs (where available).

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
infra/deployments/integration/tfvars/integration.tfvars Switch integration tfvars to object-based connection ARNs (currently leaves govuk-forms empty).
infra/deployments/integration/review/github_actions_runner.tf Select connection per app runner; product page uses govuk-forms.
infra/deployments/integration/review/gha-runner/inputs.tf Adjust gha-runner module inputs for the new connection shape (type currently removed).
infra/deployments/integration/inputs.tf Update integration stack variable type for codestar_connection_arn.
infra/deployments/forms/tfvars/user-research.tfvars Provide both alphagov and govuk-forms connection ARNs.
infra/deployments/forms/tfvars/staging.tfvars Provide both alphagov and govuk-forms connection ARNs.
infra/deployments/forms/tfvars/production.tfvars Provide both alphagov and govuk-forms connection ARNs.
infra/deployments/forms/tfvars/dev.tfvars Provide both alphagov and govuk-forms connection ARNs.
infra/deployments/forms/pipelines/deploy-forms-runner-container.tf Update pipeline/module wiring to use codestar_connection_arn.alphagov.
infra/deployments/forms/pipelines/deploy-forms-product-page-container.tf Update pipeline/module wiring to use codestar_connection_arn.alphagov (for e2e tests source).
infra/deployments/forms/pipelines/deploy-forms-admin-container.tf Update pipeline/module wiring to use codestar_connection_arn.alphagov.
infra/deployments/forms/pipelines/apply-terraform.tf Update source actions/modules to use codestar_connection_arn.alphagov.
infra/deployments/forms/inputs.tf Change codestar_connection_arn variable type to an object with two org keys.
infra/deployments/forms/account/tfvars/user-research.tfvars Provide both connection ARNs at the account layer.
infra/deployments/forms/account/tfvars/staging.tfvars Provide both connection ARNs at the account layer.
infra/deployments/forms/account/tfvars/production.tfvars Provide both connection ARNs at the account layer.
infra/deployments/forms/account/tfvars/dev.tfvars Provide both connection ARNs at the account layer.
infra/deployments/forms/account/inputs.tf Change codestar_connection_arn type to a two-key object.
infra/deployments/forms/account/engineer-access.tf Pass codestar_connection_arn.alphagov into engineer access module.
infra/deployments/forms/account/deployer-access.tf Pass codestar_connection_arn.alphagov into deployer access module.
infra/deployments/deploy/tools/pipeline-visualiser-pipeline.tf Use .alphagov for pipeline source and broaden connection resources list in IAM policy doc.
infra/deployments/deploy/inputs.tf Change deploy codestar_connection_arn to object with defaults for both orgs.
infra/deployments/deploy/image-builders/main.tf Use govuk-forms connection for product page image builder, alphagov for others.
infra/deployments/deploy/engineer-access/roles.tf Pass codestar_connection_arn.alphagov into deploy engineer access module.
infra/deployments/deploy/e2e-tests-image-builder/main.tf Pass codestar_connection_arn.alphagov into e2e image pipeline module.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/deployments/integration/review/gha-runner/inputs.tf
Comment thread infra/deployments/forms/account/inputs.tf
Comment thread infra/deployments/integration/inputs.tf
Comment thread infra/deployments/deploy/tools/pipeline-visualiser-pipeline.tf
Comment thread infra/deployments/integration/tfvars/integration.tfvars
Comment thread infra/deployments/integration/review/github_actions_runner.tf
Copy link
Copy Markdown
Contributor

@whi-tw whi-tw left a comment

Choose a reason for hiding this comment

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

Agree with the nullable thing from copilot!

Not sure what to do about integration. I think it's fine here though - we can rip out the codestar stuff as part of the 'stop using hosted runners' PR.

We are migrating our repositories to a new organisation (alphagov -->
govuk-forms). We're doing this one repository at a time, so we must be able to
maintain both codestar connections to AWS.

This is only temporary and we will revers to a single connection (per AWS
account) once the migration is over
These codestar connection were created manually in each of our AWS accounts
@cadmiumcat cadmiumcat force-pushed the mutliple-codestar-connections branch from 2b76359 to dd829dd Compare March 19, 2026 14:40
@cadmiumcat cadmiumcat requested a review from whi-tw March 19, 2026 14:41
@cadmiumcat cadmiumcat added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit d3b0d57 Mar 19, 2026
24 checks passed
@cadmiumcat cadmiumcat deleted the mutliple-codestar-connections branch March 19, 2026 15:02
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.

4 participants