Skip to content

Commit c2241a5

Browse files
committed
initial code
1 parent 7123b2d commit c2241a5

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

terraform/redis_sync_lambda.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ resource "aws_cloudwatch_log_group" "redis_sync_log_group" {
254254
# S3 Bucket notification to trigger Lambda function for config bucket
255255
resource "aws_s3_bucket_notification" "config_lambda_notification" {
256256
# For now, only create a trigger in internal-dev and prod as those are the envs with a config bucket
257-
count = local.create_config_bucket ? 1 : 0
257+
# count = local.create_config_bucket ? 1 : 0
258258

259259
bucket = aws_s3_bucket.batch_config_bucket[0].bucket
260260

@@ -266,7 +266,7 @@ resource "aws_s3_bucket_notification" "config_lambda_notification" {
266266

267267
# Permission for the new S3 bucket to invoke the Lambda function
268268
resource "aws_lambda_permission" "new_s3_invoke_permission" {
269-
count = local.create_config_bucket ? 1 : 0
269+
# count = local.create_config_bucket ? 1 : 0
270270

271271
statement_id = "AllowExecutionFromNewS3"
272272
action = "lambda:InvokeFunction"

terraform/s3_config.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ resource "aws_s3_bucket_lifecycle_configuration" "data_destinations" {
193193

194194
resource "aws_s3_bucket" "batch_config_bucket" {
195195
# For now, only create in internal-dev and prod as we only have one shared Redis instance per account.
196-
count = local.create_config_bucket ? 1 : 0
196+
# count = local.create_config_bucket ? 1 : 0
197197

198198
bucket = "imms-${local.environment}-supplier-config"
199199
}
200200

201201
resource "aws_s3_bucket_public_access_block" "batch_config_bucket_public_access_block" {
202-
count = local.create_config_bucket ? 1 : 0
202+
# count = local.create_config_bucket ? 1 : 0
203203

204204
bucket = aws_s3_bucket.batch_config_bucket[0].id
205205

@@ -210,7 +210,7 @@ resource "aws_s3_bucket_public_access_block" "batch_config_bucket_public_access_
210210
}
211211

212212
resource "aws_s3_bucket_policy" "batch_config_bucket_policy" {
213-
count = local.create_config_bucket ? 1 : 0
213+
# count = local.create_config_bucket ? 1 : 0
214214

215215
bucket = aws_s3_bucket.batch_config_bucket[0].id
216216

terraform/variables.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ locals {
2828
service_domain_name = "${local.env}.${local.project_domain_name}"
2929

3030
# For now, only create the config bucket in internal-dev and prod as we only have one Redis instance per account.
31-
create_config_bucket = local.environment == local.config_bucket_env
32-
config_bucket_arn = local.create_config_bucket ? aws_s3_bucket.batch_config_bucket[0].arn : data.aws_s3_bucket.existing_config_bucket[0].arn
33-
config_bucket_name = local.create_config_bucket ? aws_s3_bucket.batch_config_bucket[0].bucket : data.aws_s3_bucket.existing_config_bucket[0].bucket
31+
# create_config_bucket = local.environment == local.config_bucket_env
32+
# config_bucket_arn = local.create_config_bucket ? aws_s3_bucket.batch_config_bucket[0].arn : data.aws_s3_bucket.existing_config_bucket[0].arn
33+
# config_bucket_name = local.create_config_bucket ? aws_s3_bucket.batch_config_bucket[0].bucket : data.aws_s3_bucket.existing_config_bucket[0].bucket
34+
35+
config_bucket_arn = aws_s3_bucket.batch_config_bucket[0].arn
36+
config_bucket_name = aws_s3_bucket.batch_config_bucket[0].bucket
37+
3438

3539
# Public subnet - The subnet has a direct route to an internet gateway. Resources in a public subnet can access the public internet.
3640
# public_subnet_ids = [for k, v in data.aws_route.internet_traffic_route_by_subnet : k if length(v.gateway_id) > 0]

0 commit comments

Comments
 (0)