CDK cookie cutter to accelerate development.
- construct should be in root folder to support smooth npm install git+ssh
- cdk init must run from an empty folder
Use VSCode, from terminal set the right params and folder context
cd ~/github
# update the construct name
constructName=<cdk-construct-xxxxxx> #naming convention for easier locate
Initialize the CDK construct
mkdir ${constructName}
cd ${constructName}
cdk init lib --language=typescript
Update doco.
#replace README.txt
curl -L https://gist.githubusercontent.com/racheliurui/0fcb3be5ce8478b02029e2a78dd41d50/raw/CDK-Construct.md > README.md
#add architecture diagram
touch ${constructName}.drawio.png
echo "# Architecture" >> README.md
echo '![architecture]'"(${constructName}.drawio.png)" >> README.md
prepare git repo
git init
git add -A
git commit -m "init"
Build the construct locally
npm install
npm run build
run the command from the other repo where you need to use the construct
npm install git+ssh://[email protected]:racheliurui/${constructName}.git
https://fourco.nl/blogs/writing-your-own-aws-cdk-constructs/