
To change the object's encryption settings using the Amazon S3 console, see How do I add encryption to an S3 object? Note: If you receive errors when running AWS CLI commands, make sure that you’re using the most recent version of the AWS CLI. If the command returns ServerSideEncryption as aws:kms, then the object is KMS-encrypted.
Run the head-object command using the AWS Command Line Interface (AWS CLI). If AWS-KMS is selected, then the object is KMS-encrypted. Use the Amazon S3 console to view the properties of the object. Use one of the following ways to check if an object in your bucket is KMS-encrypted: Note: Instead of using AWS KMS encryption, use AES-256 to encrypt your objects. You must remove KMS encryption from the S3 objects that you want to serve using the distribution. For instructions, see Using a REST API endpoint as the origin with access restricted by an OAI in How do I use CloudFront to serve a static website hosted on Amazon S3? Resolution Objects in the bucket must be publicly accessibleĬloudFront distributions don't support AWS KMS-encrypted objects. Then, configure your distribution and S3 bucket to restrict access using an origin access identity (OAI).
Note: If you don't want to allow public (anonymous) access to your S3 objects, then change your configuration to use the S3 REST API endpoint as the origin of your distribution.
If you're using a Referer header to restrict access from CloudFront to your S3 origin, then review the custom header. If Requester Pays is enabled, then the request must include the request-payer parameter. Amazon S3 Block Public Access must be disabled on the bucket. The requested objects must exist in the bucket.
If the bucket policy grants public read access, then the AWS account that owns the bucket must also own the object. The bucket policy must allow access to s3:GetObject. Objects in the bucket can't be encrypted by AWS Key Management Service (AWS KMS). Objects in the bucket must be publicly accessible. If your distribution is using a website endpoint, verify the following requirements to avoid Access Denied errors: Why am I getting 403 Access Denied errors? If your distribution is using a REST API endpoint, see I'm using an S3 REST API endpoint as the origin of my CloudFront distribution. Note: Depending on the AWS Region, the endpoint format might use the dash format ( s3-website-Region) or the dot format ( s3-website.Region).