This is a blank project for TypeScript development with CDK.
The cdk.json
file tells the CDK Toolkit how to execute your app.
npm run build
compile typescript to jsnpm run watch
watch for changes and compilenpm run test
perform the jest unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation template
bin - only contains the index.ts. Used for boostapping the stacks stacks - contains the indivual CDK stacks public - the static website contents which will get uploaded to S3
You have to be using at least Node10.
nvm install 10
nvm use 10
You'll need to install the CDK CLI globally
npm install -g aws-cdk
Install all required dependecies
npm i
Configure the context in cdk.json
with your requirements:
"context": {
"domain": "thedev.cloud",
"subdomain": "www"
}
Set Varibales in bin/index.ts
before transpiling
const account = '072319143516'
const region = 'us-east-1'
Transpile Typescript files to Javascript
npm run build
Create an the CloudFormatione template which is then used to deploy
cdk synth --profile thedevcloud
The generated CloudFormation template will be outputed into cdk.out/
directory
Before you can deploy your generated CloudFormation template it needs to be uploaded to S3 along with addtional assets. So we'll boostrap before we deploy
cdk bootstrap --profile thedevcloud
Ensure the credentailas via your profile you are using has access to create roles. You may want to have a user with AdmistrativeAccess
Then we can go ahead and deploy
cdk deploy --profile thedevcloud