Interview Prep/AWS/Rapid-Fire AWS CLI

How do you apply an S3 lifecycle configuration from a file?

BeginnerProductionRapid-Fire AWS CLI
Answer
aws s3api put-bucket-lifecycle-configuration --bucket logs-prod \
  --lifecycle-configuration file://lifecycle.json
aws s3api get-bucket-lifecycle-configuration --bucket logs-prod

The put call replaces the whole configuration, so include every rule in the file.

aws All AWS questions

More on Rapid-Fire AWS CLI