Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS...
Transcript of Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS...
Infrastructure Is Code with the AWS Cloud Development Kit
Richard BoydSoftware Engineer and Developer AdvocateAWS Developer Tools
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda• Our infrastructure management journey• The AWS Cloud Development Kit (AWS CDK)• Demo: Build an AWS CDK app• A lot more to explore
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Scripted
🤔 What happens if an API call fails?🤔 How do I make updates?🤔 How do I know a resource is ready?🤔 How do I roll back?
Scripted
Manual
High level
Low level
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resource provisioning engines
AWS CloudFormation template
(JSON/YAML)
HashiCorp Configuration Language (HCL)
Desired state configuration
Declarative
Scripted
Manual
High level
Low level
👍 Easy to automate👍 Reproducible😩 Configuration syntax😩 No abstraction, lots of details
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Document Object Models (DOMs)Troposphere Python
SparkleFormation Ruby
GoFormation Go
…
if statements, for loops, IDE benefits
Ex: 218 lines of Troposphere for a VPC
AWS CloudFormation
Template
👍 Real code ♥👍 Desired state😩 Abstraction is not built-in
DOMs
Declarative
Scripted
Manual
High level
Low level
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CloudFormation
template
AWS CDK application
Stack(s)
Construct Construct
AWS CDK
Componentized
DOMs
Declarative
Scripted
Manual
High level
Low level
Resources
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CDK
Componentized
DOMs
Declarative
Scripted
Manual
High level
Low level
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Componentized
DOMs
Declarative
Scripted
Manual
High level
Low level
AWS CDK
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo – Goals• CDK concepts• CDK CLI workflow• AWS construct library
HelloCdkStack
event source
SQS QueueNew Tweets
CloudWatch Logs
console.log
send-message
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo recap
CloudFormation Template
“compiler”
CDK CLI
“processor”“assembly language”
“source”
synthesize deployexecutes
Get started:npm install -g aws-cdkcdk init --language <typescript | java | csharp | ...>
Thank you!Richard Boyd
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Next steps• Try out the CDK• https://cdkworkshop.com• https://awslabs.github.io/aws-cdk• https://github.com/awslabs/cdk-reinvent
• Engage with us• https://github.com/awslabs/aws-cdk• https://gitter.im/awslabs/aws-cdk