Skip to content

Commit 4d47610

Browse files
committed
Use single codestar connection
We temporarily needed two codestar connections while we migrated our github repositories from alphagov to our own org (govuk-forms) We no longer need this, so we're simplifying the code again and removing the old codestar connection arn
1 parent 614afcd commit 4d47610

23 files changed

Lines changed: 81 additions & 122 deletions

infra/deployments/deploy/e2e-tests-image-builder/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818

1919
module "forms_e2e_tests" {
2020
source = "../../../modules/e2e-image-pipeline"
21-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
21+
codestar_connection_arn = var.codestar_connection_arn
2222
ecr_repository_url = data.terraform_remote_state.deploy_ecr.outputs.e2e_tests_ecr_repository_url
2323
}
2424

infra/deployments/deploy/engineer-access/roles.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module "engineer_access" {
99
readonly = module.users.with_role["deploy_readonly"]
1010
env_name = "deploy"
1111
environment_type = "deploy"
12-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
12+
codestar_connection_arn = var.codestar_connection_arn
1313
allow_ecs_task_usage = false
1414
allow_rds_data_api_access = false
1515
state_file_bucket_name = "gds-forms-deploy-tfstate"

infra/deployments/deploy/image-builders/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module "build_product_page_container" {
33
application_name = "forms-product-page"
44
container_repository = "forms-product-page-deploy"
55
source_repository = "govuk-forms/forms-product-page"
6-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
6+
codestar_connection_arn = var.codestar_connection_arn
77
ecr_repository_url = data.terraform_remote_state.deploy_ecr.outputs.forms_product_page_ecr_repository_url
88

99
}
@@ -13,7 +13,7 @@ module "build_forms_runner_container" {
1313
application_name = "forms-runner"
1414
container_repository = "forms-runner-deploy"
1515
source_repository = "govuk-forms/forms-runner"
16-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
16+
codestar_connection_arn = var.codestar_connection_arn
1717
ecr_repository_url = data.terraform_remote_state.deploy_ecr.outputs.forms_runner_ecr_repository_url
1818
}
1919

@@ -23,6 +23,6 @@ module "build_forms_admin_container" {
2323
application_name = "forms-admin"
2424
container_repository = "forms-admin-deploy"
2525
source_repository = "govuk-forms/forms-admin"
26-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
26+
codestar_connection_arn = var.codestar_connection_arn
2727
ecr_repository_url = data.terraform_remote_state.deploy_ecr.outputs.forms_admin_ecr_repository_url
2828
}

infra/deployments/deploy/inputs.tf

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ variable "deploy_account_id" {
66

77
variable "codestar_connection_arn" {
88
description = "the arn of the github connection to use"
9-
type = object({
10-
alphagov = string
11-
govuk-forms = string
12-
})
13-
default = {
14-
alphagov = "arn:aws:codestar-connections:eu-west-2:711966560482:connection/8ad08da2-743c-4431-bee6-ad1ae9efebe7"
15-
govuk-forms = "arn:aws:codeconnections:eu-west-2:711966560482:connection/c285479e-88b3-430e-8c59-d96035a30f53"
16-
}
9+
type = string
10+
default = "arn:aws:codeconnections:eu-west-2:711966560482:connection/c285479e-88b3-430e-8c59-d96035a30f53"
1711
}
1812

1913
variable "send_logs_to_cyber" {

infra/deployments/deploy/tools/pipeline-visualiser-pipeline.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ resource "aws_codepipeline" "deploy_pipeline_visualiser" {
2727
output_artifacts = ["forms_deploy"]
2828

2929
configuration = {
30-
ConnectionArn = var.codestar_connection_arn.govuk-forms
30+
ConnectionArn = var.codestar_connection_arn
3131
FullRepositoryId = "govuk-forms/forms-deploy"
3232
BranchName = var.pipeline_source_branch
3333
DetectChanges = true
@@ -109,7 +109,7 @@ module "pipeline_visualiser_docker_build" {
109109
docker_username_parameter_path = "/docker/username"
110110
docker_password_parameter_path = "/docker/password"
111111
artifact_store_arn = module.pipeline_visualiser_artifact_bucket.arn
112-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
112+
codestar_connection_arn = var.codestar_connection_arn
113113
ecr_repository_url = data.terraform_remote_state.deploy_ecr.outputs.pipeline_visualiser_ecr_repository_url
114114
}
115115

@@ -174,12 +174,12 @@ data "aws_iam_policy_document" "pipeline_visualiser_deployer" {
174174
"codestar-connections:GetConnection",
175175
"codestar-connections:ListConnections"
176176
]
177-
resources = [var.codestar_connection_arn.alphagov, var.codestar_connection_arn.govuk-forms]
177+
resources = [var.codestar_connection_arn]
178178
effect = "Allow"
179179
}
180180
statement {
181181
actions = ["codecommit:Get*", "codecommit:Describe*", "codecommit:GitPull"]
182-
resources = [var.codestar_connection_arn.alphagov, var.codestar_connection_arn.govuk-forms]
182+
resources = [var.codestar_connection_arn]
183183
effect = "Allow"
184184
}
185185

infra/deployments/forms/account/engineer-access.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module "engineer_access" {
1212
pentesters = var.pentester_email_addresses
1313
pentester_cidrs = var.pentester_cidr_ranges
1414
vpn = var.require_vpn_to_access
15-
codestar_connection_arn = var.codestar_connection_arn.govuk-forms
15+
codestar_connection_arn = var.codestar_connection_arn
1616
allow_rds_data_api_access = true
1717
allow_ecs_task_usage = true
1818
state_file_bucket_name = var.bucket

infra/deployments/forms/account/inputs.tf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,8 @@ EOF
7676

7777
variable "codestar_connection_arn" {
7878
description = "It isn't possible to automate the creation of a CodeStar connection, so we must create it by hand once in each account and hardcode its ARN."
79-
type = object({
80-
alphagov = string
81-
govuk-forms = string
82-
})
83-
nullable = false
79+
type = string
80+
nullable = false
8481
}
8582

8683
variable "deploy_account_id" {
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
account_name = "dev"
2-
aws_account_id = "498160065950"
3-
environment_name = "dev"
4-
environment_type = "development"
5-
require_vpn_to_access = false
6-
apex_domain = "dev.forms.service.gov.uk"
7-
dns_delegation_records = {}
8-
codestar_connection_arn = {
9-
alphagov = "arn:aws:codestar-connections:eu-west-2:498160065950:connection/9dcd616c-3f7d-4f20-8a6b-8fca788e674b"
10-
govuk-forms = "arn:aws:codeconnections:eu-west-2:498160065950:connection/42243c20-40e2-467d-b135-999f91c37b55"
11-
}
1+
account_name = "dev"
2+
aws_account_id = "498160065950"
3+
environment_name = "dev"
4+
environment_type = "development"
5+
require_vpn_to_access = false
6+
apex_domain = "dev.forms.service.gov.uk"
7+
dns_delegation_records = {}
8+
codestar_connection_arn = "arn:aws:codeconnections:eu-west-2:498160065950:connection/42243c20-40e2-467d-b135-999f91c37b55"
129
deploy_account_id = "711966560482"
1310
pentester_email_addresses = []
1411
pentester_cidr_ranges = []

infra/deployments/forms/account/tfvars/production.tfvars

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ dns_delegation_records = {
3838
"ns-785.awsdns-34.net",
3939
]
4040
}
41-
codestar_connection_arn = {
42-
alphagov = "arn:aws:codestar-connections:eu-west-2:443944947292:connection/c253c931-651d-4d48-950a-c1ac2dfd7ca8"
43-
govuk-forms = "arn:aws:codeconnections:eu-west-2:443944947292:connection/a2c94a66-2c03-45db-bb18-5c37f8b44531"
44-
}
41+
codestar_connection_arn = "arn:aws:codeconnections:eu-west-2:443944947292:connection/a2c94a66-2c03-45db-bb18-5c37f8b44531"
4542
deploy_account_id = "711966560482"
4643
pentester_email_addresses = []
4744
pentester_cidr_ranges = []
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
account_name = "staging"
2-
aws_account_id = "972536609845"
3-
environment_name = "staging"
4-
environment_type = "staging"
5-
require_vpn_to_access = true
6-
apex_domain = "staging.forms.service.gov.uk"
7-
dns_delegation_records = {}
8-
codestar_connection_arn = {
9-
alphagov = "arn:aws:codestar-connections:eu-west-2:972536609845:connection/de05d028-2cbd-4d06-8946-0e4aca60f4ca"
10-
govuk-forms = "arn:aws:codeconnections:eu-west-2:972536609845:connection/065d6101-9c43-4336-8fd4-777f3d6fc791"
11-
}
1+
account_name = "staging"
2+
aws_account_id = "972536609845"
3+
environment_name = "staging"
4+
environment_type = "staging"
5+
require_vpn_to_access = true
6+
apex_domain = "staging.forms.service.gov.uk"
7+
dns_delegation_records = {}
8+
codestar_connection_arn = "arn:aws:codeconnections:eu-west-2:972536609845:connection/065d6101-9c43-4336-8fd4-777f3d6fc791"
129
deploy_account_id = "711966560482"
1310
pentester_email_addresses = []
1411
pentester_cidr_ranges = []

0 commit comments

Comments
 (0)