Skip to content

Commit 521f758

Browse files
committed
Updated terraform folder to handle new INT account
1 parent 07a74eb commit 521f758

File tree

8 files changed

+271
-263
lines changed

8 files changed

+271
-263
lines changed

terraform/.terraform.lock.hcl

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
-include .env
22

3-
interactionId=$(environment)
4-
5-
aws_profile = apim-dev
6-
tf_cmd = AWS_PROFILE=$(aws_profile) terraform
3+
environment ?= $(ENVIRONMENT)
4+
aws_account_name ?= $(AWS_ACCOUNT_NAME)
5+
tf_cmd = AWS_PROFILE=$(AWS_PROFILE) terraform
76

87
project_name = immunisation
98
project_short_name = imms
10-
state_bucket = $(project_name)-$(APIGEE_ENVIRONMENT)-terraform-state-files
11-
tf_state= -backend-config="bucket=$(state_bucket)"
9+
tf_state= -backend-config="bucket=$(BUCKET_NAME)"
1210

13-
tf_vars= -var="project_name=$(project_name)" -var="project_short_name=$(project_short_name)"
11+
tf_vars= -var="project_name=$(project_name)" -var="project_short_name=$(project_short_name)" -var="aws_account_name=$(aws_account_name)"
1412

1513
.PHONY : lock-provider workspace init plan apply clean destroy output state-list lambda-zip catch-all-zip
1614

@@ -25,7 +23,10 @@ workspace:
2523
init:
2624
$(tf_cmd) init $(tf_state) -upgrade $(tf_vars)
2725

28-
plan: workspace
26+
init-reconfigure:
27+
$(tf_cmd) init $(tf_state) -upgrade $(tf_vars) -reconfigure
28+
29+
plan:
2930
$(tf_cmd) plan $(tf_vars)
3031

3132
plan-changes: workspace

terraform/api_gateway/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ variable "environment" {}
66
variable "oas" {}
77

88
locals {
9-
environment = terraform.workspace == "green" ? "prod" : terraform.workspace == "blue" ? "prod" : terraform.workspace
10-
config_env = local.environment == "prod" ? "prod" : "dev"
9+
environment = var.environment
10+
config_env = var.environment
1111
}

terraform/configs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
locals {
22
// Flag so we can force delete s3 buckets with items in for pr and shortcode environments only.
33
is_temp = length(regexall("[a-z]{2,4}-?[0-9]+", local.env)) > 0
4-
dspp_core_account_id = local.environment == "prod" ? 232116723729 : 603871901111
5-
immunisation_account_id = local.environment == "prod" ? 664418956997 : 084828561157
4+
dspp_core_account_id = local.environment == "prod" ? "232116723729" : "603871901111"
5+
immunisation_account_id = local.environment == "prod" ? "664418956997" : "084828561157"
66
}

terraform/endpoints.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ module "api_gateway" {
107107
short_prefix = local.short_prefix
108108
zone_id = data.aws_route53_zone.project_zone.zone_id
109109
api_domain_name = local.service_domain_name
110-
environment = local.environment
110+
environment = var.aws_account_name
111111
oas = local.oas
112112
}
113113

terraform/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ terraform {
1717
}
1818

1919
provider "aws" {
20-
region = var.aws_region
21-
profile = "apim-dev"
20+
region = var.aws_region
21+
#profile = "apim-dev"
2222
default_tags {
2323
tags = {
2424
Project = var.project_name

0 commit comments

Comments
 (0)