- Newest
- Most votes
- Most comments
Hello,
You can recreate the S3 Bucket with the same name, ensure the bucket has the correct permissions that allow CloudFront to write logs to it and then you can disable the distribution.
Did you try using the AWS CLI?
1.Fetch the current configuration of CloudFront distribution
aws cloudfront get-distribution-config --id DISTRIBUTION_ID > dist-config.json
2.Edit the dist-config.json file to remove or update the logging configuration. The relevant section would look something like this:
"Logging": {
"Enabled": false,
"IncludeCookies": false,
"Bucket": "",
"Prefix": ""
}
3.Update the distribution with the modified configuration. You need the IfMatch value from the previous step (the ETag of the distribution config):
aws cloudfront update-distribution --id DISTRIBUTION_ID --distribution-config file://dist-config.json --if-match E_TAG
References:
Thank you very much @Sivaraman Selvam. I accept the answer above. I just want to add a few things. After fetching the distribution configuration into a "dist-config.json" file, I edited the "dist-config.json" file to use only a subset of the contents of the file - refer to this: https://docs.aws.amazon.com/cli/latest/reference/cloudfront/update-distribution.html I then recreated the two S3 buckets in the "dist-config.json" file and from the command line after turning logging off as shown in the answer by @Sivaraman Selvam, I disabled the distribution in the "dist-config.json" file:
Enabled: false
Relevant content
- asked 2 years ago