elailai94 / CDK-Demo

CDK app to practice provisioning infrastructure on AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CDK Workshop

Amazon AWS TypeScript

About

This repository contains practice code to provision infrastructure on Amazon Web Services (AWS) using the AWS Cloud Development Kit (CDK) and TypeScript. The code is based on the materials covered in the Get Started with AWS CDK tutorial by AWS.

The cdk.json file tells the CDK Toolkit how to execute your app. When the app is deployed, it creates an Virtual Private Cloud (VPC) with two public-facing subnets, spread across two Availability Zones (AZ).

Dependency Installation

In a new terminal window, install the dependencies by running:

# Install AWS CDK globally
npm install -g aws-cdk
# Verify installation by checking version number of the AWS CDK 
cdk --version
# Install TypeScript globally
npm install -g typescript
# Verify installation by checking version number of TypeScript
tsc --version
# Install Node packages in package.json
npm install

TypeScript Compilation

The npm run build command compiles the TypeScript code into JavaScript code.

Unit Testing

The npm run test command performs the Jest unit tests.

Stack Synthesis

The cdk synth command synthesizes the stack defined in the app into a CloudFormation template.

Stack Comparison

The cdk diff command compares the current version of the stack (and its dependencies) defined in the app with the already-deployed version(s) and displays a list of changes.

Stack Deployment

The cdk deploy command deploys the stack to the default AWS account and region.

Stack Watching

The cdk watch command continuously monitors the CDK app's source files and assets for changes and immediately performs a deployment of the stack when a change is detected.

Stack Destruction

The cdk destroy command destroys the stack by removing resources according to their deletion policy. This command should be ran when the stack is no longer needed.

License

About

CDK app to practice provisioning infrastructure on AWS

License:MIT License


Languages

Language:TypeScript 61.8%Language:JavaScript 38.2%