Skip to content

Commit 1a5dd1d

Browse files
Revert "[PRMT-32] - Temporarily turn on Data Collection ECS ECR on Sandbox"
1 parent 34705ac commit 1a5dd1d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

infrastructure/ecr.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module "ndr-docker-ecr-ui" {
77
owner = var.owner
88
}
99
module "ndr-docker-ecr-data-collection" {
10-
count = 1
10+
count = local.is_sandbox ? 0 : 1
1111
source = "./modules/ecr/"
1212
app_name = "${terraform.workspace}-data-collection"
1313
current_account_id = data.aws_caller_identity.current.account_id

infrastructure/ecs.tf

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module "ndr-ecs-container-port-ssm-parameter" {
3333
}
3434

3535
module "ndr-ecs-fargate-data-collection" {
36-
count = 1
36+
count = local.is_sandbox ? 0 : 1
3737
source = "./modules/ecs"
3838
ecs_cluster_name = "data-collection"
3939
vpc_id = module.ndr-vpc-ui.vpc_id
@@ -89,7 +89,7 @@ module "ndr-ecs-fargate-data-collection" {
8989
}
9090

9191
resource "aws_iam_role" "data_collection_task_role" {
92-
count = 1
92+
count = local.is_sandbox ? 0 : 1
9393
name = "${terraform.workspace}_data_collection_task_role"
9494
assume_role_policy = jsonencode(
9595
{
@@ -111,49 +111,49 @@ resource "aws_iam_role" "data_collection_task_role" {
111111
}
112112

113113
resource "aws_iam_role_policy_attachment" "data_collection_ssm_access_policy" {
114-
count = 1
114+
count = local.is_sandbox ? 0 : 1
115115
role = aws_iam_role.data_collection_task_role[0].name
116116
policy_arn = aws_iam_policy.ssm_access_policy.arn
117117
}
118118

119119
resource "aws_iam_role_policy_attachment" "data_collection_statistics_dynamodb_table" {
120-
count = 1
120+
count = local.is_sandbox ? 0 : 1
121121
role = aws_iam_role.data_collection_task_role[0].name
122122
policy_arn = module.statistics_dynamodb_table.dynamodb_policy
123123
}
124124

125125
resource "aws_iam_role_policy_attachment" "data_collection_statistical_reports_store" {
126-
count = 1
126+
count = local.is_sandbox ? 0 : 1
127127
role = aws_iam_role.data_collection_task_role[0].name
128128
policy_arn = module.statistical-reports-store.s3_object_access_policy
129129
}
130130

131131
resource "aws_iam_role_policy_attachment" "data_collection_app_config" {
132-
count = 1
132+
count = local.is_sandbox ? 0 : 1
133133
role = aws_iam_role.data_collection_task_role[0].name
134134
policy_arn = module.ndr-app-config.app_config_policy_arn
135135
}
136136

137137
resource "aws_iam_role_policy_attachment" "data_collection_lloyd_george_store" {
138-
count = 1
138+
count = local.is_sandbox ? 0 : 1
139139
role = aws_iam_role.data_collection_task_role[0].name
140140
policy_arn = module.ndr-lloyd-george-store.s3_list_object_policy
141141
}
142142

143143
resource "aws_iam_role_policy_attachment" "data_collection_document_store" {
144-
count = 1
144+
count = local.is_sandbox ? 0 : 1
145145
role = aws_iam_role.data_collection_task_role[0].name
146146
policy_arn = module.ndr-document-store.s3_list_object_policy
147147
}
148148

149149
resource "aws_iam_role_policy_attachment" "data_collection_document_reference_dynamodb_table" {
150-
count = 1
150+
count = local.is_sandbox ? 0 : 1
151151
role = aws_iam_role.data_collection_task_role[0].name
152152
policy_arn = module.document_reference_dynamodb_table.dynamodb_policy
153153
}
154154

155155
resource "aws_iam_role_policy_attachment" "data_collection_cloudwatch_log_query_policy" {
156-
count = 1
156+
count = local.is_sandbox ? 0 : 1
157157
role = aws_iam_role.data_collection_task_role[0].name
158158
policy_arn = aws_iam_policy.cloudwatch_log_query_policy.arn
159159
}

infrastructure/schedules.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ resource "aws_lambda_permission" "statistical_report_schedule_permission" {
116116
}
117117

118118
resource "aws_scheduler_schedule" "data_collection_ecs" {
119-
count = 1
119+
count = local.is_sandbox ? 0 : 1
120120
name_prefix = "${terraform.workspace}_data_collection_ecs"
121121
description = "A weekly trigger for the data collection run"
122122

@@ -143,7 +143,7 @@ resource "aws_scheduler_schedule" "data_collection_ecs" {
143143
}
144144

145145
resource "aws_iam_role" "data_collection_ecs_execution" {
146-
count = 1
146+
count = local.is_sandbox ? 0 : 1
147147
name = "${terraform.workspace}_data_collection_scheduler_role"
148148
assume_role_policy = jsonencode({
149149
Version = "2012-10-17"
@@ -160,7 +160,7 @@ resource "aws_iam_role" "data_collection_ecs_execution" {
160160
}
161161

162162
resource "aws_iam_role_policy_attachment" "data_collection_ecs_execution" {
163-
count = 1
163+
count = local.is_sandbox ? 0 : 1
164164
role = aws_iam_role.data_collection_ecs_execution[0].name
165165
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceEventsRole"
166166
}

0 commit comments

Comments
 (0)