CloudFormation Introduction

CloudFormation Introduction

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have learned how to create a DynamoDB trigger for AWS lambda and with this, we have concluded our introductory series on AWS Lambda.

https://cloudaffaire.com/aws-lambda-dynamodb-trigger/

In this blog post, we are going to start with a new AWS service CloudFormation.

CloudFormation Introduction

AWS CloudFormation is a service that helps you model and set up your Amazon Web Services resources. You create a template that describes all the AWS resources (for example EC2, S3 etc.) that you want, and AWS CloudFormation takes care of provisioning and configuring those resources for you. You don’t need to individually create and configure AWS resources and figure out what’s dependent on what, AWS CloudFormation handles all of that.

When you use AWS CloudFormation, you work with templates and stacks. You create templates in JSON or YAML that describe your AWS resources and their properties. Whenever you create a stack, AWS CloudFormation provisions the resources that are described in your template and the resources get deleted if you delete the stack.

CloudFormation Components:

Templates:

An AWS CloudFormation template is a JSON or YAML formatted text file. You can save these files with any extension, such as .json, .yaml, .template, or .txt. AWS CloudFormation uses these templates as blueprints for building your AWS resources. Templates include several major sections. The Resources section is the only required section. Some sections in a template can be in any order. However, as you build your template, it can be helpful to use the logical order shown in the following list because values in one section might refer to values from a previous section.

  • Format Version (optional): The AWS CloudFormation template version that the template conforms to.
  • Description (optional): A text string that describes the template. This section must always follow the template format version section.
  • Metadata (optional): Objects that provide additional information about the template.
  • Parameters (optional): Values to pass to your template at runtime (when you create or update a stack).
  • Mappings (optional): A mapping of keys and associated values that you can use to specify conditional parameter values, similar to a lookup table.
  • Conditions (optional): Controls whether certain resources are created or whether certain resource properties are assigned a value during stack creation or update.
  • Transform (optional): For serverless applications, specifies the version of the AWS Serverless Application Model (AWS SAM) to use.
  • Resources (required): Specifies the stack resources and their properties, such as an Amazon EC2 instance or an Amazon S3 bucket.
  • Outputs (optional): Describes the values that are returned whenever you view your stack’s properties.

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.

Change Sets:

If you need to make changes to the running resources in a stack, you update the stack. Before making changes to your resources, you can generate a change set, which is a summary of your proposed changes. Change sets allow you to see how your changes might impact your running resources, especially for critical resources, before implementing them.

Designer:

AWS CloudFormation Designer (Designer) is a graphic tool for creating, viewing, and modifying AWS CloudFormation templates. With Designer, you can diagram your template resources using a drag-and-drop interface, and then edit their details using the integrated JSON and YAML editor. Whether you are a new or an experienced AWS CloudFormation user, AWS CloudFormation Designer can help you quickly see the interrelationship between a template’s resources and easily modify templates.

Stack sets:

A stack set lets you create stacks in AWS accounts across regions by using a single AWS CloudFormation template. All the resources included in each stack are defined by the stack set’s AWS CloudFormation template.

CloudFormer:

CloudFormer is a template creation beta tool that creates an AWS CloudFormation template from existing AWS resources in your account. You select any supported AWS resources that are running in your account, and CloudFormer creates a template in an Amazon S3 bucket.

Hope you have enjoyed this blog, we will cover each and every of these components with a hands-on demo in upcoming blog posts..

To get more details on CloudFormation, please refer below AWS documentation

https://docs.aws.amazon.com/cloudformation/index.html

 

Leave a Reply

Close Menu