Skip to content

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Python Examples

Language-Support: Stable

This section contains all the CDK code examples written in Python. For more information on using the CDK in Python, please see the Developer Guide.

Running Examples

To run example

  1. Ensure CDK is installed
$ npm install -g aws-cdk
  1. Create a Python virtual environment
$ python3 -m venv .venv
  1. Activate virtual environment

On MacOS or Linux

$ source .venv/bin/activate

On Windows

% .venv\Scripts\activate.bat
  1. Install the required dependencies.
$ pip install -r requirements.txt
  1. Synthesize (cdk synth) or deploy (cdk deploy) the example
$ cdk deploy

To dispose of the stack afterwards:

$ cdk destroy

Table of Contents

Example Description
api-cors-lambda Shows creation of Rest API (GW) with an /example GET endpoint, with CORS enabled
application-load-balancer Using an AutoScalingGroup with an Application Load Balancer
appsync-graphql-dynamodb Creating a single GraphQL API with an API Key, and four Resolvers doing CRUD operations over a single DynamoDB
classic-load-balancer Using an AutoScalingGroup with a Classic Load Balancer
custom-resource Shows adding a Custom Resource to your CDK app
dockerized-app Deploys a containerized app into 3 tiers with userdata in an autoscaling group
ecs-cluster Provision an ECS Cluster with custom Autoscaling Group configuration
ecs-load-balanced-service Starting a container fronted by a load balancer on ECS
ecs-service-with-task-placement Starting a container ECS with task placement specifications
ecs-service-with-advanced-alb-config Starting a container fronted by a load balancer on ECS with added load balancer configuration
ecs-service-with-task-networking Starting an ECS service with task networking, allowing ingress traffic to the task but blocking for the instance
fargate-load-balanced-service Starting a container fronted by a load balancer on Fargate
fargate-service-with-autoscaling Starting an ECS service of FARGATE launch type that auto scales based on average CPU Utilization
lambda-cron Running a Lambda on a schedule
lambda-layer Running a Lambda with a lambda layer
lambda-s3-trigger S3 trigger for Lambda
rds Creating a MySQL RDS database inside its dedicated VPC
s3-object-lambda Creating an S3 Object Lambda and access point
stepfunctions A simple StepFunctions workflow
url-shortener Demo from the Infrastructure is Code with the AWS CDK AWS Online Tech Talk
ec2-instance Create EC2 Instance in new VPC with Systems Manager enabled
serverless-backend Create a serverless backend with API Gateway, Lambda, S3, DynamoDB, and Cognito
vpc-ec2-local-zones Create a VPC with public and private subnets in AWS Local Zones