Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use for_each instead of count in aws_s3_bucket_logging #212

Merged
merged 2 commits into from
Mar 3, 2024

Conversation

wadhah101
Copy link
Contributor

@wadhah101 wadhah101 commented Feb 5, 2024

what

Replaced the count with a for_each inside aws_s3_bucket_logging.default

there's no point in the try since the type is clearly defined as list

why

When the bucket_name within logging attribute is dynamically defined, like in the case of referencing a bucket created by terraform for logging

  logging = [
    {
      bucket_name = module.logging_bucket.bucket_id
      prefix      = "data/"
    }
  ]

we get this error
Screenshot 2024-02-05 at 12 50 30

For each can work better in this case and will solve the previous error

references

@wadhah101 wadhah101 requested review from a team as code owners February 5, 2024 12:00
@wadhah101 wadhah101 requested review from Gowiem and nitrocode February 5, 2024 12:00
@Gowiem
Copy link
Member

Gowiem commented Feb 5, 2024

/terratest

@Gowiem Gowiem added enhancement New feature or request patch A minor, backward compatible change labels Feb 5, 2024
main.tf Show resolved Hide resolved
@hans-d
Copy link

hans-d commented Mar 2, 2024

/terratest

Copy link

@hans-d hans-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please regenerate the reame, as per the instructions in the related check.

@wadhah101
Copy link
Contributor Author

@hans-d done

@hans-d
Copy link

hans-d commented Mar 3, 2024

/terratest

@hans-d hans-d self-requested a review March 3, 2024 20:05
@hans-d hans-d merged commit b497874 into cloudposse:main Mar 3, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants