Module 5
Module 5
Applications -Introduction
Course Code-CCA2006
2
AWS Cloud Formation
• AWS Cloud Formation is 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.
•You can save these files with any extension, such as .json, .yaml,
.template, or .txt.
4
AWS CloudFormation Features and Components
Template:
A CloudFormation template is a JSON or YAML-formatted text file that
describes the set of AWS resources and their configurations. The template
serves as the blueprint for your infrastructure.
Stack:
A stack is a collection of AWS resources created and managed as a single
unit. When you use CloudFormation to deploy a template, it creates a
stack. Stacks can be easily managed as a single entity, allowing you to
create, update, or delete entire environments.
Resource:
Resources are the individual AWS components defined in the
CloudFormation template. Examples include EC2 instances, S3 buckets,
RDS databases, and more. Each resource is declared with its type and
properties in the template.
5
AWS CloudFormation Features and Components
Stack Set:
For managing stacks across multiple accounts and regions,
CloudFormation provides a feature called Stack Sets. This allows you to
create, update, or delete stacks across multiple AWS accounts and regions
with a single CloudFormation template.
Change Sets:
Before making changes to a stack, CloudFormation allows you to preview
the changes using a feature called Change Sets. This helps you understand
the impact of changes before they are applied, reducing the risk of
unintended modifications.
Parameters:
Parameters are inputs that allow you to customize your CloudFormation
template. They enable you to provide values at runtime, making your
templates more flexible and reusable across different environments.
6
AWS CloudFormation Features and Components
Rollback:
CloudFormation has a rollback feature that automatically reverses changes to a
stack if any part of the update fails. This helps maintain consistency and avoid
leaving the stack in an inconsistent state.
7
AWS Pipeline Formation
8
AWS Pipeline Formation steps
When setting up a pipeline for test and production stacks that involve
S3 buckets, you'll want to automate the creation and management of
these buckets using AWS CloudFormation. Below is a simple
example that outlines the key steps:
1. CloudFormation Templates:
Create separate CloudFormation templates for your test and production
environments. Include the S3 bucket resource definitions within these
templates.
Resources:
TestS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: MyTestBucket
AccessControl: Private
9
AWS Pipeline Formation steps
2. Pipeline Configuration:
Configure your CI/CD pipeline using AWS CodePipeline. This
example assumes you are using CodeCommit for source control and
CodeBuild for the build stage. Modify the pipeline definition to suit
your needs.
10
AWS Pipeline Formation steps
4. Monitoring and Troubleshooting:
Monitor the pipeline execution in the AWS CodePipeline console.
Check CloudWatch Logs and CloudWatch Events for any issues
during the deployment process.
5. Environment Cleanup:
Implement a process to delete resources when they are no longer
needed. This may involve updating CloudFormation templates or
adding a separate pipeline stage for resource deletion.
.
11
AWS CloudFormation Artefacts
In the context of AWS CloudFormation, artifacts refer to the
deployable units or resources created during the CloudFormation
stack deployment.
12