Closed garretwilson closed 9 months ago
To try to force CloudFormation to update, I deleted the entire FunctionAssociations
section altogether and did an aws cloudformation deploy …
. As expected, the status of both functions changed to Published
.
But then I added the FunctionAssociations
section back, referencing both functions, both with AutoPublish
set to true
. After the deploy, I get:
FooFunction
: Deployed
BarFunction
: Published
(sigh)
Like #989, CloudFormation seems to be full of little hidden "sticky" settings. I never know when a deploy is going to "take" and really update, or just half-baked update.
I don't believe it.
FunctionAssociations
section of the distribution.aws cloudformation deploy …
and then verified in the console that both functions no longer exist./*
) distribution from the console.FunctionAssociations
.aws cloudformation deploy
.I get back two functions:
FooFunction
: Deployed
BarFunction
: Published
This is tiring and frustrating. Somehow it remembered these two functions, even though they were supposedly completely deleted, and only associated one of them with the distribution, when the configurations for both are identical in the template.
I am giving up for today.
I have now raised this issue on Stack Overflow.
I succeeded in getting BarFunction
deployed, but only by removing FooFunction
:
FooFunction
altogether from the template and from the FunctionAssociations
section of the distribution, leaving only BarFunction
.aws cloudformation deploy …
and then verified in the console that FooFunction
was not listed. This time BarFunction
showed a status of Deployed
!BarFunction
back to the template and added it back to the FunctionAssociations
section of the distribution.aws cloudformation deploy
.Yet again I get back two functions:
FooFunction
: Deployed
BarFunction
: Published
(no longer deployed)There is something broken about CloudFormation that will not allow two functions to be deployed at the same time, even though they are both listed in the FunctionAssociations
section.
Someone responded about this on Stack Overflow, saying that some other page mentioned that each event type can only have one function associated with it in a distribution.
However this is not mentioned anywhere in the docs for AWS::CloudFront::Distribution DefaultCacheBehavior
. Moreover, if a CloudFormation is invalid (i.e. if CloudFormation will refuse to implement the template as written), shouldn't CloudFormation produce an error instead of silently doing something different than what the CloudFormation template specifies?
This is not the right place. Please verify if there is an issue here and if not please open one: https://github.com/aws-cloudformation/cloudformation-coverage-roadmap
Also, when reporting the issue it helps if you can provide a bit more details to help replicate the issue (e.g. a minimal template that helps reproduce the issue can immensely help)
I have a CloudFront distribution with a single function:
I deploy the stack using
aws cloudformation deploy …
and see that in the console theFooFunction
has a status ofDeployed
.I define another function in the CloudFormation template and call
aws cloudformation deploy …
again.Note that both functions have
AutoPublish: true
set.In the console both functions now appear under "Functions". The status of
FooFunction
still showsDeployed
. However the status ofBarFunction
isPublished
. And if I click onBarFunction
, under "Associated distributions" it says:Yet it is clearly listed under
FunctionAssociations
.