Skip to content

Instantly share code, notes, and snippets.

@amitsaxena
Last active June 20, 2016 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitsaxena/ee24fac39e14da8f7eb1155f4fd017ef to your computer and use it in GitHub Desktop.
Save amitsaxena/ee24fac39e14da8f7eb1155f4fd017ef to your computer and use it in GitHub Desktop.
How to return a 404 response code for CloudFront requests (S3 origin) of a non-existent S3 object: http://aawaara.com/post/146226425447/how-to-return-a-404-response-code-for-cloudfront
{
"Version": "2008-10-17",
"Id": "PolicyForCloudFrontPrivateContent",
"Statement": [
{
"Sid": "1",
"Effect": "Allow",
"Principal": {
"AWS": "Enter your CloudFront Origin Access Identity here"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my_bucket_name/*"
},
{
"Sid": "2",
"Effect": "Allow",
"Principal": {
"AWS": "Enter your CloudFront Origin Access Identity here"
},
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::my_bucket_name/*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment