1.7.0 • Published 7 years ago

cloudfriend v1.7.0

Weekly downloads
67
License
ISC
Repository
github
Last release
7 years ago

cloudfriend

Build Status

Helper functions for assembling CloudFormation templates in JavaScript

Intrinsic functions and conditions

These are functions that you can use in place of various CloudFormation objects.

CloudFriendCloudFormation
base64(value)Fn::Base64
findInMap(mapping, key, attr)Fn::FindInMap
getAtt(obj, key)Fn::GetAtt
getAzs(region)Fn::GetAZs
join(delimiter, pieces)Fn::Join
select(index, list)Fn::Select
ref(name)Ref
userData(lines)Fn::Base64 and Fn::Join with \n delimiter
and(conditions)Fn::And
equals(a, b)Fn::Equals
if(condition, ifTrue, ifFalse)Fn::If
not(condition)Fn::Not
or(conditions)Fn::Or
notEquals(a, b)Fn::Not and Fn::Equals
sub(str, variables)Fn::Sub
importValue(sharedValue)Fn::ImportValue

Pseudo parameters

These are static properties of cloudfriend that you can use to reference various CloudFormation objects.

CloudFriendCloudFormation
accountIdAWS::AccountId
notificationArnsAWS::NotificationARNs
noValueAWS::NoValue
regionAWS::Region
stackIdAWS::StackId
stackNameAWS::StackName

Other helpers

methoddescription
build(file, opts)Builds a template defined by a static JavaScript export, a synchronous or an asynchronous function.
validate(file)Uses the cloudformation:ValidateTemplate API call to perform rudimentary template validation
merge(...template)Merges templates together. Throws errors if logical names are reused

CLI tools

By installing cloudfriend globally, it can provide you with simple CLI tools for building and validating CloudFormation templates.

# either...
$ git clone https://github.com/mapbox/cloudfriend && cd cloudfriend && npm link
# ... or ...
$ npm install -g cloudfriend

Then, to build a template:

# Prints the template as JSON to stdout
$ build-template path/to/template.js

Or, to validate a template:

# Make sure that your shell is configured to make AWS requests
$ validate-template path/to/template.js
1.7.0

7 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago