AWS CloudFormation Course
AWS CloudFormation Course
StackSimplify
Course Objectives
• AWS CloudFormation
• Continuous Integration
• AWS Code Commit
• AWS Code Build
• Continuous Delivery
• AWS CodeDeploy
• AWS CodePipeline
• Infrastructure as Code with CI/CD Tools.
Parameters 4 Examples
Mappings 2 Examples
Conditions 6 Examples
AWS CloudFormation
Outputs 7 Examples
CodeBuild IAM
Security Group
Role
CodeDeploy
Elastic IP
Application
CodeDeploy
VPC
DeploymentGro
Resources CodeDeploy
Subnet
Deploymnet
CodeDeploy IAM
AWS CloudFormation Route Table
Role
SubnetRoute CodePipeline
TableAssociation IAM Role
CodePipeline
InternetGateway
Pipeline
VPCGatewayAtta
SNS Topic
chment
packages aws-cfn-bootstrap
groups cfn-init
users cfn-signal
Update Stack –
commands cfn-hup
Deploy v2 App
App1AndApp2
App1 App2
Sample: App1
AWS CodePipeline
Kalyan Reddy Daida StackSimplify
AWS Developer Tools or Code Services
Source Build Test Deploy Monitor
AWS CodePipeline
Kalyan Reddy Daida StackSimplify
AWS Developer Tools or AWS Code Services
Source Build Test Deploy Monitor
Boot.
• Check-in code to Local Repo and push to Local Git
CodeCommit. Repo
push
AWS Cloud
AWS CodeCommit
Developer Developer
Local Git
Local Git Repo
Repo push
AWS Cloud
push
CodeBuild Stack
AWS Cloud
CodeBuild
CodeCommit CodeCommit Service Role
User
Developer Developer accessing
User Rest service
accessing
Rest service
Internet push
push
AWS Cloud
CodeBuild Simple Storage CodeDeploy EC2 Instance CodeBuild Simple Storage CodeDeploy Production EC2
Service (S3) Service (S3) Instance
CodePipeline
Developer CloudWatch
Master Branch Prepare or Validate Create & Execute Create & Execute
Template Change set Change set
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
• Resources Documentation:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-
template-resource-type-ref.html
Kalyan Reddy Daida StackSimplify
Resources
• Step 01: Create resource - EC2 Instance
• Step 02: Add Second Resource - New
security group and Intrinsic Function Ref
• Step 03: Update Resource Properties -
Add new rule to Security group
• Step 04: Add third Resource - Elastic IP
• Step 05: Perform case sensitive test with
resource properties
• MinLength
• MinValue
• NoEcho
packages aws-cfn-bootstrap
groups cfn-init
users cfn-signal
Update Stack –
commands cfn-hup
Deploy v2 App
App1AndApp2
App1 App2
Sample: App1
VPC Nested
Stack
Continuous Integration
&
Continuous Delivery
AWS CodePipeline
Kalyan Reddy Daida StackSimplify
AWS Developer Tools or Code Services
Source Build Test Deploy Monitor
AWS CodePipeline
Kalyan Reddy Daida StackSimplify
AWS Developer Tools or AWS Code Services
Source Build Test Deploy Monitor
Boot.
• Check-in code to Local Repo and push to Local Git
CodeCommit. Repo
push
AWS Cloud
AWS CodeCommit
Developer Developer
Local Git
Local Git Repo
Repo push
AWS Cloud
push
CodeBuild Stack
AWS Cloud
CodeBuild
CodeCommit CodeCommit Service Role
User
Developer Developer accessing
User Rest service
accessing
Rest service
Internet push
push
AWS Cloud
CodeBuild Simple Storage CodeDeploy EC2 Instance CodeBuild Simple Storage CodeDeploy Production EC2
Service (S3) Service (S3) Instance
CodePipeline
Developer CloudWatch
Role and Instance Profile for EC2 EC2 Apps CloudFormation Stack
Instances to access S3 Buckets.
• Step 4: Create stack and verify.
AWS CodeCommit
Amazon Simple Notification AWS Key Management AWS Elastic Beanstalk Amazon CloudWatch
AWS CloudTrail
Service Service
Kalyan Reddy Daida StackSimplify
CodeCommit - Steps
• Step#1: Sample Spring Boot Rest Application Developer
• Pre-requisites
• Install STS IDE
• Create Spring boot rest application. Local
• Test it. Git
• Step#2: GIT Repository Repo
• Create a local git repository and check-in code.
• Create a remote git repository in AWS Code Commit. push
• Create Code Commit git credentials to connect.
• Push the code to remote git repository.
• Verify code in AWS Code Commit.
AWS Cloud
• Step#3: CodeCommit Features
• Code, Commits, Branches
• Settings: Notifications, Triggers
• Pull Requests
AWS CodeCommit
Developer Developer
Local Git
Local Git Repo
Repo push
AWS Cloud
push
CodeBuild Stack
AWS Cloud
CodeBuild
CodeCommit CodeCommit Service Role
Managed Image
Local Git
• Step#1: Create CodeBuild Project Repo
• Create a S3 bucket and folder
push
• Create CodeBuild project
• Start build, Verify build logs, Verify build
phase details
• Step#2: buildspec.yml & Start Build
• Create buildspec.yml and check-in code AWS Cloud
Amazon ECS
GitHub On-Premise
Elastic Load
Balancing (ELB)
Master Branch Prepare or Validate Create & Execute Create & Execute
Template Change set Change set
Benefits
• Track Infrastructure changes using version control system like AWS CodeCommit.
• Releaseinfrastructure changes using the same tools ascode changes (AWSCodeCommit, CodeBuild and CodePipeline).
• Replicateproduction environment in any environment as desired for continuous testing.
• Make infrastructure changes repeatable.
• Minimize infrastructure buildout time.
• Seamless provisioning and de-provisioning of infrastructure resources in minutes or even reduced to seconds.
Kalyan Reddy Daida StackSimplify
Infrastructure as Code – Manual AWS Web Console
AWS Cloud
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval
Source Stage
Prod VPC Stack
Build Stage Action-1: Create
Change set
Local Git push Prod
Action-2:
Repo Approval