How does the CreateCommandsInvoker work?
#35
-
|
I gather that the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The reason I ask is because I want to add some on-setup actions (populating a database), but I'm not sure how to ensure that it runs for each deployment. |
Beta Was this translation helpful? Give feedback.
-
|
Hi,
That means: If The same thing happens when any commands are updated, it is just a little bit more complicated: Updating the commands means updating the commands layer, which then means that the version number of the commands layer is incremented. Since the ARN of the commands layer is passed as property to If you want to implement a custom setup logic, you have essentially two options:
|
Beta Was this translation helpful? Give feedback.
Hi,
CreateCommandsFunctionis the lambda backend of an AWS Lambda-backed custom resource. In fact,CreateCommandsInvokeris exactly the name of the custom resource which declaresCreateCommandsFunctionas its backend. You can see that by looking at theTypeattribute ofCreateCommandsInvokerintemplate.yaml- it has the formatCustom::XXX.That means: If
CreateCommandsInvokeris created during stack creation, CloudFormation itself makes a request toCreateCommandsFunctionwhich is then responsible for setting up the commands and responding back to CloudFormation that everything went fine. A lot of this request and response logic happens in our dependency cfn-lambda.The same thing happen…