read policy ARN from shared stack state

This commit is contained in:
Daniel Roth 2026-02-09 14:56:46 +00:00
parent 1e1db67f3c
commit 658761933b

View file

@ -6,10 +6,13 @@ locals {
db_credentials = jsondecode(data.aws_secretsmanager_secret_version.db_credentials.secret_string)
}
module "shared" {
source = "../../shared"
stage = var.stage
allowed_origins = var.allowed_origins
data "terraform_remote_state" "shared" {
backend = "s3"
config = {
bucket = "condition-etl-terraform-state"
key = "shared/terraform.tfstate"
region = "eu-west-2"
}
}
module "lambda" {
@ -34,5 +37,5 @@ module "lambda" {
resource "aws_iam_role_policy_attachment" "attach_condition_etl_s3_read" {
role = module.lambda.role.role_name
policy_arn = module.shared.condition_etl_s3_read_arn
policy_arn = data.terraform_remote_state.shared.outputs.condition_etl_s3_read_arn
}