Quick Start
Install cdk and crpm, and deploy an AWS CloudFormation stack.
Introduction
The easiest and recommended way to get started, would be to launch a Cloud9 cloud IDE and perform this tutorial in it.
Install
-
Check your version of Node.js. Cloud Resource Property Manager (crpm) is a command line Node.js application written in TypeScript, so Node.js needs to be installed in order to use crpm.
node -v
You should have v10.13.0 or greater installed.
-
Install AWS CDK (cdk), Cloud Resource Property Manager (crpm), and TypeScript globally.
npm install -g aws-cdk npm install -g crpm typescript
Quick Tutorial
-
See a list of available resources that can be imported.
crpm ls
-
Create a new directory for infrastructure.
mkdir infra cd infra
-
Initialize a new CDK application.
cdk init app --language typescript
-
Import S3 bucket template files.
crpm i storage/s3/bucket
-
Open res/storage/s3/bucket/props.yaml for editing.
-
Uncomment the accessControl property and assign it ‘Private’. After doing so, your file should contain a line that looks like this.
accessControl: 'Private'
-
Save and close res/storage/s3/bucket/props.yaml.
At this point, you could also edit lib/infra-stack.ts, but this tutorial does not require changes to that file.
-
Deploy the stack.
cdk deploy
-
Destroy the stack.
cdk destroy