Skip to content

Commit

Permalink
Merge pull request #8 from clouddrove/PR-1
Browse files Browse the repository at this point in the history
FIx count issue
  • Loading branch information
Sohan Yadav authored Apr 28, 2020
2 parents 3faa0af + a3b8dd0 commit d706277
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ resource "aws_s3_bucket" "s3_default" {
resource "aws_s3_bucket_policy" "s3_default" {
count = var.create_bucket && var.bucket_policy && var.bucket_enabled == true ? 1 : 0

bucket = aws_s3_bucket.s3_default[count.index].id
bucket = join("", aws_s3_bucket.s3_default.*.id)
policy = var.aws_iam_policy_document
}

Expand Down Expand Up @@ -144,7 +144,7 @@ resource "aws_s3_bucket" "s3_website" {
resource "aws_s3_bucket_policy" "s3_website" {
count = var.create_bucket && var.bucket_policy && var.website_hosting_bucket == true ? 1 : 0

bucket = aws_s3_bucket.s3_website[count.index].id
bucket = join("", aws_s3_bucket.s3_website.*.id)
policy = var.aws_iam_policy_document
}

Expand Down Expand Up @@ -277,7 +277,7 @@ resource "aws_s3_bucket" "s3_logging_encryption" {
resource "aws_s3_bucket_policy" "s3_logging_encryption" {
count = var.create_bucket && var.bucket_policy && var.bucket_logging_encryption_enabled == true ? 1 : 0

bucket = aws_s3_bucket.s3_logging[count.index].id
bucket = join("", aws_s3_bucket.s3_logging.*.id)
policy = var.aws_iam_policy_document
}

Expand All @@ -287,7 +287,7 @@ resource "aws_s3_bucket_policy" "s3_logging_encryption" {
resource "aws_s3_bucket_policy" "s3_logging" {
count = var.create_bucket && var.bucket_policy && var.bucket_logging_enabled == true ? 1 : 0

bucket = aws_s3_bucket.s3_logging[count.index].id
bucket = join("", aws_s3_bucket.s3_logging.*.id)
policy = var.aws_iam_policy_document
}

Expand Down Expand Up @@ -358,6 +358,6 @@ resource "aws_s3_bucket" "s3_encryption" {
resource "aws_s3_bucket_policy" "s3_encryption" {
count = var.create_bucket && var.bucket_policy && var.bucket_encryption_enabled == true ? 1 : 0

bucket = aws_s3_bucket.s3_encryption[count.index].id
bucket = join("", aws_s3_bucket.s3_encryption.*.id)
policy = var.aws_iam_policy_document
}

0 comments on commit d706277

Please sign in to comment.