mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
read policy ARN from shared stack state
This commit is contained in:
parent
1e1db67f3c
commit
658761933b
1 changed files with 8 additions and 5 deletions
|
|
@ -6,10 +6,13 @@ locals {
|
||||||
db_credentials = jsondecode(data.aws_secretsmanager_secret_version.db_credentials.secret_string)
|
db_credentials = jsondecode(data.aws_secretsmanager_secret_version.db_credentials.secret_string)
|
||||||
}
|
}
|
||||||
|
|
||||||
module "shared" {
|
data "terraform_remote_state" "shared" {
|
||||||
source = "../../shared"
|
backend = "s3"
|
||||||
stage = var.stage
|
config = {
|
||||||
allowed_origins = var.allowed_origins
|
bucket = "condition-etl-terraform-state"
|
||||||
|
key = "shared/terraform.tfstate"
|
||||||
|
region = "eu-west-2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module "lambda" {
|
module "lambda" {
|
||||||
|
|
@ -34,5 +37,5 @@ module "lambda" {
|
||||||
|
|
||||||
resource "aws_iam_role_policy_attachment" "attach_condition_etl_s3_read" {
|
resource "aws_iam_role_policy_attachment" "attach_condition_etl_s3_read" {
|
||||||
role = module.lambda.role.role_name
|
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
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue