1
votes

In my application, I need to create resources from a given Cloudformation template.

There will be many stacks created from the same CloudFormation template. And a schedule job will be triggered on a daily basis to remove the stacks created more than 1 day.

I plan to do this with a Lambda function (best to be in Python) From Setup Lambda function to run a CloudFormation stack I found a way to create stack from Lambda.

But may I know how to list/delete stacks from Lambda function, too?

Thanks. Jeff

1

1 Answers

1
votes

But may I know how to list/delete stacks from Lambda function, too?

In boto3 you can use the following functions:

  • list_stacks: Returns the summary information for stacks whose status matches the specified StackStatusFilte

  • delete_stack: Deletes a specified stack. Once the call completes successfully, stack deletion starts.