Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Parse AWS CloudFormation's intrinsic functions in the template

Project description

(Tries to) parse AWS CloudFormation’s intrinsic functions in the template.

Quick Start

First, install the library:

pip install aws-parsecf

Then, from a Python interpreter:

import aws_parsecf

with open('/path/to/cloudformation.json', 'r') as f:

Note that some of the intrinsic functions require a configured environment (like "Fn::GetAZs"), so if you don’t have it set:

aws configure


3 simple methods:

aws_parsecf.load_json(stream, region)
aws_parsecf.loads_json(string, region)
aws_parsecf.load_yaml(stream_or_string, region)

region is optional, and defaults to the region you specified when using aws configure. If you didn’t specify a default region in aws configure, or you want to override it, you should specify your region:

aws_parsecf.load_json(stream, region='us-west-1')

If your stack is parameterized, the default values will be used along with possibly supplying parameters:

aws_parsecf.load_json(stream, region, {'DomainName': ""})


Running tests:

./ test

Missing pieces:

  • Support YAML short form.

You know the drill, PR!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aws-parsecf, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size aws-parsecf-1.1.0.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page