Skip to content

Feature Request: Granular API operations for S3 Bucket Lifecycle Rules (Avoid Read-Modify-Write) #3481

Description

@ahay-8am

Describe the feature

Currently, managing S3 Bucket Lifecycle rules requires replacing the entire lifecycle configuration at once using the PutBucketLifecycleConfiguration API operation. Because it acts as a monolithic PUT on the ?lifecycle subresource, it is impossible to add, update, or remove a single rule without affecting the others.

Use Case

To modify a single rule today, developers must write a fragile "Read-Modify-Write" loop:

  1. GetBucketLifecycleConfiguration

  2. Mutate the array of rules in memory

  3. PutBucketLifecycleConfiguration

This introduces two major problems:

  1. Race Conditions: If two automated processes (or developers) attempt to add a lifecycle rule to the same bucket at the same time, one will overwrite the other's changes.

  2. IaC Limitations: Infrastructure-as-Code tools (like Terraform) are forced to manage lifecycle rules as a single, monolithic resource block. This prevents modular infrastructure design where different teams or modules might want to manage their own prefix-specific lifecycle rules on a shared bucket.

Proposed Solution

I would like the S3 service to expose granular API operations for managing individual lifecycle rules, similar to how individual objects or EventBridge rules are managed.

Ideally, this would include:

  • PutBucketLifecycleRule (Upserts a rule by its ID)

  • DeleteBucketLifecycleRule (Deletes a rule by its ID)

Alternatively, supporting PATCH semantics on the existing ?lifecycle endpoint to merge new rules into the existing configuration would solve the issue.

Other Information

I recognize that this is a feature request for the upstream S3 Service API rather than a direct issue with the SDK code itself. I am opening it here in hopes that the SDK team can route this feature request internally to the S3 service team for consideration.

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

release-2026-07-16

Go version used

1.24

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.service-apiThis issue is due to a problem in a service API, not the SDK implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions