SlideShare a Scribd company logo
1 of 21
Download to read offline
CloudFormation
Experience
Kseniya Perapechyna
ITS Partner
Menu
● appetizer: Amazon Services
● main course: CloudFormation basis
● desert: Serverless Application Model (SAM)
Imagine Flow
What is my main course?
CloudFormation Concept
Template Structure
AWSTemplateFormatVersion: "version date"
Description:
String
Metadata:
template metadata
Parameters:
set of parameters
Mappings:
set of mappings
Conditions:
set of conditions
Transform:
set of transforms
Resources:
set of resources
Outputs:
set of outputs
AWSTemplateFormatVersion: "2010-09-09"
Description: "CloudFormation template Example"
Metadata:
Databases: "Information about databases"
Instances: "Information about EC2 instances"
Parameters:
KinesisShardCount:
Type: Number
Default: 3
MinValue: 1
MaxValue: 10
Environment:
Type: String
Default: qa
AllowedValues:
- "prod"
- "qa"
- "dev"
Template Structure
AWSTemplateFormatVersion: "version date"
Description:
String
Metadata:
template metadata
Parameters:
set of parameters
Mappings:
set of mappings
Conditions:
set of conditions
Transform:
set of transforms
Resources:
set of resources
Outputs:
set of outputs
Mappings:
TemplateMapping:
prod:
lambdaName: "ProdLambda"
apiGatewayStageName: "prod01"
qa:
lambdaName: "QaLambda"
apiGatewayStageName: "qa02"
dev:
lambdaName: "DevLambda"
apiGatewayStageName: "dev"
FunctionName:
Fn::FindInMap: ["TemplateMapping", !Ref Environment, "lambdaName"]
Template Structure
AWSTemplateFormatVersion: "version date"
Description:
String
Metadata:
template metadata
Parameters:
set of parameters
Mappings:
set of mappings
Conditions:
set of conditions
Transform:
set of transforms
Resources:
set of resources
Outputs:
set of outputs
Conditions:
ProdEnvironment: !Equals [!Ref Environment, "prod"]
Resources:
KinesisStream:
Type: "AWS::Kinesis::Stream"
Condition: ProdEnvironment
DeletionPolicy: Delete
Properties:
...
Outputs:
kinesisId:
Value: !Ref KinesisStream
Export:
Name: !Sub "${Environment}-kinesis-id"
CloudFormation SNS Resource
Type: AWS::SNS::Topic
Properties:
DisplayName: String
KmsMasterKeyId: String
TopicName: String
Subscription:
- Subscription
EmailNotification:
Type: "AWS::SNS::Topic"
Properties:
TopicName: "interesting-information"
Subscription:
- "some.address@email.com"
- "one.more.address@email.com"
WorkerLambdaResource:
Type: "AWS::Lambda::Function"
Properties:
FunctionName: !FindInMap ["TemplateMapping", !Ref Environment, "lambdaName"]
Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/lambda-role"
MemorySize: 512
Runtime: java8
Code:
S3Bucket: "lambda-functions"
S3Key: "worker.jar"
Handler: "com.example.ExampleHandler"
VpcConfig:
SecurityGroupIds: [sg-085912345678492fb]
SubnetIds:
- subnet-071f712345678e7c8
- subnet-07fd123456788a036
Environment:
Variables:
param: value
lambda_environment: !Ref Environment
Dessert please
Serverless Application Model
Transform: "AWS::Serverless-2016-10-31"
Serverless Resource types
● AWS::Serverless::Function
● AWS::Serverless::Api
● AWS::Serverless::Application
● AWS::Serverless::SimpleTable
● AWS::Serverless::LayerVersion
SAM Features
Globals Section
Globals:
Function:
Runtime: nodejs6.10
Timeout: 180
Handler: index.handler
Environment:
Variables:
TABLE_NAME: data-table
Api:
EndpointConfiguration: REGIONAL
Cors: "'www.example.com'"
SimpleTable:
SSESpecification:
SSEEnabled: true
API Gateway CloudFormation Resources
● API Gateway account
● REST API
● ...
● Resources hierarchy
● Methods
● Stages
● Deployments
● API key
● Custom domain name
● CORS (OPTIONS methods)
API Gateway Serverless Resources
Globals:
Api:
EndpointConfiguration: REGIONAL
Cors:
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
AllowMethods: "'POST,GET,OPTIONS'"
AllowOrigin: "'www.example.com'"
MethodSettings:
- HttpMethod: GET
ResourcePath: "/api/v1"
LoggingLevel: INFO
MetricsEnabled: false
CachingEnabled: false
ThrottlingRateLimit: 10000
ThrottlingBurstLimit: 5000
Resources:
ExampleRestApi:
Type: "AWS::Serverless::Api"
Properties:
Name: "REST API Example"
StageName: !Ref Environment
DefinitionUri:
Bucket: api-bucket
Key: swagger.yml
WorkerLambdaResorce:
Type: "AWS::Serverless::Function"
Properties:
FunctionName: worker-service
Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/lambda-role"
Runtime: java8
MemorySize: 512
AutoPublishAlias: !Ref Environment
CodeUri:
S3Bucket: "lambda-functions"
S3Key: "worker.jar"
Handler: "com.example.ExampleHandler"
Environment:
Variables:
lambda_environment: !Ref Environment
Events:
GetResource:
Type: Api
Properties:
Path: "/api/v1/worker"
Method: GET
SAM Drawbacks
- API Key creation does not support
- AWS::Serverless::API creates additional stage
- Lambda permission issue
Events:
PostResource:
Type: Api
Properties:
RestApiId: !Ref ExampleRestApi
Path: "/api/v1/worker"
Method: GET
LambdaInvokePermission:
Type: "AWS::Lambda::Permission"
Properties:
FunctionName: !Ref WorkerLambdaResorce
Action: "lambda:InvokeFunction"
...
Practical Use
1. One text file described your resources
2. Integration with AWS Code Pipeline
3. Work with AWS Service Catalog
Questions

More Related Content

What's hot

2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
Alex Heneveld
 

What's hot (20)

Infrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using CloudformationInfrastructure as Code in AWS using Cloudformation
Infrastructure as Code in AWS using Cloudformation
 
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
 
2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up2013 05-fite-club-working-models-cloud-growing-up
2013 05-fite-club-working-models-cloud-growing-up
 
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
AWS Presents: Infrastructure as Code on AWS - ChefConf 2015
 
Deep Dive: Infrastructure as Code
Deep Dive: Infrastructure as CodeDeep Dive: Infrastructure as Code
Deep Dive: Infrastructure as Code
 
Cloudformation101
Cloudformation101Cloudformation101
Cloudformation101
 
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
AWS re:Invent 2016: The Effective AWS CLI User (DEV402)
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
 
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
AWS Step Functions를 이용한 마이크로서비스 개발하기 - 김현민 (4CSoft)
 
Advanced Discussion on Cloud Formation
Advanced Discussion on Cloud FormationAdvanced Discussion on Cloud Formation
Advanced Discussion on Cloud Formation
 
AWS Cloud Formation
AWS Cloud Formation AWS Cloud Formation
AWS Cloud Formation
 
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
(DVO308) Docker & ECS in Production: How We Migrated Our Infrastructure from ...
 
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)Development in the could: How do we do it(Cloud computing. Microservices. Faas)
Development in the could: How do we do it(Cloud computing. Microservices. Faas)
 
Template of nested stack
Template of nested stackTemplate of nested stack
Template of nested stack
 
Introduction to aws cloud formation
Introduction to aws cloud formationIntroduction to aws cloud formation
Introduction to aws cloud formation
 
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A SymphonyAWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
AWS Summit Singapore - Lambda, Step Functions and Datadog: A Symphony
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Spring cloud config
Spring cloud configSpring cloud config
Spring cloud config
 
Writing JavaScript Applications with the AWS SDK (TLS303) | AWS re:Invent 2013
Writing JavaScript Applications with the AWS SDK (TLS303) | AWS re:Invent 2013Writing JavaScript Applications with the AWS SDK (TLS303) | AWS re:Invent 2013
Writing JavaScript Applications with the AWS SDK (TLS303) | AWS re:Invent 2013
 
Going Serverless
Going ServerlessGoing Serverless
Going Serverless
 

Similar to CloudFormation experience

Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
Jeremy Przygode
 
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Amazon Web Services
 

Similar to CloudFormation experience (20)

Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
Application Lifecycle Management in a Serverless World | AWS Public Sector Su...
 
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San FranciscoDeep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
Deep Dive into AWS SAM: re:Invent 2018 Recap at the AWS Loft - San Francisco
 
Deep Dive into AWS SAM
Deep Dive into AWS SAMDeep Dive into AWS SAM
Deep Dive into AWS SAM
 
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 Automating your Infrastructure Deployment with CloudFormation and OpsWorks –... Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
Automating your Infrastructure Deployment with CloudFormation and OpsWorks –...
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings AWS CloudFormation Intrinsic Functions and Mappings
AWS CloudFormation Intrinsic Functions and Mappings
 
How Intuit Leveraged AWS OpsWorks as the Engine of Our PaaS (DMG305) | AWS re...
How Intuit Leveraged AWS OpsWorks as the Engine of Our PaaS (DMG305) | AWS re...How Intuit Leveraged AWS OpsWorks as the Engine of Our PaaS (DMG305) | AWS re...
How Intuit Leveraged AWS OpsWorks as the Engine of Our PaaS (DMG305) | AWS re...
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormation
 
CloudFormation Best Practices
CloudFormation Best PracticesCloudFormation Best Practices
CloudFormation Best Practices
 
Building CICD Pipelines for Serverless Applications
Building CICD Pipelines for Serverless ApplicationsBuilding CICD Pipelines for Serverless Applications
Building CICD Pipelines for Serverless Applications
 
Managing the Life Cycle of IT Products
Managing the Life Cycle of IT ProductsManaging the Life Cycle of IT Products
Managing the Life Cycle of IT Products
 
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...
Best Practices for CI/CD with AWS Lambda and Amazon API Gateway (SRV355-R1) -...
 
Stratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration PresentationStratalux Cloud Formation and Chef Integration Presentation
Stratalux Cloud Formation and Chef Integration Presentation
 
AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹AWS Lambda 與 Amazon API Gateway 新功能介紹
AWS Lambda 與 Amazon API Gateway 新功能介紹
 
AWS CloudFormation Best Practices
AWS CloudFormation Best PracticesAWS CloudFormation Best Practices
AWS CloudFormation Best Practices
 
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
Automating your Infrastructure Deployment with AWS CloudFormation and AWS Ops...
 
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as CodeAWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
 
Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018Intro To Serverless Application Architecture: Collision 2018
Intro To Serverless Application Architecture: Collision 2018
 
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
Building CICD Pipelines for Serverless Applications - DevDay Austin 2017
 
Voxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by DesignVoxxed Athens 2018 - Serverless by Design
Voxxed Athens 2018 - Serverless by Design
 

More from Vitebsk Miniq

The 5 Laws of Software Estimates
The 5 Laws of Software EstimatesThe 5 Laws of Software Estimates
The 5 Laws of Software Estimates
Vitebsk Miniq
 

More from Vitebsk Miniq (20)

Runtime compilation and code execution in groovy
Runtime compilation and code execution in groovyRuntime compilation and code execution in groovy
Runtime compilation and code execution in groovy
 
The 5 Laws of Software Estimates
The 5 Laws of Software EstimatesThe 5 Laws of Software Estimates
The 5 Laws of Software Estimates
 
Latest & Greatest Observability Release 7.9
Latest & Greatest Observability Release 7.9Latest & Greatest Observability Release 7.9
Latest & Greatest Observability Release 7.9
 
Тестирование Spring-based приложений
Тестирование Spring-based приложенийТестирование Spring-based приложений
Тестирование Spring-based приложений
 
Семантический поиск - что это, как работает и чем отличается от просто поиска
Семантический поиск - что это, как работает и чем отличается от просто поискаСемантический поиск - что это, как работает и чем отличается от просто поиска
Семантический поиск - что это, как работает и чем отличается от просто поиска
 
Локализационное тестирование - это не только перевод
Локализационное тестирование - это не только переводЛокализационное тестирование - это не только перевод
Локализационное тестирование - это не только перевод
 
ISTQB Сертификация тестировщиков: быть или не быть?
ISTQB Сертификация тестировщиков: быть или не быть?ISTQB Сертификация тестировщиков: быть или не быть?
ISTQB Сертификация тестировщиков: быть или не быть?
 
Apollo GraphQL Federation
Apollo GraphQL FederationApollo GraphQL Federation
Apollo GraphQL Federation
 
Who is a functional tester
Who is a functional testerWho is a functional tester
Who is a functional tester
 
Crawling healthy
Crawling healthyCrawling healthy
Crawling healthy
 
Вперед в прошлое
Вперед в прошлоеВперед в прошлое
Вперед в прошлое
 
Learning Intelligence: the story of mine
Learning Intelligence: the story of mineLearning Intelligence: the story of mine
Learning Intelligence: the story of mine
 
Как программисты могут спасти мир
Как программисты могут спасти мирКак программисты могут спасти мир
Как программисты могут спасти мир
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
Distributed tracing system in action. Instana Tracing.
Distributed tracing system in action. Instana Tracing.Distributed tracing system in action. Instana Tracing.
Distributed tracing system in action. Instana Tracing.
 
Насорил - убери!
Насорил - убери!Насорил - убери!
Насорил - убери!
 
Styled-components. Что? Когда? И зачем?
Styled-components. Что? Когда? И зачем?Styled-components. Что? Когда? И зачем?
Styled-components. Что? Когда? И зачем?
 
Красные флаги и розовые очки
Красные флаги и розовые очкиКрасные флаги и розовые очки
Красные флаги и розовые очки
 
CSS. Практика
CSS. ПрактикаCSS. Практика
CSS. Практика
 
Разделяй и властвуй!
Разделяй и властвуй!Разделяй и властвуй!
Разделяй и властвуй!
 

Recently uploaded

Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

CloudFormation experience

  • 2. Menu ● appetizer: Amazon Services ● main course: CloudFormation basis ● desert: Serverless Application Model (SAM)
  • 3.
  • 5. What is my main course?
  • 7. Template Structure AWSTemplateFormatVersion: "version date" Description: String Metadata: template metadata Parameters: set of parameters Mappings: set of mappings Conditions: set of conditions Transform: set of transforms Resources: set of resources Outputs: set of outputs AWSTemplateFormatVersion: "2010-09-09" Description: "CloudFormation template Example" Metadata: Databases: "Information about databases" Instances: "Information about EC2 instances" Parameters: KinesisShardCount: Type: Number Default: 3 MinValue: 1 MaxValue: 10 Environment: Type: String Default: qa AllowedValues: - "prod" - "qa" - "dev"
  • 8. Template Structure AWSTemplateFormatVersion: "version date" Description: String Metadata: template metadata Parameters: set of parameters Mappings: set of mappings Conditions: set of conditions Transform: set of transforms Resources: set of resources Outputs: set of outputs Mappings: TemplateMapping: prod: lambdaName: "ProdLambda" apiGatewayStageName: "prod01" qa: lambdaName: "QaLambda" apiGatewayStageName: "qa02" dev: lambdaName: "DevLambda" apiGatewayStageName: "dev" FunctionName: Fn::FindInMap: ["TemplateMapping", !Ref Environment, "lambdaName"]
  • 9. Template Structure AWSTemplateFormatVersion: "version date" Description: String Metadata: template metadata Parameters: set of parameters Mappings: set of mappings Conditions: set of conditions Transform: set of transforms Resources: set of resources Outputs: set of outputs Conditions: ProdEnvironment: !Equals [!Ref Environment, "prod"] Resources: KinesisStream: Type: "AWS::Kinesis::Stream" Condition: ProdEnvironment DeletionPolicy: Delete Properties: ... Outputs: kinesisId: Value: !Ref KinesisStream Export: Name: !Sub "${Environment}-kinesis-id"
  • 10. CloudFormation SNS Resource Type: AWS::SNS::Topic Properties: DisplayName: String KmsMasterKeyId: String TopicName: String Subscription: - Subscription EmailNotification: Type: "AWS::SNS::Topic" Properties: TopicName: "interesting-information" Subscription: - "some.address@email.com" - "one.more.address@email.com"
  • 11. WorkerLambdaResource: Type: "AWS::Lambda::Function" Properties: FunctionName: !FindInMap ["TemplateMapping", !Ref Environment, "lambdaName"] Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/lambda-role" MemorySize: 512 Runtime: java8 Code: S3Bucket: "lambda-functions" S3Key: "worker.jar" Handler: "com.example.ExampleHandler" VpcConfig: SecurityGroupIds: [sg-085912345678492fb] SubnetIds: - subnet-071f712345678e7c8 - subnet-07fd123456788a036 Environment: Variables: param: value lambda_environment: !Ref Environment
  • 13. Serverless Application Model Transform: "AWS::Serverless-2016-10-31"
  • 14. Serverless Resource types ● AWS::Serverless::Function ● AWS::Serverless::Api ● AWS::Serverless::Application ● AWS::Serverless::SimpleTable ● AWS::Serverless::LayerVersion
  • 15. SAM Features Globals Section Globals: Function: Runtime: nodejs6.10 Timeout: 180 Handler: index.handler Environment: Variables: TABLE_NAME: data-table Api: EndpointConfiguration: REGIONAL Cors: "'www.example.com'" SimpleTable: SSESpecification: SSEEnabled: true
  • 16. API Gateway CloudFormation Resources ● API Gateway account ● REST API ● ... ● Resources hierarchy ● Methods ● Stages ● Deployments ● API key ● Custom domain name ● CORS (OPTIONS methods)
  • 17. API Gateway Serverless Resources Globals: Api: EndpointConfiguration: REGIONAL Cors: AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'" AllowMethods: "'POST,GET,OPTIONS'" AllowOrigin: "'www.example.com'" MethodSettings: - HttpMethod: GET ResourcePath: "/api/v1" LoggingLevel: INFO MetricsEnabled: false CachingEnabled: false ThrottlingRateLimit: 10000 ThrottlingBurstLimit: 5000 Resources: ExampleRestApi: Type: "AWS::Serverless::Api" Properties: Name: "REST API Example" StageName: !Ref Environment DefinitionUri: Bucket: api-bucket Key: swagger.yml
  • 18. WorkerLambdaResorce: Type: "AWS::Serverless::Function" Properties: FunctionName: worker-service Role: !Sub "arn:aws:iam::${AWS::AccountId}:role/lambda-role" Runtime: java8 MemorySize: 512 AutoPublishAlias: !Ref Environment CodeUri: S3Bucket: "lambda-functions" S3Key: "worker.jar" Handler: "com.example.ExampleHandler" Environment: Variables: lambda_environment: !Ref Environment Events: GetResource: Type: Api Properties: Path: "/api/v1/worker" Method: GET
  • 19. SAM Drawbacks - API Key creation does not support - AWS::Serverless::API creates additional stage - Lambda permission issue Events: PostResource: Type: Api Properties: RestApiId: !Ref ExampleRestApi Path: "/api/v1/worker" Method: GET LambdaInvokePermission: Type: "AWS::Lambda::Permission" Properties: FunctionName: !Ref WorkerLambdaResorce Action: "lambda:InvokeFunction" ...
  • 20. Practical Use 1. One text file described your resources 2. Integration with AWS Code Pipeline 3. Work with AWS Service Catalog