SlideShare a Scribd company logo
Indore, India
IaC on AWS
Bhuvaneswari Subramani | 3rd July 2021
https://bhuvana.pro/
/bhuvanas
@installjournal
Agenda
• Infrastructure as Code on AWS
• AWS CloudFormation
• AWS Serverless Application Model (SAM)
• AWS CDK (CDK)
• IaC Solutions in AWS Marketplace
Infrastructure as Code on AWS
Managing Infrastructure as Code
SOURCE
Developers
commit changes
BUILD
Changes
are built
STAGING
Code is deployed and
tested
PRODUCTION
Developers commit
changes
AWS CodeCommit AWS CodeBuild Third Party Tooling AWS CodeDeploy
AWS CodePipeline
AWS CodeDeploy
IaC Tools AWS
CloudFormation
Terraform
AWS
Serverless
Application Model
Ansible
AWS CDK
chef
puppet
c
Apply DevOps Principles to IaC
AWS CloudFormation
AWS CloudFormation
• Create and provision AWS infrastructure deployments
predictably and repeatedly
• Resources are written in text files using JSON or YAML
format. Use Cloud9 or your favorite editor
• Version Control the template
• Helps build the specified services in safe, repeatable
manner
AWS CloudFormation Template
Stack
Parameters
Mappings
Resources
Outputs
Template
Parameter
Values
Create /
Update
sync
Env =>
Test / Prod
One Template
Entire Environment
Repeatable
AWS CloudFormation Template Anatomy
JSON vs YAML
Except
resources all
sections are
optional
AWS CloudFormation
Demo
CI / CD for Infrastructure & WebApp
Source Build Deploy
Pipeline view of Infra Rollout +
Web App Deployment
AWS Serverless Application Model
(SAM)
c
AWS Serverless Application Model
• AWS CloudFormation extension, optimized for serverless
• AWS SAM is supported directly by AWS CloudFormation
• YAML or JSON
• Supported Resources
• Api, Application, Function, HttpApi, LayerVersion, SimpleTable,
StateMachine
c
AWS SAM Template Anatomy
• Transform declaration
Transform: AWS::Serverless-2016-10-31
• Globals section
AWS::Serverless::Function, AWS::Serverless::Api, etc.
• Resources section
Combination of CloudFormation & AWS SAM resources
• Parameters section
Objects declared in Parameters section cause SAM deploy
AWS SAM CLI
• CLI tool for local development, debugging, testing, deploying, and monitoring of
serverless applications
• Supports API Gateway “proxy-style” and Lambda service API testing
• Response object and function logs available on your local machine
• Uses open-source docker-lambda images to mimic Lambda’s execution environment
• Can tail production logs from CloudWatch logs
• Can help you build in native dependencies
AWS SAM CLI Commands
• sam build – install dependencies
• sam deploy – deploy AWS SAM application with AWS CloudFormation
• sam init – initialize a serverless application
• sam local:
• generate-event– generate sample payloads from event sources
• Invoke invokes a Lambda function once
• start-api – set up local endpoint to test your API
• start-lambda – start a local endpoint to test your local lambda
• sam logs – fetch logs for a function
• sam package – package an AWS SAM application
• sam publish – Publish an AWS SAM application to the AWS Serverless Application Repository
• sam validate – Verifies whether an AWS SAM template file is valid
CI / CD for Lambda Deployment using AWS SAM
AWS CDK (CDK)
AWS CDK
• AWS CDK to define your cloud resources in a familiar
programming language
• AWS CDK supports TypeScript, JavaScript, Python, Java,
C#/.Net, and (in developer preview) Go
• Define reusable cloud components known as Constructs
• Compose Constructs together into Stacks and Apps
AWS CDK
AWS CDK Development Workflow
Create App Add Code Build Synthesize Deploy
AWS CDK Development Workflow
Create App Add Code Build Synthesize Deploy
Add code to the app to create
resources within stacks
Build the app
Synthesize stack(s) in app to
create AWS CloudFormation
template Deploy stacks to
your AWS account
AWS CDK Toolkit
The AWS CDK Toolkit is a command line tool for interacting with CDK apps
• cdk lists (ls) – Lists the stacks in the app
• cdk synthesize (synth) – Synthesizes and prints the CloudFormation template for the specified
stack(s)
• cdk bootstrap – Deploys the CDK Toolkit stack
• cdk deploy - Deploys the specified stack(s)
• cdk destroy - Destroys the specified stack(s)
• cdk diff – Compares the stack with deployed or local CloudFormation template
• cdk metadata – Displays metadata about the specified stack
• cdk init – Creates a new CDK project in the current directory from a specified template
• cdk context - Manages cached context values
• cdk docs (doc) – Opens the CDK API reference in your browser
• cdk doctor - Checks your CDK project for potential problems
IaC Solutions in AWS Marketplace
IaC Solutions in AWS Marketplace
Key benefits of using solutions from AWS Marketplace
Key Take Aways AWS
CloudFormation
AWS
Serverless
Application Model
AWS CDK
c
Better together: AWS SAM and AWS CDK
Let’s Orchestrate IaC
Indore, India
https://bhuvana.pro/
/bhuvanas
@installjournal

More Related Content

What's hot

What's hot (20)

Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
AWS Lambda
AWS LambdaAWS Lambda
AWS Lambda
 
Introduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-ITIntroduce AWS Lambda for newbie and Non-IT
Introduce AWS Lambda for newbie and Non-IT
 
Terraform: An Overview & Introduction
Terraform: An Overview & IntroductionTerraform: An Overview & Introduction
Terraform: An Overview & Introduction
 
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | EdurekaAmazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
Amazon AWS | What is Amazon AWS | AWS Tutorial | AWS Training | Edureka
 
AWS Security and SecOps
AWS Security and SecOpsAWS Security and SecOps
AWS Security and SecOps
 
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
Introduction to the Well-Architected Framework and Tool - SVC208 - Anaheim AW...
 
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
AWS Landing Zone Deep Dive (ENT350-R2) - AWS re:Invent 2018
 
Amazon GuardDuty Lab
Amazon GuardDuty LabAmazon GuardDuty Lab
Amazon GuardDuty Lab
 
Amazon API Gateway
Amazon API GatewayAmazon API Gateway
Amazon API Gateway
 
Intro to AWS Lambda
Intro to AWS Lambda Intro to AWS Lambda
Intro to AWS Lambda
 
Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
Aws landing zone
Aws landing zoneAws landing zone
Aws landing zone
 
Deep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWSDeep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWS
 
Protecting Your Data With AWS KMS and AWS CloudHSM
Protecting Your Data With AWS KMS and AWS CloudHSM Protecting Your Data With AWS KMS and AWS CloudHSM
Protecting Your Data With AWS KMS and AWS CloudHSM
 

Similar to IaC on AWS Cloud

Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
Amazon Web Services
 

Similar to IaC on AWS Cloud (20)

Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
Track 4 Session 4_ MAD02 MAD 04 如何藉由 CICD 流程管理容器化和無伺服器應用
 
NEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# ApplicationsNEW LAUNCH! Developing Serverless C# Applications
NEW LAUNCH! Developing Serverless C# Applications
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
Eliminate repetitive work by using AWS Serverless Application Repository
Eliminate repetitive work by using AWS Serverless Application RepositoryEliminate repetitive work by using AWS Serverless Application Repository
Eliminate repetitive work by using AWS Serverless Application Repository
 
Application Lifecycle Management on AWS
Application Lifecycle Management on AWSApplication Lifecycle Management on AWS
Application Lifecycle Management on AWS
 
Introduction to DevOps on AWS
Introduction to DevOps on AWSIntroduction to DevOps on AWS
Introduction to DevOps on AWS
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
DevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software DeliveryDevOps on AWS - Accelerating Software Delivery
DevOps on AWS - Accelerating Software Delivery
 
AWS Devops
AWS DevopsAWS Devops
AWS Devops
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
 
AWS CDK (Cloud Development Kit): A Comprehensive Guide
AWS CDK (Cloud Development Kit): A Comprehensive GuideAWS CDK (Cloud Development Kit): A Comprehensive Guide
AWS CDK (Cloud Development Kit): A Comprehensive Guide
 
re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda re:Invent recap session 1: What's New with AWS Lambda
re:Invent recap session 1: What's New with AWS Lambda
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksDeep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
 
DevOps for Serverless Computing with Demo
DevOps for Serverless Computing with DemoDevOps for Serverless Computing with Demo
DevOps for Serverless Computing with Demo
 
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
 
AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)
 

More from Bhuvaneswari Subramani

More from Bhuvaneswari Subramani (20)

Application Modernization with AWS - A Transformation in Digital Era
Application Modernization with AWS - A Transformation in Digital EraApplication Modernization with AWS - A Transformation in Digital Era
Application Modernization with AWS - A Transformation in Digital Era
 
The Operations effect of Dev, Data, ML and FM
The Operations effect of Dev, Data, ML and FMThe Operations effect of Dev, Data, ML and FM
The Operations effect of Dev, Data, ML and FM
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Architecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for EnterprisesArchitecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for Enterprises
 
How AWS Community in India reflects Unity in Diversity
How AWS Community in India reflects Unity in DiversityHow AWS Community in India reflects Unity in Diversity
How AWS Community in India reflects Unity in Diversity
 
An Insight Into Cloud Migration Story
An Insight Into Cloud Migration StoryAn Insight Into Cloud Migration Story
An Insight Into Cloud Migration Story
 
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWSEnd-to-End CI/CD at scale with Infrastructure-as-Code on AWS
End-to-End CI/CD at scale with Infrastructure-as-Code on AWS
 
COM 203 Enable continuous delivery and resiliency for a static website
COM 203 Enable continuous delivery and resiliency for a static websiteCOM 203 Enable continuous delivery and resiliency for a static website
COM 203 Enable continuous delivery and resiliency for a static website
 
LoadRunner walkthrough
LoadRunner walkthroughLoadRunner walkthrough
LoadRunner walkthrough
 
Jmeter Walkthrough
Jmeter WalkthroughJmeter Walkthrough
Jmeter Walkthrough
 
Fundamentals Performance Testing
Fundamentals Performance TestingFundamentals Performance Testing
Fundamentals Performance Testing
 
Fundamentals of Cloud Computing & AWS
Fundamentals of Cloud Computing & AWSFundamentals of Cloud Computing & AWS
Fundamentals of Cloud Computing & AWS
 
Infrastructure as Code on AWS
Infrastructure as Code on AWSInfrastructure as Code on AWS
Infrastructure as Code on AWS
 
A Pathway to Continuous Integration/Continuous Delivery on AWS
A Pathway to Continuous Integration/Continuous Delivery on AWSA Pathway to Continuous Integration/Continuous Delivery on AWS
A Pathway to Continuous Integration/Continuous Delivery on AWS
 
Transformational DevOps with AWS Native Tools
Transformational DevOps with AWS Native ToolsTransformational DevOps with AWS Native Tools
Transformational DevOps with AWS Native Tools
 
Demystifying DevOps
Demystifying DevOpsDemystifying DevOps
Demystifying DevOps
 
Application & Account Monitoring in AWS
Application & Account Monitoring in AWSApplication & Account Monitoring in AWS
Application & Account Monitoring in AWS
 
Industry Awareness to KSRCT
Industry Awareness to KSRCT Industry Awareness to KSRCT
Industry Awareness to KSRCT
 
CI CD using AWS Developer Tools Online Workshop
CI CD using AWS Developer Tools Online WorkshopCI CD using AWS Developer Tools Online Workshop
CI CD using AWS Developer Tools Online Workshop
 
IndiaCloudSummit - Transforming to feature-driven development
IndiaCloudSummit - Transforming to feature-driven developmentIndiaCloudSummit - Transforming to feature-driven development
IndiaCloudSummit - Transforming to feature-driven development
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

IaC on AWS Cloud

  • 1. Indore, India IaC on AWS Bhuvaneswari Subramani | 3rd July 2021 https://bhuvana.pro/ /bhuvanas @installjournal
  • 2. Agenda • Infrastructure as Code on AWS • AWS CloudFormation • AWS Serverless Application Model (SAM) • AWS CDK (CDK) • IaC Solutions in AWS Marketplace
  • 4. Managing Infrastructure as Code SOURCE Developers commit changes BUILD Changes are built STAGING Code is deployed and tested PRODUCTION Developers commit changes AWS CodeCommit AWS CodeBuild Third Party Tooling AWS CodeDeploy AWS CodePipeline AWS CodeDeploy
  • 8. AWS CloudFormation • Create and provision AWS infrastructure deployments predictably and repeatedly • Resources are written in text files using JSON or YAML format. Use Cloud9 or your favorite editor • Version Control the template • Helps build the specified services in safe, repeatable manner
  • 11. AWS CloudFormation Template Anatomy JSON vs YAML Except resources all sections are optional
  • 13. CI / CD for Infrastructure & WebApp Source Build Deploy
  • 14. Pipeline view of Infra Rollout + Web App Deployment
  • 15. AWS Serverless Application Model (SAM) c
  • 16. AWS Serverless Application Model • AWS CloudFormation extension, optimized for serverless • AWS SAM is supported directly by AWS CloudFormation • YAML or JSON • Supported Resources • Api, Application, Function, HttpApi, LayerVersion, SimpleTable, StateMachine c
  • 17. AWS SAM Template Anatomy • Transform declaration Transform: AWS::Serverless-2016-10-31 • Globals section AWS::Serverless::Function, AWS::Serverless::Api, etc. • Resources section Combination of CloudFormation & AWS SAM resources • Parameters section Objects declared in Parameters section cause SAM deploy
  • 18. AWS SAM CLI • CLI tool for local development, debugging, testing, deploying, and monitoring of serverless applications • Supports API Gateway “proxy-style” and Lambda service API testing • Response object and function logs available on your local machine • Uses open-source docker-lambda images to mimic Lambda’s execution environment • Can tail production logs from CloudWatch logs • Can help you build in native dependencies
  • 19. AWS SAM CLI Commands • sam build – install dependencies • sam deploy – deploy AWS SAM application with AWS CloudFormation • sam init – initialize a serverless application • sam local: • generate-event– generate sample payloads from event sources • Invoke invokes a Lambda function once • start-api – set up local endpoint to test your API • start-lambda – start a local endpoint to test your local lambda • sam logs – fetch logs for a function • sam package – package an AWS SAM application • sam publish – Publish an AWS SAM application to the AWS Serverless Application Repository • sam validate – Verifies whether an AWS SAM template file is valid
  • 20. CI / CD for Lambda Deployment using AWS SAM
  • 22. AWS CDK • AWS CDK to define your cloud resources in a familiar programming language • AWS CDK supports TypeScript, JavaScript, Python, Java, C#/.Net, and (in developer preview) Go • Define reusable cloud components known as Constructs • Compose Constructs together into Stacks and Apps
  • 24. AWS CDK Development Workflow Create App Add Code Build Synthesize Deploy
  • 25. AWS CDK Development Workflow Create App Add Code Build Synthesize Deploy Add code to the app to create resources within stacks Build the app Synthesize stack(s) in app to create AWS CloudFormation template Deploy stacks to your AWS account
  • 26. AWS CDK Toolkit The AWS CDK Toolkit is a command line tool for interacting with CDK apps • cdk lists (ls) – Lists the stacks in the app • cdk synthesize (synth) – Synthesizes and prints the CloudFormation template for the specified stack(s) • cdk bootstrap – Deploys the CDK Toolkit stack • cdk deploy - Deploys the specified stack(s) • cdk destroy - Destroys the specified stack(s) • cdk diff – Compares the stack with deployed or local CloudFormation template • cdk metadata – Displays metadata about the specified stack • cdk init – Creates a new CDK project in the current directory from a specified template • cdk context - Manages cached context values • cdk docs (doc) – Opens the CDK API reference in your browser • cdk doctor - Checks your CDK project for potential problems
  • 27. IaC Solutions in AWS Marketplace
  • 28. IaC Solutions in AWS Marketplace
  • 29. Key benefits of using solutions from AWS Marketplace
  • 30. Key Take Aways AWS CloudFormation AWS Serverless Application Model AWS CDK c Better together: AWS SAM and AWS CDK
  • 31. Let’s Orchestrate IaC Indore, India https://bhuvana.pro/ /bhuvanas @installjournal