Automating with the AWS Cloud Development Kit
The Cloud Development Kit (CDK) is a multi-language SDK that lets you write code to define AWS infrastructure (https://github.com/aws/aws-cdk). Using the CDK CLI, you can then provision this infrastructure, using CloudFormation under the hood.
Installing CDK
CDK is natively implemented with Node.js, so please make sure that the npm
tool is installed on your machine (https://www.npmjs.com/get-npm).
Installing CDK is then as simple as this:
$ npm i -g aws-cdk $ cdk --version 1.55.0 (build 48ccf09)
Let's create a CDK application and deploy an endpoint.
Creating a CDK application
We'll deploy the same model that we deployed with CloudFormation. I'll use Python, but you could also use JavaScript, TypeScript, Java, and .NET. The API documentation is available at https://docs.aws.amazon.com/cdk/api/latest/python/. Let's begin:
- We create a Python application named
endpoint
:$ mkdir cdk $ cd cdk ...