Skip to content

Commit 95fb1c5

Browse files
committed
Set scope for s3 and dynamo resources
1 parent ecde31a commit 95fb1c5

File tree

12 files changed

+67
-56
lines changed

12 files changed

+67
-56
lines changed

terraform/dynamodb.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_dynamodb_table" "audit-table" {
2-
name = "immunisation-batch-${var.sub_environment}-audit-table"
2+
name = "immunisation-batch-${local.resource_scope}-audit-table"
33
billing_mode = "PAY_PER_REQUEST"
44
hash_key = "message_id"
55

@@ -47,7 +47,7 @@ resource "aws_dynamodb_table" "audit-table" {
4747
}
4848

4949
resource "aws_dynamodb_table" "delta-dynamodb-table" {
50-
name = "imms-${var.sub_environment}-delta"
50+
name = "imms-${local.resource_scope}-delta"
5151
billing_mode = "PAY_PER_REQUEST"
5252
hash_key = "PK"
5353

@@ -106,7 +106,7 @@ resource "aws_dynamodb_table" "delta-dynamodb-table" {
106106
}
107107

108108
resource "aws_dynamodb_table" "events-dynamodb-table" {
109-
name = "imms-${var.sub_environment}-imms-events"
109+
name = "imms-${local.resource_scope}-imms-events"
110110
billing_mode = "PAY_PER_REQUEST"
111111
hash_key = "PK"
112112
stream_enabled = true
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "dev"
2-
immunisation_account_id = "345594581768"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "int"
5-
pds_check_enabled = false
6-
create_mesh_processor = true
1+
environment = "dev"
2+
immunisation_account_id = "345594581768"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "int"
5+
pds_check_enabled = false
6+
create_mesh_processor = true
7+
has_sub_environment_scope = true
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "dev"
2-
immunisation_account_id = "345594581768"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "int"
5-
pds_check_enabled = true
6-
create_mesh_processor = false
1+
environment = "dev"
2+
immunisation_account_id = "345594581768"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "int"
5+
pds_check_enabled = true
6+
create_mesh_processor = false
7+
has_sub_environment_scope = true
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "dev"
2-
immunisation_account_id = "345594581768"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "int"
5-
pds_check_enabled = true
6-
create_mesh_processor = false
1+
environment = "dev"
2+
immunisation_account_id = "345594581768"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "int"
5+
pds_check_enabled = true
6+
create_mesh_processor = false
7+
has_sub_environment_scope = true
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "dev"
2-
immunisation_account_id = "345594581768"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "ref"
5-
pds_check_enabled = true
6-
create_mesh_processor = false
1+
environment = "dev"
2+
immunisation_account_id = "345594581768"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "ref"
5+
pds_check_enabled = true
6+
create_mesh_processor = false
7+
has_sub_environment_scope = true
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "int"
2-
immunisation_account_id = "084828561157"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "int"
5-
pds_check_enabled = false
6-
create_mesh_processor = true
1+
environment = "int"
2+
immunisation_account_id = "084828561157"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "int"
5+
pds_check_enabled = false
6+
create_mesh_processor = true
7+
has_sub_environment_scope = false
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "int"
2-
immunisation_account_id = "084828561157"
3-
dspp_core_account_id = "603871901111"
4-
pds_environment = "int"
5-
pds_check_enabled = false
6-
create_mesh_processor = true
1+
environment = "int"
2+
immunisation_account_id = "084828561157"
3+
dspp_core_account_id = "603871901111"
4+
pds_environment = "int"
5+
pds_check_enabled = false
6+
create_mesh_processor = true
7+
has_sub_environment_scope = false
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
environment = "prod"
2-
immunisation_account_id = "664418956997"
3-
dspp_core_account_id = "232116723729"
4-
pds_environment = "prod"
5-
pds_check_enabled = true
6-
create_mesh_processor = true
7-
1+
environment = "prod"
2+
immunisation_account_id = "664418956997"
3+
dspp_core_account_id = "232116723729"
4+
pds_environment = "prod"
5+
pds_check_enabled = true
6+
create_mesh_processor = true
7+
has_sub_environment_scope = false
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
environment = "prod"
2-
immunisation_account_id = "664418956997"
3-
dspp_core_account_id = "232116723729"
4-
pds_environment = "prod"
5-
pds_check_enabled = true
6-
create_mesh_processor = true
1+
environment = "prod"
2+
immunisation_account_id = "664418956997"
3+
dspp_core_account_id = "232116723729"
4+
pds_environment = "prod"
5+
pds_check_enabled = true
6+
create_mesh_processor = true
7+
has_sub_environment_scope = false

terraform/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ provider "aws" {
2121
default_tags {
2222
tags = {
2323
Project = var.project_name
24-
Environment = var.sub_environment
24+
Environment = var.has_sub_environment_scope ? var.sub_environment : var.environment
2525
Service = var.service
2626
}
2727
}

0 commit comments

Comments
 (0)