Table of Contents
Getting started with AWS CDK
AWS CDK is here to stay. It allows you to define your cloud application resources using familiar programming languages. If AWS is a toolbox, CDK is the machinery to operate it. It is not for nothing that CTO of Amazon Werner Vogels spend this 15 minute video trying to outlay what it exactly does, and why it is great to use.
How do you get started?
You might have clicked this post in order to learn how to get started with CDK. We will follow the official documentation which can be found here: “Getting started with the AWS CDK”
Installing the AWS CLI
Firstly, you will need to have the AWS CLI installed and configured. Want to check if you have? Try if you can run the following command and if it returns you S3 buckets:
aws s3 ls
No command? No CLI.
If you can’t execute the command at all, you need to Install the AWS CLI per documentation. It’s really easy and should only take a minute or two.
No buckets? No configuration.
If you can execute the CLI command but get an error you don’t have any configuration: Create an IAM user in the AWS Console. Give it a user name and check the box for Access key — Programmatic access. Select Attach existing policies directly and select AdministratorAccess: click next untill you see Success and the access keys. (Only do this if you want to live on the edge and make your security department upset)
Use configure command and enter the information from the IAM user screen:
Try executing the aws cli again, and you should now get your S3 buckets listed.
Installing AWS CDK
With the AWS CLI setup you can now install the CDK using Node Package Manager:
npm install -g aws-cdk
Run the following command to verify correct installation and print the version number of the AWS CDK.
So, now you have the CDK installed: now what? You can find tons of idea’s on what to build on our not build to last blog. Examples include: