Skip to content

Commit 7a19b30

Browse files
Refactor out bucket name (#3266)
- Bucket names are globally unique - Being able to change the name with variables instead of file changes is therefore ideal
2 parents 2160191 + 92578dc commit 7a19b30

File tree

10 files changed

+15
-2
lines changed

10 files changed

+15
-2
lines changed

terraform/app/codedeploy.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "aws_codedeploy_deployment_group" "blue_green_deployment_group" {
5353
}
5454

5555
resource "aws_s3_bucket" "code_deploy_bucket" {
56-
bucket = "appspec-bucket-${var.environment}"
56+
bucket = var.appspec_bucket
5757
force_destroy = true
5858
}
5959

terraform/app/env/copilotmigration.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ splunk_enabled = "false"
1919
cis2_enabled = "false"
2020
pds_enabled = "false"
2121
minimum_replicas = 3
22+
appspec_bucket = "nhse-mavis-appspec-bucket-copilotmigration"

terraform/app/env/poc.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ http_hosts = {
1515
MAVIS__HOST = "poc.mavistesting.com"
1616
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "poc.mavistesting.com"
1717
}
18+
appspec_bucket = "nhse-mavis-appspec-bucket-poc"

terraform/app/env/preview.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ http_hosts = {
2323
}
2424

2525
minimum_replicas = 3
26+
appspec_bucket = "nhse-mavis-appspec-bucket-preview"

terraform/app/env/production.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ http_hosts = {
2323
}
2424

2525
minimum_replicas = 3
26+
appspec_bucket = "nhse-mavis-appspec-bucket-production"
2627
account_id = 820242920762
2728
vpc_log_retention_days = 14
2829
ecs_log_retention_days = 30

terraform/app/env/qa.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ http_hosts = {
2222
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "qa.mavistesting.com"
2323
}
2424
minimum_replicas = 3
25+
appspec_bucket = "nhse-mavis-appspec-bucket-qa"

terraform/app/env/test.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ http_hosts = {
2222
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "test.mavistesting.com"
2323
}
2424
minimum_replicas = 3
25+
appspec_bucket = "nhse-mavis-appspec-bucket-test"

terraform/app/env/training.tfvars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ http_hosts = {
2525
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "training.manage-vaccinations-in-schools.nhs.uk"
2626
}
2727
minimum_replicas = 3
28+
appspec_bucket = "nhse-mavis-appspec-bucket-training"

terraform/app/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ variable "access_logs_bucket" {
2323
description = "Name of the S3 bucket which stores access logs for various resources"
2424
}
2525

26+
variable "appspec_bucket" {
27+
type = string
28+
description = "Name of the S3 bucket which stores appspec files"
29+
nullable = false
30+
}
31+
2632
variable "account_id" {
2733
type = string
2834
default = "393416225559"

terraform/scripts/bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ http_hosts = {
107107
MAVIS__GIVE_OR_REFUSE_CONSENT_HOST = "$ENV.mavistesting.com"
108108
}
109109
minimum_replicas = 3
110-
db_delete_protection = true
110+
appspec_bucket = "nhse-mavis-appspec-bucket-$ENV"
111111
112112
EOF
113113
}

0 commit comments

Comments
 (0)