All Questions

Filter by
Sorted by
Tagged with
17 votes
8 answers
37k views

Unable to add cloudfront as trigger to lambda function

Hi I've followed this instruction try to resize image with Cloudfront and lambda@edge. When I tried to test the resized image, I keep getting the error message below: The Lambda function associated ...
Dayo Choul's user avatar
16 votes
6 answers
16k views

How to provision a CloudFront distribution with an ACM Certificate using Cloud Formation

I am attempting to set a certificate in my CloudFrontDistribution using Cloud Formation. My certificate has been issued via Certificate Manager. It has been approved, and I have validated that the ...
Toby Hede's user avatar
  • 36.9k
13 votes
3 answers
10k views

Cloudfront give Access denied response created through AWS CDK Python for S3 bucket origin without public Access

Created Cloud Front web distribution with AWS CDK for S3 bucket without public access. Able to create Origin access identity, and deploy but on successful deploy i get access denied response on ...
santosh's user avatar
  • 4,049
13 votes
2 answers
9k views

Invalidate Cloudfront cache with AWS CDK Pipelines

As part of my CodePipeline in CDK I would like, as the last step, to invalidate the Cloudfront cache. This is my current Deploy action step: { stageName: 'Deploy', actions: [ new ...
Andreas's user avatar
  • 3,332
10 votes
2 answers
3k views

AWS Cloudformation defining security policy of Cloudfront

I'm struggling to find a security policy tab in cloudformation documentation for cloudfront. Is there any way I can set the security policy to TLS1.1_2016? Because the default value is TLSv1. Thanks!
kkesley's user avatar
  • 3,336
9 votes
1 answer
9k views

How to get the latest lambda version in cloudformation yml?

I'm trying to reference an edge lambda for cloudfront distribution in cloudformation. What I have now is: LambdaFunctionARN: Fn::GetAtt: [BasicAuthLambdaFunction,Arn] But I ...
Daniel Birowsky Popeski's user avatar
8 votes
3 answers
6k views

Cloudformation S3 bucket principal for Cloudfront

I'm trying to create a Yaml template for cloudfront distribution on S3 bucket. I'm stuck on how to add principal on BucketPolicy. I want to know how to replace the XXXXXXXXXXX on CloudFront Origin ...
Rabin Mallilck's user avatar
8 votes
4 answers
11k views

How to solve AWS CloudFront SSL Certificate Doesn't Exist

When I was adding the IamCertificateId property to my AWS::CloudFront::Distribution in CloudFormation, I got the following error: Resource handler returned message: "Invalid request provided: ...
Yann Stoneman's user avatar
7 votes
2 answers
4k views

CloudFormation creation of CloudFront distribution with logging bucket

Trying to provision a static website bucket that's distributed by CloudFront. The following CloudFormation template works if I omit the Logging configuration for the distribution: { ... "...
Assaf Lavie's user avatar
  • 74.4k
7 votes
2 answers
1k views

Create CloudFront distribution that accepts only signed URL’s with serverless

I want to create a web cloudFront distribution that can be accessed only using signed URL's. On creating the distribution manually, there is an option Restrict Viewer Access under the Default Cache ...
Abhishek Pandey's user avatar
7 votes
1 answer
5k views

CloudFront can't use S3 Website origin, only REST origin Cloudformation

I'm trying to automate spinning up a CloudFront distribution with S3 origin. I'd like to set the origin to the S3 website URL, e.g. mysite.com.s3-website-us-east-1.amazonaws.com. So, I thought my ...
Dan Stark's user avatar
  • 806
7 votes
1 answer
3k views

How to integrate CloudFront distribution to AWS WAF by using CloudFormation?

I am trying to add CloudFront distribution to AWS WAF by using CloudFormation and have tried this, "Type": "AWS::WAFRegional::WebACLAssociation", "Properties": { "...
vamsi chunduru's user avatar
7 votes
1 answer
1k views

Cryptic CloudFormation failure when creating CloudFront Distribution

I have a CloudFormation template set up to track a CloudFront distribution among other things. Getting this set up, I created an AWS::CertificateManager::Certificate and an AWS::CloudFront::...
JSON Brody's user avatar
7 votes
1 answer
2k views

How can one return binary content via AWS Lambda through API Gateway and CloudFront using AWS_PROXY mode?

How can I provision an AWS API Gateway, fronted by CloudFront (so that I can have HTTP to HTTPS redirects) and backed by an AWS Lambda function using the AWS_PROXY integration type using ...
gene_wood's user avatar
  • 2,024
7 votes
0 answers
871 views

CloudFormation incorrectly reporting drift in CloudFront tags

I have a CloudFormation stack that provisions a CloudFront distribution. Whenever a resource is provisioned under a CloudFormation stack, CloudFormation attempts to tag that resource with any tags on ...
JSON Brody's user avatar
6 votes
2 answers
2k views

How to configure CloudFront using CloudFormation to set the 'Headers' property in 'ForwardedValues' to 'all'?

I am setting up CloudFront using CloudFormation, but I need to configure the Headers property of the ForwardedValues property. It should be setup in such a way that all headers are forwarded. I can't ...
Titulum's user avatar
  • 10.8k
6 votes
1 answer
5k views

Cache Based on Selected Request Headers - CloudFront Behavior for Cloudformation?

I am writing Cloudformation to deploy an ELB origin CloudFront distribution. I have it completed aside from one option that I can't find in the AWS documentation. I am redirecting all traffic to https ...
roosterrocket's user avatar
6 votes
2 answers
4k views

aws cloudformation CachePolicy generic error

i'm trying to create a cachePolicy that forward all ( cookies, querystrings and headers ) and acctualy doesn't cache annything at all: Type: AWS::CloudFront::CachePolicy Properties: ...
victor israe's user avatar
6 votes
1 answer
2k views

Prevent CloudFormation to remove Lambda Edge associations from CloudFront

I'm using CloudFormation to manage a CloudFront distribution. On this CloudFront distribution I've associated a Lambda Edge function (without using CloudFormation). The problem is later, when I ...
Yves M.'s user avatar
  • 30.5k
5 votes
4 answers
12k views

"The parameter CNAME contains one or more parameters that are not valid" error message while deploying a CloudFront distribution

I'm getting this error message when trying to deploy a CloudFront distribution: The parameter CNAME contains one or more parameters that are not valid. (Service: AmazonCloudFront; Status Code: 400; ...
Dillon's user avatar
  • 51
5 votes
1 answer
2k views

AWS::CloudFront::OriginRequestPolicy resource in CloudFormation

I am trying to CloudFormation for my Lambda@Edge resource, which I would like to utilize CloudFront's new origin request policy. However, when I tried to deploy the following resource with aws ...
Yibo Long's user avatar
  • 1,287
5 votes
2 answers
8k views

Is there an example cloudformation template with multiple CacheBehaviors defined?

How do I use this in a template I found no examples: * https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-distributionconfig.html#cfn-cloudfront-...
red888's user avatar
  • 29.7k
4 votes
1 answer
4k views

How to provide Alternate Domain Names (CNAMEs) to the CloudFront distribution using CloudFormation?

I have tried: "Aliases": ["www.samplewebsite.com","samplewebsite.com"] But I am getting this error: Property validation failure: [Encountered unsupported properties in {/...
vamsi chunduru's user avatar
4 votes
2 answers
3k views

CloudFront ForwardedValues ambiguous documentation

I'm configuring my CloudFront using CloudFormation, and on the AWS documentation page for the ForwardedValues property, we can see the following statement: If you specify true for QueryString and ...
Titulum's user avatar
  • 10.8k
4 votes
1 answer
2k views

How to get the CloudFront distribution's domain name

The goal is to create a custom domain for my Serverless api: api.example.com. So my approach is to create this Route53 record: ApiDomainRecord: Type: AWS::Route53::RecordSet Properties: Type: ...
Daniel Birowsky Popeski's user avatar
4 votes
1 answer
2k views

How can you update a CloudFront distribution Lambda@Edge reference based on a CodePipeline build?

My situation is: I have a CloudFront distribution managed by CloudFormation that, amongst other things, needs to pass certain requests to an Edge Lambda. I have a CodePipeline that builds new ...
DougW's user avatar
  • 29.5k
4 votes
2 answers
702 views

AWS - Cloudfront distribution + API Gateway - 403 Forbidden

I'm trying to serve a API Gateway from a Cloudfront distribution but I'm still getting a 403 response even though deployment has no error. Calling endpoint via its invoke url from web console works ...
fudo's user avatar
  • 2,516
4 votes
0 answers
319 views

AWS lambda serverless image handler sign-url not working getting NoSuchKey

Trying to resize image on the fly by using AWS lambda serverless image Handler, CloudFront . Acutally I want to get this feature by using CloudFormation. I have already a s3 bucket and i want that ...
Rahul Modanwal's user avatar
3 votes
2 answers
2k views

Lambda@Edge limitation to be deployed to us-east-1 prevents me from deploying S3 bucket to Europe

Update: The short version of the issue that I wanted to cross-reference some values in different stacks in different regions but the documentations were so confusing to let me think it's not possible ...
Marzouk's user avatar
  • 2,660
3 votes
2 answers
1k views

How to add domain alias to existing CloudFront distribution using AWS CDK

I just deployed a CloudFormation solutions from the AWS Solutions. The solutions included a new CloudFront distribution. My challenge is that I want to add a custom domain mysite.example.com to the ...
Petra Barus's user avatar
  • 3,915
3 votes
1 answer
833 views

How to set FunctionCode property for a CloudFront Function in a template file?

I'm trying to use cloud formation (YAML template file) to deploy a CloudFront Function in my stack. How do I specify the FunctionCode (AWS docs) property for my CloudFront Function? ...
borgerodsjo's user avatar
3 votes
1 answer
742 views

How to attach Real-time log to a Distribution in CloudFormation

I have created a real time logging configuration. However, I cannot find how to attach it to the for a CloudFront distribution. The CloudFront template to create the real time logging is: ...
alonana's user avatar
  • 321
3 votes
3 answers
2k views

Cloudfront with S3 origin returns AccessDenied when using OAI restricted bucket policy

I am trying to deploy a static website to S3, and serve it up via Cloudfront. I am using serverless to generate the Cloudformation resources. Once the resources are created, my build process (in ...
johnny_mac's user avatar
  • 1,881
3 votes
2 answers
2k views

How to reference CloudFront domain name when creating a AWS::S3::RecordSet in CloudFormation/Serverless?

I have a project which has a cloudfront distribution to serve some data out of a bucket. I am using Serverless framework, but I think this is mainly a CloudFormation question. I would like to create ...
jr.'s user avatar
  • 4,607
3 votes
1 answer
1k views

Cloudformation template - S3 bucket website with cloudfront distribution - distribution can't access origin

I'm just trying to get a static site on a S3 bucket and have it being accessible only trough a CloudFront distribution, but something is missing and I cannot figure out what. Currently my stack have ...
fudo's user avatar
  • 2,516
3 votes
1 answer
3k views

Configuring CloudFront distribution with S3 Origin and Custom Origin (ELB) using AWS CDK

I have an app that uses Django and Vue.js. Currently the API is served on api.mydomain.com that sends traffic to an Application Load Balancer which routes to Fargate services and the Vue.js static ...
briancaffey's user avatar
  • 2,489
3 votes
2 answers
627 views

CloudFront distribution can't access S3 bucket for website static assets

This question follow a previous one, i decided to close that since the code changed a bit and the question did not reflect my actual situation any more. The problem I'm trying to deploy an S3 bucket ...
fudo's user avatar
  • 2,516
3 votes
3 answers
2k views

How can I restrict access to an S3 website to Cloudfront?

I want to put a Cloudfront CDN in front of a S3 website bucket for a static website, and restrict read access of the bucket to the Cloudfront distribution. Pretty common, and documented by AWS and ...
lxg's user avatar
  • 12.8k
2 votes
2 answers
1k views

AWS deploy Cloudfront with api gateway

Recently I was trying to deploy a lambda function and a Cloudfront distribution together with a CloudFormation yaml template with SAM. However, I'm stuck with the DomainName in the CloudFormation ...
Xenox's user avatar
  • 45
2 votes
1 answer
2k views

How to add new origins to an already existing cloudfront distribution through cloudformation?

I am trying to add an origin to my already existing Cloudfront distribution(created outside of Cloudformation). Looking at the AWS::CloudFront::DistributionOrigin block in the AWS docs, I could not ...
Harsh Saudagar's user avatar
2 votes
1 answer
570 views

Adding Lambda@edge includebody field in cloudfront using cloudformation template?

I am trying to add Lambda@Edge association in cloudfront using cloudformation. As per aws docs they had only two fields like EventType and LambdaFunctionARN . But i want to add IncludeBody in ...
Private's user avatar
  • 1,721
2 votes
1 answer
558 views

AWS Cloudformation error creating CachePolicy component

I would like to create the cache policy for cloudfront but the CachePolicy component fails me without specifying the cause. I can't understand, do you have any idea why this happens? Cloudformation ...
Fabrizio Cafolla's user avatar
2 votes
1 answer
1k views

Attach multiple buckets to CloudFront via CloudFormation

I have created a yaml document to create an S3 bucket and attach it to a distribution. Resources: S3BucketContent: DeletionPolicy: 'Delete' Metadata: Comment: 'Bucket to store ...
s_om's user avatar
  • 681
2 votes
1 answer
561 views

CloudFormation Circular Dependency Between Route53, Certificate Manager & CloudFront

The following code is my attempt at creating a SPA (Single Page Application) CloudFormation template. I understand there are probably many flaws but I can't conceptually understand how to break the ...
Robert's user avatar
  • 181
2 votes
3 answers
2k views

How do I define a CloudFront Origin Group in CloudFormation?

I want to define a CloudFront Origin Group inside my CloudFormation yaml file. How do I do this? Or is it not yet supported by CloudFormation? I always have trouble finding a definitive answer if ...
rynop's user avatar
  • 52k
2 votes
2 answers
2k views

Invalidate Cloudfront's cached data by passing in custom header

I need some resources or general direction. I am looking into using Cloudfront to help combat latency on calls to my service. I want to be able to serve cached data, but need to allow the client to ...
JAck28's user avatar
  • 887
2 votes
1 answer
772 views

Does CloudFront distribution need a replica in multi-region?

I am working on a multi-region solution for my current architecture. We use CloudFormation for defining the infrastructure. A piece of that architecture is a Cloudfront distribution which takes the ...
elena's user avatar
  • 3,950
2 votes
1 answer
380 views

Property validation failure in Cloudformation

The following snippet is from a Cloudformation formation template: ... LambdaFunctionAssociations: - !If - ProtectDistribution - - EventType: viewer-request LambdaFunctionARN: ...
Sammy's user avatar
  • 3,555
2 votes
1 answer
344 views

How to delete a CloudFront Distribution once the S3 Bucket used by the Origins has been deleted?

The CloudFront Distribution and S3 Bucket were created by CloudFormation. The Distribution had Origins that made use of the S3 Bucket. The S3 Bucket was deleted manually. The CloudFormation stack was ...
Edward Moffett's user avatar
2 votes
1 answer
475 views

Determining exactly which IAM permission is missing when a CF stack update fails

When a CloudFormation stacks fails to deploy due to missing permissions, you'll get more or less useful error messages. In my case, my CI pipeline deploys a CloudFormation template for a web ...
JHH's user avatar
  • 8,977