hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.73k stars 9.09k forks source link

[Bug]: aws_s3_bucket_lifecycle_configuration always require noncurrent_days and not allow null value #34197

Open apichaya-s opened 10 months ago

apichaya-s commented 10 months ago

Terraform Core Version

1.2.9

AWS Provider Version

5.23.1

Affected Resource(s)

aws_s3_bucket_lifecycle_configuration

Expected Behavior

It should be able to apply without any error when not declare noncurrent_days

Actual Behavior

Error: creating S3 Lifecycle Configuration for bucket: InvalidArgument: 'NoncurrentDays' for NoncurrentVersionExpiration action must be a positive integer

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_s3_bucket_lifecycle_configuration" "test" {
  bucket                = "test"

  rule {
    id     = "keep 1 version"
    status = "Enabled"

    noncurrent_version_expiration {
        newer_noncurrent_versions = 1
        noncurrent_days           = null
      }
  }
}

Steps to Reproduce

run script above

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 10 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 10 months ago

Related #24973 Possibly related #25572

michaelbertoni-ep commented 2 months ago

Problem is still here as of 07-03-24