By using AWS re:Post, you agree to the AWS re:Post Terms of Use

use case of s3 cp command. Does it change storage class

0

Hello,

What is the use cases of this command. Does it change the storage class. I want to change all my s3 objects from intelligent tiering to standard.

aws s3 cp s3://YOUR_BUCKET_NAME/ s3://YOUR_BUCKET_NAME/ --recursive --storage-class STANDARD

Thanks, Ragav

asked 7 months ago439 views
3 Answers
0

Hi

When you execute the command aws s3 cp s3://YOUR_BUCKET_NAME/ s3://YOUR_BUCKET_NAME/ --recursive --storage-class STANDARD, it essentially creates new copies of all objects in your bucket within the same bucket itself.

List Information of the Bucket:

aws s3 ls s3://YOUR_BUCKET_NAME/ --recursive --human-readable ** Use AWS Copy Object:**

aws s3 copy-object \ --source-bucket YOUR_BUCKET_NAME \ --source-key <object_key> \ --destination-bucket YOUR_BUCKET_NAME \ --destination-key <object_key> \ --storage-class STANDARD

Reference: https://medium.com/@nikhil.nagarajappa/copying-aws-s3-objects-of-specific-storage-class-to-another-s3-bucket-874ed8345fea

profile picture
EXPERT
answered 7 months ago
  • then what is the way to revert back to standard

  • Corrected my answer

  • How to use lifecycle policy in this case. Could you please explain in detail?

0

Your command is for changing the storage class of all objects in an S3 bucket from Intelligent Tiering to Standard storage class. to breakdown of the command -

  1. aws s3 cp s3://YOUR_BUCKET_NAME/ s3://YOUR_BUCKET_NAME/ --recursive --storage-class STANDARD This command will copy all objects from the specified S3 bucket to the same bucket, but with the storage class set to STANDARD The “—recursive” flag ensures that the command applies to all objects within the bucket, including those in subdirectories. The “--storage-class STANDARD” option sets the storage class of the copied objects to the Standard storage class.

  2. Changing the storage class of objects does not change the underlying data or the object's location. It only modifies the storage class that determines the pricing and retrieval characteristics of the object.

  3. Transitioning objects from Intelligent Tiering to Standard storage class can be useful if you determine that your data access patterns no longer require the automatic tiering capabilities of Intelligent Tiering, and you want to optimize for lower storage costs.

  4. Please note that there may be data transfer and retrieval charges associated with this operation, depending on your specific AWS usage and pricing model. Review the latest AWS S3 pricing documentation for the most current information on storage class transition costs.

  5. Lastly, you can also use S3 Lifecycle policies to automatically transition objects between storage classes, without the need to manually run the “aws s3 cp” command. This can be a more scalable and automated approach to managing your S3 storage class transitions.

AWS
answered 6 months ago
0

To use an S3 Lifecycle policy to transition objects from Intelligent Tiering to Standard storage class, follow below steps:

  1. Go to the AWS Management Console and navigate to the S3 service
  2. Select the bucket containing the objects you want to transition.
  3. Click on the "Management" tab and then "Add lifecycle rule".
  4. In the Lifecycle rule configuration, you can set the following:
  • Rule name: Give the rule a descriptive name.
  • Lifecycle rule scope: Choose to apply the rule to the entire bucket or a specific prefix.
  • Transition actions: Under "Transition", select the "Intelligent-Tiering" storage class as the source and "Standard" as the destination storage class. You can also specify the number of days after which the transition should occur.
  1. Review and confirm the Lifecycle rule settings, and then save the rule.

Once the Lifecycle rule is in place, Amazon S3 will automatically transition the objects from Intelligent Tiering to Standard storage class based on the configured transition settings.

AWS
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions