All Projects → aws-cloudformation → Cloudformation Cli

aws-cloudformation / Cloudformation Cli

Licence: apache-2.0
The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Cloudformation Cli

Perun
A command-line validation tool for AWS Cloud Formation that allows to conquer the cloud faster!
Stars: ✭ 82 (-44.97%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Aws Cloudformation Coverage Roadmap
The AWS CloudFormation Public Coverage Roadmap
Stars: ✭ 800 (+436.91%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Awesome Cloudformation
A curated list of resources and projects for working with AWS CloudFormation.
Stars: ✭ 290 (+94.63%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cform Vscode
CloudFormation extension for Visual Studio Code
Stars: ✭ 73 (-51.01%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cloudformation
Some CF templates
Stars: ✭ 123 (-17.45%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Docs
Rapid CloudFormation: Modular, production ready, open source.
Stars: ✭ 209 (+40.27%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Goformation
GoFormation is a Go library for working with CloudFormation templates.
Stars: ✭ 671 (+350.34%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Aws Cf Templates
A cloudonaut.io project. Engineered by widdix.
Stars: ✭ 2,399 (+1510.07%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Aws Unifi Controller
Example of a Ubiquiti Unifi Controller in AWS using Network Load Balancer for TLS termination
Stars: ✭ 37 (-75.17%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Aws Auto Terminate Idle Emr
AWS Auto Terminate Idle AWS EMR Clusters Framework is an AWS based solution using AWS CloudWatch and AWS Lambda using a Python script that is using Boto3 to terminate AWS EMR clusters that have been idle for a specified period of time.
Stars: ✭ 21 (-85.91%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Aws Cloudformation User Guide
The open source version of the AWS CloudFormation User Guide
Stars: ✭ 493 (+230.87%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cfn Create Or Update
Create or update CloudFormation stack also if no updates are to be performed.
Stars: ✭ 59 (-60.4%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cfn Generic Custom Resource
CloudFormation generic custom resource provider
Stars: ✭ 26 (-82.55%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Quickstart Taskcat Ci
AWS Quick Start Team
Stars: ✭ 57 (-61.74%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cfn Python Lint
CloudFormation Linter
Stars: ✭ 1,770 (+1087.92%)
Mutual labels:  aws, cloudformation, aws-cloudformation
Cfn Sphere
AWS CloudFormation stack management tool
Stars: ✭ 76 (-48.99%)
Mutual labels:  aws, cloudformation
Cloudformation Templates
Common tasks automated by CloudFormation
Stars: ✭ 79 (-46.98%)
Mutual labels:  aws, cloudformation
Sceptre
Build better AWS infrastructure
Stars: ✭ 1,160 (+678.52%)
Mutual labels:  aws, cloudformation
Aws Service Catalog Products
This repository contains a number of CloudFormation templates which can be used independently or as Products with AWS Service Catalog including the Open Source Tools AWS Service Catalog Factory and AWS Service Catalog Puppet. The templates include a number of the foundational AWS Services you may choose to manage Account Compliance including AWS Config, AWS CloudTrail and GuardDuty
Stars: ✭ 84 (-43.62%)
Mutual labels:  aws, cloudformation
Aws Multi Account Viewer
Serverless app designed for any customer with two or more accounts to view resources across accounts/regions in simple single pane of glass website
Stars: ✭ 87 (-41.61%)
Mutual labels:  aws, cloudformation

CloudFormation CLI

AWS CloudFormation CLI

The CloudFormation CLI (cfn) allows you to author your own resource providers and modules that can be used by CloudFormation.

Usage

Documentation

Primary documentation for the CloudFormation CLI can be found at the AWS Documentation site.

Installation

This tool can be installed using pip from the Python Package Index (PyPI). It requires Python 3. For resource types, the tool requires at least one language plugin. Language plugins are not needed to create a module type. The language plugins are also available on PyPI and as such can be installed all at once:

pip install cloudformation-cli cloudformation-cli-java-plugin cloudformation-cli-go-plugin cloudformation-cli-python-plugin

You will need npm to run contract tests (cfn test) if your resource schema requires property transform. Please ensure you have npm installed. Follow the instructions: https://www.npmjs.com/get-npm to get npm installed on your machine.

Command: init

To create a project in the current directory, use the init command. A wizard will guide you through the creation.

cfn init

Command: generate

To refresh auto-generated code, use the generate command. Usually, plugins try to integrate this command in the native build flow, so please consult a plugin's README to see if this is necessary. In a module project, this will regenerate the module schema.

cfn generate

Command: submit

To register a resource provider or module in your account, use the submit command.

cfn submit
cfn submit --dry-run #prepares schema handler package without submitting for registration
cfn submit --set-default # if successfully registered, set submitted version to be the new default version

Command: test

To run the contract tests for a resource type, use the test command.

cfn test
cfn test -- -k contract_delete_update #to run a single test
cfn test --tb=long #exhaustive, informative traceback formatting
cfn test --enforce-timeout 60 #set the RL handler timeout to 60 seconds and CUD handler timeout to 120 seconds.
cfn test --enforce-timeout 60 -- -k contract_delete_update # combine args

Command: validate

To validate the schema, use the validate command.

This command is automatically run whenever one attempts to submit a resource or module. Errors will prevent you from submitting your resource/module. Module fragments will additionally be validated via cfn-lint (but resulting warnings will not cause this step to fail).

cfn validate

Command: build-image

To build an image for a resource type. This image provides a minimalistic execution environment for the resource handler that does not depend on AWS Lambda in anyway. This image can be used during cfn invoke and cfn test instead of using sam cli.

cfn build-image
cfn build-image --image-name my-handler --executable target/myjar.jar

The resulting image can be run in a container by executing the following command:

docker run IMAGE_NAME HANDLER_ENTRYPOINT PAYLOAD
docker run my-test-resource com.my.test.resource.ExecutableHandlerWrapper PAYLOAD_JSON # Example for a java based-project

Development

For developing, it's strongly suggested to install the development dependencies inside a virtual environment. (This isn't required if you just want to use this tool.)

python3 -m venv env
source env/bin/activate
pip install -e . -r requirements.txt
pre-commit install

If you're creating a resource type, you will also need to install a language plugin, such as the Java language plugin, also via pip install. For example, assuming the plugin is checked out in the same parent directory as this repository:

pip install -e ../cloudformation-cli-java-plugin

Linting and running unit tests is done via pre-commit, and so is performed automatically on commit. The continuous integration also runs these checks. Manual options are available so you don't have to commit):

# run all hooks on all files, mirrors what the CI runs
pre-commit run --all-files
# run unit tests only. can also be used for other hooks, e.g. black, flake8, pylint-local
pre-commit run pytest-local

If you want to generate an HTML coverage report afterwards, run coverage html. The report is output to htmlcov/index.html.

Plugin system

New language plugins can be independently developed. As long as they declare the appropriate entry point and are installed in the same environment, they can even be completely separate codebases. For example, a plugin for Groovy might have the following entry point:

entry_points={
    "rpdk.v1.languages": ["groovy = rpdk.groovy:GroovyLanguagePlugin"],
},

Plugins must provide the same interface as LanguagePlugin (in plugin_base.py). And they may inherit from LanguagePlugin for the helper methods - but this is not necessary. As long as the class has the same methods, it will work as a plugin.

Supported plugins

Language Status Github PyPI
Java Available cloudformation-cli-java-plugin cloudformation-cli-java-plugin
Go Available cloudformation-cli-go-plugin cloudformation-cli-go-plugin
Python Available cloudformation-cli-python-plugin cloudformation-cli-python-plugin

License

This library is licensed under the Apache 2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].