From d9708fe516b276b931f45f5f4da6251ae3afab22 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Thu, 12 Feb 2026 12:30:28 +0000 Subject: [PATCH] push policy --- infrastructure/terraform/lambda/address2UPRN/main.tf | 6 ++++++ infrastructure/terraform/shared/main.tf | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/infrastructure/terraform/lambda/address2UPRN/main.tf b/infrastructure/terraform/lambda/address2UPRN/main.tf index caf06785..12f0a4b3 100644 --- a/infrastructure/terraform/lambda/address2UPRN/main.tf +++ b/infrastructure/terraform/lambda/address2UPRN/main.tf @@ -44,3 +44,9 @@ module "address2uprn" { }, ) } + +# Attach S3 read policy to the Lambda execution role +resource "aws_iam_role_policy_attachment" "address2uprn_read_and_write" { + role = module.lambda.role_name + policy_arn = data.terraform_remote_state.shared.outputs.address_2_uprn_s3_read_and_write_arn +} \ No newline at end of file diff --git a/infrastructure/terraform/shared/main.tf b/infrastructure/terraform/shared/main.tf index 4ec57c3e..9733f5f9 100644 --- a/infrastructure/terraform/shared/main.tf +++ b/infrastructure/terraform/shared/main.tf @@ -316,8 +316,8 @@ module "address2uprn_s3_read_and_write" { resource_paths = ["/*"] } -output "postcode_splitter_s3_read_arn" { - value = module.postcode_splitter_s3_read.policy_arn +output "address_2_uprn_s3_read_and_write_arn" { + value = module.address2uprn_s3_read_and_write.policy_arn } ################################################