Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Switch to aws_s3_bucket_lifecycle_configuration #463

Merged
merged 4 commits into from
Nov 6, 2023

Conversation

adrianclay
Copy link
Collaborator

@adrianclay adrianclay commented Nov 6, 2023

We were seeing Terraform attempting to remove the following on every run:

      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

This PR uses aws_s3_bucket_lifecycle_configuration, and updates Terraform, and AWS Terraform to a version where this is no longer an issue.

We are seeing Terraform attempting to remove the following on every run:
      - server_side_encryption_configuration {
          - rule {
              - bucket_key_enabled = false -> null

              - apply_server_side_encryption_by_default {
                  - sse_algorithm = "AES256" -> null
                }
            }
        }

Upgrading the AWS Provider to v4 should fix this.
Before we can upgrade to v4 we need to switch to using
  aws_s3_bucket_lifecycle_configuration
Previous declaration was deprecated:
```
Terraform 0.13 and earlier allowed provider version constraints inside the
provider configuration block, but that is now deprecated and will be removed
in a future version of Terraform. To silence this warning, move the provider
version constraint into the required_providers block.
```
@adrianclay adrianclay force-pushed the upgrade-terraform-version-gp2gp branch 2 times, most recently from 7e0cc0a to c246384 Compare November 6, 2023 12:21
The list function has been deprecated since 0.12 [1], so replace with
tolist.

[1]: https://developer.hashicorp.com/terraform/language/functions/list
@adrianclay adrianclay force-pushed the upgrade-terraform-version-gp2gp branch 4 times, most recently from a53355d to 8346e49 Compare November 6, 2023 13:13
Fixes issue where Terraform complains about S3 lifecycle rules
needing updating when no terraform has changed.
@adrianclay adrianclay force-pushed the upgrade-terraform-version-gp2gp branch from 8346e49 to 7e57f59 Compare November 6, 2023 13:16
Copy link
Collaborator

@ole4ryb ole4ryb left a comment

Choose a reason for hiding this comment

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

Looks good

@adrianclay adrianclay merged commit d372c03 into develop Nov 6, 2023
@adrianclay adrianclay deleted the upgrade-terraform-version-gp2gp branch November 6, 2023 17:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants