2
votes

Looking for some advice on the best approach to launch a Lambda immediately after a cloudformation template stack gets run.

The use case is: I run my cloudformation template that setups up An API Gateway with Authorizers, and lambda functions. I then need to get reach out to another SAS/Cloud Service and run some configurations on their side to get everything dialed in.

I was looking into if there is a way to create a Lambda Function with an CloudWatch equivalent of Now, so it will launch immediately and do any finishing work that might need to be done.

I don't imagine I am the only person who might need to do this type of configuration. I could use multiple Cloudformation Scripts, but I'm trying to simply this for others who might not have much AWS experience, and Automate as much as possible. The more I can do in Amazon, the less scripting someone else might have to do.

If anyone has any ideas, or I missed something basic stuff, please let me know.

1

1 Answers

2
votes

You can take a look at AWS CloudFormation Custom Resources. From the docs:

Custom resources provide a way for you to write custom provisioning logic in AWS CloudFormation template and have AWS CloudFormation run it during a stack operation, such as when you create, update or delete a stack.

With this custom resource you can call a Lambda function by handing over its ARN to the custom resource. See also this doc article for more background information.

Note: I haven't tried it by myself, but it seems to be the right thing for you.