CloudFormation

Article by:
Date Published:
Last Modified:

Overview

Command-Line

To delete a stack:

1
$ aws cloudformation delete-stack --stack-name <stack_name> --region <region>

Python API

The first thing you have to do to interact with CloudFormation from boto3 is to create a CloudFormation client:

1
2
import boto3
cf = boto3.client('cloudformation')

describe_stacks() returns an dictionary which contains a Stacks key. This Stacks key contains an array where each element is a dictionary containing information about a particular stack.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
import boto3

cf = boto3.client('cloudformation')
stacks = cf.describe_stacks(StackName='my-stack-name')
print(stacks)
# stdout:
# {
#   'Stacks': [
#     {
#       'StackId': 'foo',
#       ...
#     }
#   ] 
# }

Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:

Tags

comments powered by Disqus