Skip to content

Commit

Permalink
Fix TF resource addressing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iuriaranda committed Dec 23, 2020
1 parent 15d99d9 commit 0b80439
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions site-main/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ data "template_file" "bucket_policy" {
}

resource "aws_s3_bucket" "website_bucket" {
bucket = var.bucket_name
policy = data.template_file.bucket_policy.rendered
bucket = var.bucket_name
policy = data.template_file.bucket_policy.rendered
force_destroy = var.force_destroy

website {
Expand Down Expand Up @@ -68,7 +68,7 @@ data "template_file" "deployer_role_policy_file" {
}

resource "aws_iam_policy" "site_deployer_policy" {
count = var.deployer != null ? 1 : 0
count = var.deployer != null ? 1 : 0

name = "${var.bucket_name}.deployer"
path = "/"
Expand All @@ -77,11 +77,11 @@ resource "aws_iam_policy" "site_deployer_policy" {
}

resource "aws_iam_policy_attachment" "site-deployer-attach-user-policy" {
count = var.deployer != null ? 1 : 0
count = var.deployer != null ? 1 : 0

name = "${var.bucket_name}-deployer-policy-attachment"
users = [var.deployer]
policy_arn = aws_iam_policy.site_deployer_policy.arn
policy_arn = aws_iam_policy.site_deployer_policy.0.arn
}

################################################################################################################
Expand Down
6 changes: 3 additions & 3 deletions site-redirect/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ data "template_file" "deployer_role_policy_file" {
}

resource "aws_iam_policy" "site_deployer_policy" {
count = var.deployer != null ? 1 : 0
count = var.deployer != null ? 1 : 0

name = "site.${replace(replace(var.domain, ".", "-"), "*", "star")}.deployer"
path = "/"
Expand All @@ -74,11 +74,11 @@ resource "aws_iam_policy" "site_deployer_policy" {
}

resource "aws_iam_policy_attachment" "staging-site-deployer-attach-user-policy" {
count = var.deployer != null ? 1 : 0
count = var.deployer != null ? 1 : 0

name = "site.${replace(replace(var.domain, ".", "-"), "*", "star")}-deployer-policy-attachment"
users = [var.deployer]
policy_arn = aws_iam_policy.site_deployer_policy.arn
policy_arn = aws_iam_policy.site_deployer_policy.0.arn
}

################################################################################################################
Expand Down

0 comments on commit 0b80439

Please sign in to comment.