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

chore(deps): bump cloudposse/s3-bucket/aws from 4.0.0 to 4.0.1 in /terraform/modules/gost_api #2230

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 16, 2023

Bumps cloudposse/s3-bucket/aws from 4.0.0 to 4.0.1.

Release notes

Sourced from cloudposse/s3-bucket/aws's releases.

v4.0.1

🐛 Bug Fixes

what

  • When trying to create an S3 bucket, the following error is encountered:
Error: Invalid dynamic for_each value

on .terraform/main.tf line 225, in resource "aws_s3_bucket_replication_configuration" "default": 225: for_each = try(compact(concat( 226: [try(rule.value.destination.encryption_configuration.replica_kms_key_id, "")], 227: [try(rule.value.destination.replica_kms_key_id, "")] 228: ))[0], []) ├──────────────── │ rule.value.destination.encryption_configuration is null │ rule.value.destination.replica_kms_key_id is "arn:aws:kms:my-region:my-account-id:my-key-alias"

Cannot use a string value in for_each. An iterable collection is required.

  • This is caused in my case by having s3_replication_rules.destination.encryption_configuration.replica_kms_key_id set.

why

  • There is a bug when trying to create an S3 bucket, which causes an error that stops the bucket being created

    • Basically, there are two attributes that do the same thing (for backwards compatability)
      • s3_replication_rules.destination.encryption_configuration.replica_kms_key_id (newer)
      • s3_replication_rules.destination.replica_kms_key_id (older)
    • There is logic to:
      • A) use the newer of these two attributes
      • B) fall back to the older of the attributes if it is set and the newer is not
      • C) fall back to an empty array if nothing is set
    • There is a bug in steps A/B, where by selecting one or the other, we end up with the string value, and not an iterable
    • The simplest solution, which I have tested successfully on existing buckets, is to wrap the output of that logic in a list
  • This error is easily replicable by trying compact(concat([try("string", "")], [try("string", "")]))[0] in the Terraform console, which is a simplified version of the existing logic used above

  • The table below demonstrates the possible values of the existing code - you can see the outputs for value 2, value 3, and value 4 are not lists:

Key Value 1 Value 2 Value 3 Value 4
newer null "string1" null "string1"
older null null "string2" "string2"
output [] "string1" "string2" "string1"

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [cloudposse/s3-bucket/aws](https://github.com/cloudposse/terraform-aws-s3-bucket) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/cloudposse/terraform-aws-s3-bucket/releases)
- [Commits](cloudposse/terraform-aws-s3-bucket@v4...4.0.1)

---
updated-dependencies:
- dependency-name: cloudposse/s3-bucket/aws
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested a review from a team as a code owner November 16, 2023 21:27
@dependabot dependabot bot added dependencies Pull requests that update a dependency file terraform Pull requests that update Terraform code labels Nov 16, 2023
Copy link

codeclimate bot commented Nov 16, 2023

Code Climate has analyzed commit 6293f24 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 55.9%.

View more on Code Climate.

@github-actions github-actions bot merged commit 990ef62 into _staging Nov 16, 2023
6 of 7 checks passed
@github-actions github-actions bot deleted the dependabot/terraform/terraform/modules/gost_api/cloudposse/s3-bucket/aws-4.0.1 branch November 16, 2023 21:30
adele-usdr pushed a commit that referenced this pull request Nov 28, 2023
Bumps [cloudposse/s3-bucket/aws](https://github.com/cloudposse/terraform-aws-s3-bucket) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/cloudposse/terraform-aws-s3-bucket/releases)
- [Commits](cloudposse/terraform-aws-s3-bucket@v4...4.0.1)

---
updated-dependencies:
- dependency-name: cloudposse/s3-bucket/aws
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file terraform Pull requests that update Terraform code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants