DEV Community

Cover image for Awesome AWS CDK - Part 2 - Setting up AWS CDK
Emmanuel K
Emmanuel K

Posted on

3 2

Awesome AWS CDK - Part 2 - Setting up AWS CDK

What you will learn in this part

In this tutorial, you will learn:

  • How to install AWS CDK

Let's go!

Pre-requisites

You are going to need:

Setup

  • Make sure you have Node.js setup
  • Make sure your aws credentials are properly configured.

Here's an example of my AWS configured access files where I have my own personal aws account as the default profile and two other aws accounts for my work company -- acme-corp👨🏿‍💻.

AWS credentials file:

# Linux and MacOS: ~/.aws/credentials
# Windows: %USERPROFILE%\.aws\credentials

[default]
aws_access_key_id=xXXxxxxXXXXxxxxxxx
aws_secret_access_key=xxXXXXxxxXXxXxx

[acme-corp-prod-acc]
aws_access_key_id=xXXxxxxXXXXxxxxxxx
aws_secret_access_key=xxXXXXxxxXXxXxx

[acme-corp-dev-acc]
aws_access_key_id=xXXxxxxXXXXxxxxxxx
aws_secret_access_key=xxXXXXxxxXXxXxx
Enter fullscreen mode Exit fullscreen mode

AWS config file:

# Linux and MacOS: ~/.aws/config
# Windows: %USERPROFILE%\.aws\config

[default]
region=us-west-2
output=json

[profile acme-corp-prod-acc]
region=us-west-2
output=json

[profile acme-corp-dev-acc]
region=us-west-2
output=json
Enter fullscreen mode Exit fullscreen mode
  • The AWS CDK will look for these files when it needs access to whatever AWS accounts it needs to deploy resources to.
  • It helps that the IAM credentials used have administrator privileges when deploying resources as this will reduce a lot of headache regarding permissions.
  • You can filter out permissions and privileges if you have a good understanding of AWS IAM and the permission needs of your deployments.

Install the AWS CDK globally (so that you can bootstrap a new CDK project in your language choice) in any folder

npm install -g aws-cdk
Enter fullscreen mode Exit fullscreen mode

Check that its installed

cdk --version
Enter fullscreen mode Exit fullscreen mode

That's it!

In the next part, we will set up a project with the cdk and deploy it!


Hi I'm Emmanuel! I write about Software and DevOps.

If you liked this article and want to see more, add me on LinkedIn or follow me on Twitter

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post