
Create your AWS account, install and configure prerequisites including node and the AWS CLI, and install the AWS CDK to begin building infrastructure as code.
Create AWS account by signing up with an email and password, verify via SMS, enter credit card details, select free basic plan, and sign in to the console as root.
Verify node is installed and check the version with node --version, since AWS CDK requires node. Consult the appendix for installation steps and environment setup.
Install the AWS CLI on macOS or Windows, configure a profile and region us-east-1 with YAML output, then create an IAM user with programmatic access and test aws ec2 describe-instances.
Install the AWS CDK by confirming node and npm, install globally with npm install -g, use sudo or administrator rights when needed, then verify with cdk --version.
On this lecture you'll also find the link to the GitHub repository with the source code
learn to add an S3 bucket to a CDK stack in TypeScript, install compatible CDK packages, import the bucket, set scope and id, and configure optional encryption in bucket props.
Learn to navigate the AWS CDK documentation, create and encrypt an S3 bucket with KMS, and compare level one, two, and three constructs while reviewing CFN resources and experimental features.
Bootstrapping your CDK project with cdk bootstrap creates the AWS resources, including an S3 bucket and bucket policy, so your application deploys via CloudFormation.
Discover how to generate a CloudFormation template with CDK synthesize by defining a bucket and exporting its name with cfn output, creating a template in the templates folder.
Refine CDK tests by using templates to verify the resource and the outputs, remove bucket metadata, and focus on the S3 bucket and its policies and exports.
Install the AWS CDK assert package and write tests for a simple app stack, importing assert, and validating an S3 bucket resource. Run npm test to confirm both tests pass.
Create a lambda using the CDK NodeJS construct and enable ES module interop in tsconfig to write TypeScript with import syntax, while managing a mono repo setup and npm dependencies.
Create a TypeScript lambda handler for a CDK project, exporting a get photos function, wiring API Gateway v2 proxy events, and returning a 204 status with a string body.
Create an AWS lambda resource in the CDK, configure the entry path with path.join, specify a nodejs runtime, and deploy it in the same stack.
Explore deploying a TypeScript Lambda with the AWS CDK, including diff checks, transpiling to JavaScript, Docker-based packaging, and creating a lambda function and its role through CDK deploy.
Demonstrate testing a CDK Lambda function in AWS, create test events, deploy changes, and monitor CloudWatch logs for duration, memory, and log outputs.
Explains deploying photo assets to an S3 bucket using CDK's S3 deployment, wiring the bucket to a Lambda via environment variables, and validating uploads with logs.
Link an S3 bucket to a Lambda function with the AWS SDK S3 package, import S3, list objects, generate a URL, and handle errors with promises and try-catch.
Create a CDK-based lambda that generates signed URLs for private, encrypted S3 objects with a 24-hour expiration and the proper IAM access.
Create IAM policies for a lambda to access an S3 bucket, install AWS CDK IAM package, define policy statements for list and get/put object, and attach them to lambda role.
Create an API Gateway and Lambda integration using the CDK, set up an Http API route for get photos, and deploy to obtain the API URL for testing with Postman.
Create a React app using TypeScript in the front end folder, bypass preflight checks with a dot env, start the dev server, and prepare to deploy to S3 with CDK.
Create an S3 bucket for hosting a React website with public read access, build the frontend with yarn build, and deploy the app using CDK to export the bucket name.
AWS Cloud Development Kit (AWS CDK)
Welcome to the AWS Cloud Development Kit (AWS CDK) Developer Guide. This document provides information about the AWS CDK, which is a software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation.
AWS CloudFormation enables you to:
Create and provision AWS infrastructure deployments predictably and repeatedly.
Leverage AWS products such as Amazon EC2, Amazon Elastic Block Store, Amazon SNS, Elastic Load Balancing, and Auto Scaling.
Build highly reliable, highly scalable, cost-effective applications in the cloud without worrying about creating and configuring the underlying AWS infrastructure.
Use a template file to create and delete a collection of resources together as a single unit (a stack).
Use the AWS CDK to define your cloud resources in a familiar programming language. The AWS CDK supports TypeScript, JavaScript, Python, Java, and C#/.Net.