0% found this document useful (0 votes)
6 views

AWS infrastructure as code (IAC)

The document provides an overview of AWS Infrastructure as Code (IaC) and AWS CloudFormation, highlighting the benefits of automation in resource provisioning. It explains key concepts such as templates, stacks, and changesets, along with the anatomy of a CloudFormation template. Additionally, it includes a lab exercise for creating an EC2 instance with associated resources.

Uploaded by

tapas202420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

AWS infrastructure as code (IAC)

The document provides an overview of AWS Infrastructure as Code (IaC) and AWS CloudFormation, highlighting the benefits of automation in resource provisioning. It explains key concepts such as templates, stacks, and changesets, along with the anatomy of a CloudFormation template. Additionally, it includes a lab exercise for creating an EC2 instance with associated resources.

Uploaded by

tapas202420
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

AWS Infrastructure as Code

(IaC)
• Infrastructure as Code - An Overview
• AWS CloudFormation - An Overview
Agenda
• AWS CloudFormation - Concepts
• AWS CloudFormation - Workflow
• AWS CloudFormation - Changesets
• AWS CloudFormation - Template Anatomy
• Template Anatomy - Components
• Lab Exercise - AWS CloudForma
Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights
Reserved.
Infrastructure as Code (IaC)
• Brings automation to the provisioning process, which was traditionally
done manually.
• Rather than relying on manually performed steps, both administrators
and developers can instantiate infrastructure using configuration files.
• IaC helps avoid configuration drift through automation, and
increases the speed and agility of infrastructure deployments.
• Helps to reduce errors and enhances the ability to apply
changes through different stages consistently.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
AWS CloudFormation – An Overview
• A service that helps you model and set up your AWS resources so that
you can spend less time managing those resources and more time
focusing on your applications that run in AWS.
• You create a template that describes all the AWS resources that you
want (like Amazon EC2 instances or Amazon RDS DB instances), and
CloudFormation takes care of provisioning and configuring those
resources for you.
• Available at no additional charge, and you pay only for the AWS
resources needed to run your applications.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
AWS CloudFormation

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
AWS CloudFormation – Concepts
Template:
• A template is a JSON or YAML formatted text file.
• Acts as a blueprint for building your AWS resources.
Stacks:
• To manage related resources as a single unit called a stack.
• Used to create, update, and delete a collection of resources.
• You create a stack by submitting the template that you created,
CloudFormation provisions all those resources for you.
• Change sets:
• Allows you to see how your changes might impact your running
resources before implementing them.
Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights
Reserved.
Amazon CloudFormation – WorkFlow

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Amazon CloudFormation – Changesets
• Used to make changes to the running resources in a stack.
• A summary of proposed changes to be done to the running resources.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Amazon CloudFormation – Template Anatomy
A template is a JSON- or YAML-formatted text file that describes your AWS
infrastructure.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Template Section - Components
• Format Version (optional): A template version that the template conforms
to. The template format version can change independently of the API and
WSDL versions.
• Description (optional): A text string that describes the template.
• Metadata (optional): Objects that provide additional information about the
template.
• Parameters (optional): Values to pass to your template at runtime. You can
refer to parameters from the Resources and Outputs sections of the
template.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Template Section – Components Contd..
• Conditions (optional): Conditions that control whether certain resources
are created or whether certain resource properties are assigned a value
during stack creation or update.
• Transform (optional): For serverless applications (also referred to as
Lambda-based applications), specifies the version of the AWS Serverless
Application Model (AWS SAM) to use. When you specify a transform, you
can use AWS SAM syntax to declare resources in your template.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Template Section – Components Contd..
• Resources (required): Specifies the stack resources and their properties,
such as an Amazon EC2 or an Amazon S3 bucket. You can refer to resources
in the Resources and Outputs sections of the template.
• Mappings (optional): A mapping of keys and associated values that you can
use to specify conditional parameter values. You can match a key to a
corresponding value by using Fn::FindInMap intrinsic function in the
Resources and Outputs sections.
• Outputs (optional): The Outputs section declares output values that you
can import into other stacks.

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.
Lab Exercise – AWS CloudFormation
Example : Create a simple EC2 instance with a security group and key pair
associated with it.
https://raw.githubusercontent.com/awslabs/aws-cloudformation-
templates/master
/aws/services/EC2/EC2InstanceWithSecurityGroupSample.yaml
Run the below command to get publicly available AMI’s in that region.
aws ssm get-parameters-by-path --path /aws/service/ami-amazon-linux-latest
--query Parameters[].Name

Copyright Dot Net Tricks Innovation Pvt. Ltd. | All rights


Reserved.

You might also like