diff --git a/infrastructure/terraform/lambda/condition-etl/main.tf b/infrastructure/terraform/lambda/condition-etl/main.tf index 69536881..fa00185f 100644 --- a/infrastructure/terraform/lambda/condition-etl/main.tf +++ b/infrastructure/terraform/lambda/condition-etl/main.tf @@ -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 } \ No newline at end of file