Skip to the content.

Deploying and Managing Infrastructure at Scale

What is CloudFormation?

Benefits of AWS CloudFormation

CloudFormation Stack Designer

AWS Cloud Development Kit (CDK)

Example of AWS CDK (Python)

To use AWS CDK, you need to install the CDK CLI and initialize a new CDK project. Once you have set up your project, you can start defining your cloud infrastructure using the programming language of your choice. Then, you can deploy the infrastructure to your AWS account using the CDK CLI.

In below example, we define an AWS CDK stack that creates an S3 bucket with versioning enabled. To run this code, you’ll need to have the AWS CDK for Python (aws-cdk-lib) installed in your Python environment. You can install it using pip:

pip install aws-cdk-lib

Once you have the dependencies installed, you can execute this Python script, and it will create the S3 bucket in your AWS account based on the code defined in the MyS3BucketStack class.

from aws_cdk import core
from aws_cdk import aws_s3 as s3

class MyS3BucketStack(core.Stack):
    def __init__(self, scope: core.Construct, id: str, **kwargs) -> None:
        super().__init__(scope, id, **kwargs)

        # Define an S3 bucket
        s3.Bucket(
            self,
            'MyS3Bucket',
            versioned=True,
            removal_policy=core.RemovalPolicy.DESTROY
        )

# App entry point
app = core.App()
MyS3BucketStack(app, 'MyS3BucketStack')
app.synth()

Developer problems on AWS

Typical architecture: Web App 3-tier

Web App 3-tier

AWS Elastic Beanstalk Overview

Elastic Beanstalk vs CloudFormation

AWS Elastic Beanstalk uses AWS CloudFormation underneath for managing the infrastructure and resources required to run your application. Then, what’s the difference between them?

Parameters AWS CloudFormation AWS Elastic Beanstalk
Purpose Infrastructure as Code Platform as a Service
Deployment Define and manage AWS infrastructure Simplified application deployment and scaling
Control High control and flexibility over underlying resources Simplified management of underlying resources
Management Manages entire stack of resources Abstracts infrastructure management
Granularity Fine-grained control over individual Limited configuration of underlying resources
Configuration Uses JSON or YAML templates Prescriptive configuration and environment setup
Use Cases Complex architectures and multi-service Web application deployment and scaling

Elastic Beanstalk - Health Monitoring

AWS CodeDeploy

AWS CodeCommit

AWS CodeBuild

AWS CodePipeline

AWS CodeArtifact

AWS CodeStar

AWS Cloud9

AWS Systems Manager (SSM)

How Systems Manager works

Systems Manager - SSM Session Manager

AWS OpsWorks

OpsWorks Architecture

OpsWorks Architecture

Deployment - Summary

Developer Services - Summary


Other Compute Section            List           Global Infrastructure

Download PDF :     AWS Cloud Practitioner Study Notes (PDF)