-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.
Milestone
Description
Terraform and AWS Provider Version
$ terraform version
Terraform v1.12.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.89.0
And also:
$ terraform version
Terraform v1.12.2
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v6.3.0Affected Resource(s) or Data Source(s)
aws_s3_bucket_lifecycle_configuration
Expected Behavior
Upgrading from v5.89.0 to 6.3.0 should not break existing aws_s3_bucket_lifecycle_configuration resources.
Actual Behavior
Upgrading from v5.89.0 to 6.3.0 does break existing aws_s3_bucket_lifecycle_configuration resources.
Relevant Error/Panic Output
N/A
Sample Terraform Configuration
Click to expand configuration
provider "aws" {
region = "us-east-1"
}
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.89.0"
}
}
}
resource "aws_s3_bucket" "bucket" {
bucket_prefix = "tf-aws-43439-"
tags = {
Name = "tf-aws-43439"
}
}
resource "aws_s3_bucket_lifecycle_configuration" "example" {
# This is pasted almost verbatim from the first example
# in the 5.89.0 docs: https://registry.terraform.io/providers/hashicorp/aws/5.89.0/docs/resources/s3_bucket_lifecycle_configuration#with-neither-a-filter-nor-prefix-specified
# And also the first example in the 6.3.0 docs: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_lifecycle_configuration#with-neither-a-filter-nor-prefix-specified
bucket = aws_s3_bucket.bucket.id
rule {
id = "delete-after-7-days"
status = "Enabled"
expiration {
days = 7
}
}
}
Steps to Reproduce
- Apply the infrastructure as seen above using v5.89.0, which will apply correctly as expected.
- Run a
terraform plan, still using 5.89.0, and see that there are no outstanding diffs, also as expected. - Change the version pin to 6.3.0 and
rm -f .terraform.lock.hcl && terraform initto get it installed. - Run another
terraform planand see that your configuration is now invalid, even though it matches the docs almost verbatim.
$ terraform plan
aws_s3_bucket.bucket: Refreshing state... [id=tf-aws-43439-20250717194649645400000001]
aws_s3_bucket_lifecycle_configuration.example: Refreshing state... [id=tf-aws-43439-20250717194649645400000001]
No changes. Your infrastructure matches the configuration.
Terraform has compared your real infrastructure against your configuration and found no
differences, so no changes are needed.
╷
│ Warning: Invalid Attribute Combination
│
│ with aws_s3_bucket_lifecycle_configuration.example,
│ on main.tf line 22, in resource "aws_s3_bucket_lifecycle_configuration" "example":
│ 22: resource "aws_s3_bucket_lifecycle_configuration" "example" {
│
│ No attribute specified when one (and only one) of [rule[0].filter,rule[0].prefix] is required
│
│ This will be an error in a future version of the provider
Debug Logging
Click to expand log output
N/A
GenAI / LLM Assisted Development
n/a
Important Facts and References
Would you like to implement a fix?
No
barny-hh, keesveerman, tomhnag and remi-f-artelia
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.