Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS...

16
Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer Tools

Transcript of Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS...

Page 1: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

Infrastructure Is Code with the AWS Cloud Development Kit

Richard BoydSoftware Engineer and Developer AdvocateAWS Developer Tools

Page 2: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 3: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer
Page 4: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 5: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 6: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 7: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer
Page 8: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 9: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

AWS CDK

Componentized

DOMs

Declarative

Scripted

Manual

High level

Low level

Page 10: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Componentized

DOMs

Declarative

Scripted

Manual

High level

Low level

AWS CDK

Page 11: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer
Page 12: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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

Page 13: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer
Page 14: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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 | ...>

Page 15: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

Thank you!Richard Boyd

@[email protected]

Page 16: Infrastructure Is Code with the AWS Cloud Development Kit · Infrastructure Is Code with the AWS Cloud Development Kit Richard Boyd Software Engineer and Developer Advocate AWS Developer

© 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