Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

AWS Provider: aws_s3_bucket_lifecycle_configuration change in expiration breaks configuration #3842

@mimozell

Description

@mimozell

Expected Behavior

aws_s3_bucket_lifecycle_configuration.expiration should continue being an object (instead of array) same as in the AWS provider version 5.90.0 or before (currently an issue in 5.90.1 and 5.90.2)

Actual Behavior

Logged the issue with the provider as well here: hashicorp/terraform-provider-aws#41896

aws_s3_bucket_lifecycle_configuration.expiration has changed from being an object into being an array. In the terraform configuration this change is not apparent, but it breaks cdktf configurations in versions after 5.90.0. Previously a rule would be configured the following way:

      {
        id: "expire_object",
        status: "Enabled",
        expiration: {
          days: 7
        },
      },

while now we need to use:

      {
        id: "expire_object",
        status: "Enabled",
        expiration: [{
          days: 7
        }],
      },

for no apparent reason. Configurations break with the following error:
Type '{ id: string; status: string; expiration: { days: number; }; }' is not assignable to type 'S3BucketLifecycleConfigurationRule'. Types of property 'expiration' are incompatible. Object literal may only specify known properties, and 'days' does not exist in type 'IResolvable | S3BucketLifecycleConfigurationRuleExpiration[]'.

I suspect expiration has changed from an object to a dynamic in terraform, that's why in the native HCL documentation - that has only examples of single expiration {} blocks - this change is not apparent, but becomes very visible when selecting the TypeScript docs.

Steps to Reproduce

  1. Create a bucket
  2. Set S3BucketLifecycleConfigurationRule with an lifecycle rule to expire objects

Versions

@cdktf/provider-aws: 19.57.0
cdktf-cli: 0.20.11
terraform: v1.10.2

Providers

No response

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnewUn-triaged issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions