Skip to content

Commit 08cc3e7

Browse files
committed
VED-726: Apply consistent permissions for the DPS account in all environments.
1 parent 1e09d18 commit 08cc3e7

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

terraform/dps_role_creation.tf

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,9 @@ resource "aws_iam_role_policy" "dynamo_s3_access_policy" {
2222
Statement = [
2323
{
2424
Effect = "Allow",
25-
Action = var.environment == "prod" ? [
26-
"dynamodb:GetItem",
27-
"dynamodb:Query"
28-
] : [
25+
Action = [
2926
"dynamodb:BatchGetItem",
3027
"dynamodb:GetItem",
31-
"dynamodb:PutItem",
32-
"dynamodb:UpdateItem",
3328
"dynamodb:Query"
3429
],
3530
Resource = [

terraform/id_sync_lambda.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010
# Calculate SHA for both directories
1111
shared_dir_sha = sha1(join("", [for f in local.shared_files : filesha1("${local.shared_dir}/${f}")]))
1212
id_sync_lambda_dir_sha = sha1(join("", [for f in local.id_sync_lambda_files : filesha1("${local.id_sync_lambda_dir}/${f}")]))
13-
id_sync_lambda_name = "${local.short_prefix}-id_sync_lambda"
13+
id_sync_lambda_name = "${local.short_prefix}-id_sync_lambda"
1414
}
1515

1616
resource "aws_ecr_repository" "id_sync_lambda_repository" {
@@ -225,14 +225,14 @@ resource "aws_iam_policy" "id_sync_lambda_kms_access_policy" {
225225
data.aws_kms_key.existing_s3_encryption_key.arn,
226226
]
227227
},
228-
{
229-
Effect = "Allow"
230-
Action = [
231-
"kms:Decrypt",
232-
"kms:GenerateDataKey*"
233-
]
234-
Resource = data.aws_kms_key.existing_dynamo_encryption_key.arn
235-
}
228+
{
229+
Effect = "Allow"
230+
Action = [
231+
"kms:Decrypt",
232+
"kms:GenerateDataKey*"
233+
]
234+
Resource = data.aws_kms_key.existing_dynamo_encryption_key.arn
235+
}
236236
]
237237
})
238238
}

terraform/sqs_id_sync.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "aws_sqs_queue" "id_sync_queue" {
2-
name = "${local.short_prefix}-id-sync-queue"
3-
kms_master_key_id = data.aws_kms_key.existing_id_sync_sqs_encryption_key.arn
4-
visibility_timeout_seconds = 360
2+
name = "${local.short_prefix}-id-sync-queue"
3+
kms_master_key_id = data.aws_kms_key.existing_id_sync_sqs_encryption_key.arn
4+
visibility_timeout_seconds = 360
55
redrive_policy = jsonencode({
66
deadLetterTargetArn = aws_sqs_queue.id_sync_dlq.arn
77
maxReceiveCount = 4

0 commit comments

Comments
 (0)