Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Infrastructure is code

Infrastructure is code

Effectively building and managing cloud infrastructure at scale is hard. Implementing infrastructure as code makes things much easier, though most frameworks use DSL's such as YAML or JSON that miss most of the advantages of modern programming languages. For this reason, we introduced the AWS Cloud Development Kit (CDK), an extensible open-source software development framework to define cloud infrastructure in code. The CDK offers a higher level object-oriented abstraction to define your cloud resources, without needing to understand detailed configuration. In this session, we are introducing the main concepts for using the CDK to easily encapsulate best practices in your infrastructure definition and share it without worrying about boilerplate logic. A live demo will apply those concepts to a real-world scenario using containers and serverless components.

More Decks by Sébastien Stormacq - AWS Developer Advocate

Other Decks in Technology

Transcript

  1. © 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
  2. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Infrastructure as Click?
  3. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Infrastructure as Code!
  4. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Manual Easy to get started Not reproducible Error prone Time consuming Manual High level Low level
  5. © 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
  6. © 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
  7. © 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
  8. © 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
  9. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS Construct Library AWS CDK Componentized DOMs Declarative Scripted Manual High level Low level
  10. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Componentized DOMs Declarative Scripted Manual High level Low level AWS CDK
  11. © 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 Queue New Tweets CloudWatch Logs console.log send-message
  12. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CDK Workflow Get started: npm install -g aws-cdk cdk init --language <typescript | java | csharp | ...> CloudFormation Template “compiler” CDK CLI “processor” “assembly language” “source” synthesize deploy executes
  13. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Demo recap Get started: npm install -g aws-cdk cdk init --language <typescript | java | csharp | ...> CloudFormation Template “compiler” CDK CLI “processor” “assembly language” “source” synthesize deploy executes
  14. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. AWS construct library • Amazon Elastic Container Service (Amazon ECS) • AWS Lambda • Amazon API Gateway • Amazon Elastic Cloud Compute (Amazon EC2) • VPCs, security groups, Auto Scaling • Amazon CloudWatch • Metrics, alarms, dashboards • AWS Step Functions • AWS CodePipeline • AWS Auto Scaling
  15. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Multi-language support Coming soon!
  16. © 2018, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Next steps Try out the CDK • https://cdkworkshop.com • https://github.com/aws/aws-cdk • https://docs.aws.amazon.com/cdk Engage with us • https://github.com/aws/aws-cdk
  17. Thank you! © 2018, Amazon Web Services, Inc. or its

    affiliates. All rights reserved. Sébastien Stormacq @sebsto