diff --git a/s3-access-logs/policy_data.tf b/s3-access-logs/policy_data.tf index 7174d72..0f5e2be 100644 --- a/s3-access-logs/policy_data.tf +++ b/s3-access-logs/policy_data.tf @@ -14,7 +14,7 @@ data "aws_iam_policy_document" "logs_s3" { type = "AWS" identifiers = [ format("arn:%v:iam::%v:root", data.aws_arn.current.partition, local.account_id), - format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.main.id), + format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.elb_account_id.id), ] } } @@ -41,7 +41,7 @@ data "aws_iam_policy_document" "logs_s3" { test = "ArnLike" variable = "aws:SourceArn" # values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, local.account_id)] - values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.main.id)] + values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.elb_account_id.id)] } } statement { @@ -62,7 +62,7 @@ data "aws_iam_policy_document" "logs_s3" { test = "ArnLike" variable = "aws:SourceArn" # values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, local.account_id)] - values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.main.id)] + values = [format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.elb_account_id.id)] } } @@ -78,7 +78,7 @@ data "aws_iam_policy_document" "logs_s3" { type = "AWS" identifiers = [ format("arn:%v:iam::%v:root", data.aws_arn.current.partition, local.account_id), - format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.main.id), + format("arn:%v:logs:%v:%v:*", data.aws_arn.current.partition, local.logs_region, data.aws_elb_service_account.elb_account_id.id), ] } }