skip to navigation
skip to content

aws-parsecf 1.0.0

Parse AWS CloudFormation's intrinsic functions in the template

(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:
    print(aws_parsecf.load_json(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

Usage

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')

Contributing

Running tests:

pip install -r requirements.txt
nosetests -c nose.cfg aws_parsecf

Missing pieces:

  • Support YAML short form.

You know the drill, PR!

 
File Type Py Version Uploaded on Size
aws-parsecf-1.0.0.tar.gz (md5) Source 2017-06-19 6KB