๐ Welcome to the aws-cdk-v2-samples
repository! Here, you'll find a curated collection of sample projects and code snippets that showcase the
capabilities of AWS Cloud Development Kit (CDK) version 2. If you're looking to kickstart your infrastructure-as-code journey with AWS CDK, you've come to
the right place!
- An active AWS account.
- Node.js 10.x or later.
- AWS CLI installed and configured.
-
Install the AWS CDK Toolkit Globally: This will provide you with the
cdk
command-line tool.npm install -g aws-cdk@2.x
-
Check the Installed Version:
cdk --version
-
Configure AWS CLI (if not done already):
Ensure that you have the AWS CLI installed and set up with the necessary access rights. You can configure the AWS CLI by running:
aws configure
-
Clone this Repository:
git clone https://github.com/uladkaminski/aws-cdk-v2-samples.git cd aws-cdk-v2-samples
-
Navigate to a Sample:
Each sample is contained within its own directory. Navigate to the sample of your choice:
cd [SAMPLE_DIRECTORY]
-
Install Dependencies:
npm install
-
Deploy the Sample:
Use the
cdk
command-line tool to deploy the sample:cdk deploy
-
(Optional) Destroy the Deployed Stack:
Once you're done experimenting with the sample, you can destroy the resources to avoid incurring costs:
cdk destroy
s3_bucket
: cdk project to create a private versioned S3 bucket and another one with fully public read policies.dynamo_db
: cdk project to create a DynamoDB table.lambda
: cdk project to create a Lambda function with cloudwatch alarm.gateway_lambda_s3
: stack with S3 bucket, lambda function with IAM role to access S3. Api Gateway on top of the lambda.route53-ecs-fargate
: stack with route53 subdomain record. Alb with routing to ECS with Fargate container taken from ECR.
Feel free to fork this repository, add your own samples, or enhance existing ones. Pull requests are always welcome!
This repository is licensed under the MIT License - see the LICENSE file for details.