Aws cloudformation templates is provide to way deploy the apps in aws cloud. Using this we can create template for apps or services, and can be easily deploy whenever require we can easily provision .
As part of amazon aws exploration, i found that my clients environment are based on cloud formulation script. I tried to explore the environment, and found its quite same as our workflows (not exactly same).
In a standard way, when we want to create a template, we need to create all the require resources. We should have all the resources information which is required for application. The deployment is automated by an AWS Cloudformation template. The template starts the installation process by creating all the required AWS resources such as the Amazon VPC, security groups, public and private subnets, Internet gateways, NAT gateways, and the Amazon S3 bucket.
In this section we will discuss some of the base commands, which can be executed on the jumpbox:
aws cloudformation list-stacks
It will list all the available stacks.
aws cloudformation describe-stacks –stack-name <name>
Lot of other commands are also available: http://docs.aws.amazon.com/cli/latest/reference/cloudformation/index.html
In my search, I got Docker datacenter cloudformation template, Its good stuff to get understanding. PS: you should have knowledge of docker.
https://s3.amazonaws.com/quickstart-reference/docker/latest/doc/docker-datacenter-on-the-aws-cloud.pdf
How to create Cloudformation Template
CloudFormation is described as a JSON (JavaScript Object Notation) template. It’s a model-driven template in that the AWS infrastructure is instantiated according to its own specification of proper order of execution.
aws cloudformation get-template –stack-name <name>
This command will give the complete details of template, with resources, output, subnet etc.
When we use cloudformation, we work with template and stack. Template describes the resources and properties, and when we create stack, we provision the resources using template.
Templates: An AWS CloudFormation template is a text file whose format complies with the JSON standard. You can save these files with any extension, such as .json
, .template
, or .txt
. AWS CloudFormation uses these templates as blueprints for building your AWS resources. For example, in a template, you can describe an Amazon EC2 instance, such as the instance type, the AMI ID, block device mappings, and its Amazon EC2 key pair name. Whenever you create a stack, you also specify a template that AWS CloudFormation uses to create whatever you described in the template.
Stacks:When you use AWS CloudFormation, you manage related resources as a single unit called a stack. You create, update, and delete a collection of resources by creating, updating, and deleting stacks. All the resources in a stack are defined by the stack’s AWS CloudFormation template. Suppose you created a template that includes an Auto Scaling group, Elastic Load Balancing load balancer, and an Amazon Relational Database Service (Amazon RDS) database instance. To create those resources, you create a stack by submitting the template that you created, and AWS CloudFormation provisions all those resources for you.