Björn's world
November 26, 2021

First steps with AWS CDK

Posted on November 26, 2021  •  1 minutes  • 181 words  • Other languages:  Deutsch
Table of contents

Warning

This site is deprecated. I moved my pipeline from aws cdk to Github-Pipeline. The documentation is still outstanding…

Create AWS-account

create-user secret

Create policy

While the cdkworkshop grants full access to the new CDK user , Alexander Zeitler presented a minimal approach here , which I definitely prefer. So I create the minimum policy and expand it with every necessary one Authorization for the specific job and assign it to my new user.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "cloudformation:*"
      ],
      "Resource": "*",
      "Effect": "Allow"
    },
    {
      "Action": "s3:*",
      "Resource": "arn:aws:s3:::cdktoolkit-stagingbucket-*",
      "Effect": "Allow"
    }
  ]
}

Install and configure AWS CLI

The installation is straightforward:

$ aws configure
AWS Access Key ID [None]: <Zugriffsschlüssel-ID>
AWS Secret Access Key [None]: <Geheimer Zugriffsschlüssel>
Default region name [None]: <eu-central-1 | us-east-1 | ...>
Default output format [None]: <leer lassen, Standard ist yaml>

Install CDK

$ npm install -g aws-cdk
$ cdk --version
1.134.0 (build dd5e12d)

Photo credit banner

Follow me