Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8455687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:20:52+00:00 2026-06-10T12:20:52+00:00

I know how to expire objects in an S3 bucket using object expiration rules

  • 0

I know how to expire objects in an S3 bucket using object expiration rules given a certain prefix, however for my purposes, I would like to set the expiry date programmatically on a per object basis.

The Java SDK seems to indicate that this is possible as it has a setExpirationTime method, however whenever I set an expiration Date using this method, nothing seems to happen and the object never expires. Additionally, looking at the object properties through the aws console, no expiry appears to be set.

Is per file expiration not supported ? / Are there any extra steps I need to do to get it to work ? / If per file expiration is not supported, is it possible to exclude a file that matches an expiration prefix from being expired ?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:20:54+00:00Added an answer on June 10, 2026 at 12:20 pm

    It doesn’t look like per-object expiration is supported, but rather a per-bucket lifecycle configuration with up to 100 rules per configuration, as you have found.

    A bucket has one lifecycle configuration. A lifecycle configuration
    can have up to 100 rules.

    The lifetime value must be a nonzero positive integer. Amazon S3
    calculates expiration time by adding the expiration period specified
    in the rule to the object creation time and rounding the resulting
    time to the next day midnight UTC.

    If per file expiration is not supported, is it possible to exclude a
    file that matches an expiration prefix from being expired ?

    It doesn’t look like you can overlap rules, either.

    Take care to ensure the rules don’t overlap. For example, the
    following lifecycle configuration has a rule that sets objects with
    the prefix “documents” to expire after 30 days. The configuration also
    has another rule that sets objects with the prefix “documents/2011” to
    expire after 365 days. In this case, Amazon S3 returns an error
    message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know if there is a better solution for this. The
I know that forcing passwords to expire after a certain period from the time
I know how to create a cookie that will expire after a certain amount
I would like to know if there is any possible means of getting a
I would like to know how to create a signed URL for cloudfront. The
I would like to know what causes this signed URL method to work locally
In my application, I would know when the session has expired by doing Ajax
Know if it's possible to access the iPhone compass in Safari using JavaScript? I
I feel like I should know this but I've been stumped for hours now
I am using child object of org.apache.commons.pool.impl.GenericObjectPool for providing connections to web services (child

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.