Slide 1

Slide 1 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. DevOps in Practice for Beginners Donnie Prakoso Principal Developer Advocate Amazon Web Services go.donnie.id/youtube donnieprakoso @donnieprakoso donnieprakoso

Slide 2

Slide 2 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Teams that adopt modern software practices are more agile and higher performing Source: 2019 DORA State of DevOps report Teams who automate software delivery with continuous delivery: DEPLOYMENT FREQUENCY Weekly–mo nthly Hourly–dail y CHANGE LEAD TIME 1–6 months 1–7 days CHANGE FAILURE RATE 46–60% 0%–15%

Slide 3

Slide 3 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. So why hasn’t everyone already moved to DevOps? Too difficult to get started Need to glue together too many services 1 2 3 4 Not enough centralized oversight Sift through all the vendors Lack internal expertise 3

Slide 4

Slide 4 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Today, We Are Going to Discuss... CI/CD Infrastructur e as Code Continuous Configuration

Slide 5

Slide 5 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure as 🡪 is code

Slide 6

Slide 6 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Treat Infrastructure The Same Way Developers Treat Codes

Slide 7

Slide 7 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Infrastructure as 🡪 is Code 1. Make infrastructure changes repeatable and predictable 2. Release infrastructure changes using the same tools as code changes 3. Replicate production environment in a staging environment to enable continuous testing

Slide 8

Slide 8 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s start with a simple task Build Serverless APIs Build a set of serverless APIs to process string operations from text input. We also need to save the request data into a database.

Slide 9

Slide 9 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EC2 Amazon S3 AWS Transit Gateway Amazon Kinesis Amazon Kendra Hundreds of AWS and third-party resources AWS Proton AWS Amplify AWS Service Catalog AWS CloudFormation AWS CloudFormation resource registry AWS Cloud Control API AWS CDK & AWS SAM Platform operations and deployment AWS IaC portfolio at a glance

Slide 10

Slide 10 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. “Which tools should I use?”

Slide 11

Slide 11 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. The most practical answer... Declarative High-level programming languages AWS CDK AWS CloudFormation

Slide 12

Slide 12 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Cloud Development Kit (CDK) A multi-language software development framework for modeling cloud infrastructure as reusable components Familiar Your language – just code Tool support Autocomplete – inline documentation Abstraction Sane defaults – reusable classes Java

Slide 13

Slide 13 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Development Workflow CDK CLI AWS CloudFormation Stacks & Constructs Source Code Templates + Assets Cloud Assembly Cloud Resources execute synthesize deploy provision 📙 cdk init 🛠 npm run build 🧬 cdk synth 🔎 cdk diff 🚀 cdk deploy // create new project // build project // create templates and assets // check what will change // push changes to your account

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. But, we need to build multiple app environments Configure multiple environments for previous serverless APIs. Deploy the same stack for environments: Maintain dev/prod parity.

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. “But, I use Terraform.”

Slide 18

Slide 18 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDK for Terraform (cdktf) Synthesize Terraform JSON configuration

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Converting existing resources into IaC AWS CLOUDFORMATION IAC GENERATOR The IaC generation process consists of several steps: 1. Start a scan of your account. 2. Create a template 3. Add scanned resources 4. Import the resources to be managed by CloudFormation as a stack or migrate them into an AWS CDK app. AWS CloudFormation AWS Resource s IaC Generator Template s Deploy

Slide 21

Slide 21 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Importing existing resources into AWS CDK AWS CLOUDFORMATION IAC GENERATOR What to migrate? • Resources created outside of IaC • A deployed CloudFormation Stack cdk migrate • Migrate one or many resources into a new CDK application cdk import • Reuse existing CDK application and import one or many resources that were created outside of the CDK AWS Resource s AWS Resource s Existing CDK app cdk deploy New CDK app cdk import cdk migrate

Slide 22

Slide 22 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Decoupling Configurations from Applications Build Process Application Source Code Config Releas e Artifact

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. CI/CD foundations

Slide 25

Slide 25 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Release process stages Source Build Test Deployment Continuous integration Continuous deployment Continuous delivery

Slide 26

Slide 26 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. CDK Pipelines A construct library for painless Continuous Delivery of CDK applications. • Extends Stack ability to implement CI/CD • Deployment for multiple environments • Define Stage 🡪 Pipeline 🡪 Deploy • Self-mutating • Support multiple deployment engines

Slide 27

Slide 27 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Implement CI/CD with CDK Pipelines Building Release Pipeline Automate deployment when a new code is pushed and self-mutating infrastructure in an application environment

Slide 28

Slide 28 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous Delivery for Multi-Envs CI/CD for Multi-Envs Create a release pipeline that self-mutates and triggered when a new code is pushed. Implement continuous deployment in the staging environment and continuous delivery (with manual approval) for production.

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. What’s next? Unlock developer velocity with a self-service infrastructure ECS Cluster 2 Migrate to modern best practices faster by configuring AWS Proton for seamless infrastructure deployments and updates Platform engineers create infrastructure templates and environments 1 Developers select versioned service templates to deploy and maintain their application 2 3 Platform engineers have centralized visibility and version management ECS Cluster 1 AWS Proton 30

Slide 31

Slide 31 text

© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you! Donnie Prakoso Principal Developer Advocate AWS 31 go.donnie.id/youtube donnieprakoso @donnieprakoso donnieprakoso