https://github.com/andreax79/cowformation
Mustache templates for AWS CloudFormation, in pure bash
https://github.com/andreax79/cowformation
Last synced: about 2 months ago
JSON representation
Mustache templates for AWS CloudFormation, in pure bash
- Host: GitHub
- URL: https://github.com/andreax79/cowformation
- Owner: andreax79
- License: mit
- Created: 2019-07-12T08:32:57.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-08T12:54:32.000Z (almost 7 years ago)
- Last Synced: 2025-02-26T16:50:40.181Z (over 1 year ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CowFormation
Mustache templates for AWS CloudFormation, in pure bash.
Example
-------
ApplicativeLogS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: {{ APPLICATIVE_LOGS }}
BucketEncryption: {{ BUCKET_ENCRYPTION }}
PublicAccessBlockConfiguration: {{ PUBLIC_ACCESS_BLOCK_CONFIGURATION }}
LifecycleConfiguration:
Rules:
- Id: DeleteOldFiles
ExpirationInDays: {{ LOGS_EXPIRATION_IN_DAYS }}
Status: Enabled
Tags: {{ S3_TAGS }}
Requirements
------------
* Bash 3.x
* AWS Command Line Interface
Usage
-----
1) Edit `vars/0_commons.sh`
The following variables are require:
export STACK_NAME="test" # CloudFormation stack name
export FORMAT="yaml" # CloudFormation template format (yaml or json)
export AWS_REGION="eu-west-1" # AWS Region
export AWS_PROFILE="stage" # AWS Profile
2) Add other .sh files exporting eviron variables in `vars` folder. You must make sure your data is in the environment when the template is rendered. The files are imported in lexicographical order.
3) Edit/add templates parts (json/yaml) in `parts` folder. The files are concatenated in lexicographical order.
4) Run `./cow.sh` for creating/updating the CloudFormation stack.
./cow.sh
Links
-----
* Mustache Templates in Bash - https://github.com/tests-always-included/mo
* Mustache, Logic-less templates- https://mustache.github.io/
* ShellCheck a static analysis tool for shell scripts - https://github.com/koalaman/shellcheck
* AWS Command Line Interface- https://aws.amazon.com/cli/