Getting Started with AWS IoT and the Dragon IoT Starter Kit - AWS May 2016 Webinar Series
AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit...
Transcript of AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit...
![Page 1: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/1.jpg)
AWS Cloud Development KitInfrastructure as Code – but less painfulDANIEL BUCHHOLZ | 09.09.2019
Community Day 2019 Sponsors
![Page 2: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/2.jpg)
@danbdo
What is it?
If CloudFormation is “Infrastructure As Code”…
…then CDK is Infrastructure As REAL Code
…Code that supports type systems, structures, methods, control of execution flow…
![Page 3: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/3.jpg)
@danbdo
What is it?
AWS Cloudformation
AWS CDK
Abstraction layer on top of AWS CloudFormation
• TypeScript• JavaScript• Python• C#/.NET• Java
JSON/YAML
![Page 4: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/4.jpg)
@danbdo
What is it?
AWS Cloudformation
AWS CDKCLIAWS Construct
Library
CDK CLI• cdk deploy• cdk diff• cdk synth• cdk destroy
AWS Construct Library
= exposing definitions for AWS resources to be used in CDK apps
![Page 5: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/5.jpg)
@danbdo
Building Blocks
APP
Stack(s)
Construct Construct Construct
Custom Custom Custom
![Page 6: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/6.jpg)
@danbdo
Construct Nesting – Build Libraries!
APP
Stack(s)
ConstructConstruct
Construct
![Page 7: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/7.jpg)
@danbdo
Coding approach
Identical method signature for everything
new module.resource(this, 'id', {
prop1: 'val1',
prop2: val2,
...
});
Scope - Constructs/resources are defined within scope of
another construct
ID – has to be unique within scope
Props - within context of the construct
![Page 8: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/8.jpg)
@danbdo
CODE!
CODE!
![Page 9: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/9.jpg)
@danbdo
Your Cloud Governance team
![Page 10: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/10.jpg)
@danbdo
Example 5 – governance as a library
Need a queue
CDK
I’ll get you one
Do it this way
lib
• Move boilerplate code into libraries.
• Keeps it simple and repeatable for engineers.
…but with X, Y,
Z
![Page 11: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/11.jpg)
@danbdo
Example 5 – governance as a library
Need a queue
CDK
I’ll get you one
Encrypt!
lib
…the more you think about it…
…but add a DLQ
…encyptedas well
…have CW check for DLQ
items
…alarm through
SNS
![Page 12: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/12.jpg)
@danbdo
Your Cloud Governance team
![Page 13: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/13.jpg)
@danbdo
CI/CD
• CDK is relatively new
• CDK team is considering cdk package command, just like SAM
• CDK team and users are building CodeDeploy pipelines in CDK• So each app can essentially script and bring their own build process
![Page 14: AWS Cloud Development Kit CDK Infra as... · 2019. 9. 15. · AWS Cloud Development Kit Infrastructure as Code –but less painful DANIEL BUCHHOLZ | 09.09.2019 Community Day 2019](https://reader035.fdocuments.in/reader035/viewer/2022070112/6052a8dde57b33346a562a9b/html5/thumbnails/14.jpg)
@danbdo
Things to consider
• CDK => Cloudformation => same limitations
• Supported resources
• Service limits
• Ensure proper build/deploy automation => don’t cdk deploy from your machine to higher environments!
• Really good chance for reusable infrastructure libraries => do it, share it!
• https://docs.aws.amazon.com/cdk/
• CDK team very active on AWSDevelopers slack and on Gitter
• Stay right where you are and watch to Thorsten and Philippdive deep on the CDK!