Setting Up Our Development Environment for the AWS CDK for Node.js - krdheeraj51/aws-labs GitHub Wiki

Let's walk through setting up the AWS CDK environment on your machine. Follow these steps for a smooth configuration:

Installing AWS CLI and Configuring it on Windows

  1. Install AWS CLI:

  2. Verify the Installation:

    • Open a new Command Prompt or PowerShell window.
    • Run the following command:
    aws --version
    
  3. Configure AWS CLI:

    • Run the following command:
    aws configure
    
    • Provide the requested information:
      • AWS Access Key ID: Your AWS access key.
      • AWS Secret Access Key: Your AWS secret key.
      • Default region name: The AWS region you want to use (e.g., us-east-1).
      • Default output format: The preferred output format (e.g., json).

Checking the Installation of Node.js and npm

  1. Open a Terminal or Command Prompt:

    • Windows: Open Command Prompt or PowerShell.
    • macOS/Linux: Use the Terminal.
  2. Check Node.js Version:

    node -v
    
  3. Check npm Version:

    npm -v
    

    Note: If Node.js isn't already installed, download and install it from https://nodejs.org/ before proceeding. Node.js and npm are prerequisites for the AWS CDK.

Installing the AWS CDK Package

  1. Open a Terminal or Command Prompt.

  2. Install the AWS CDK package using npm:

    npm install -g aws-cdk  # The -g flag installs it globally
    

    (Or, if you prefer yarn: yarn global add aws-cdk)

  3. Verify the Installation:

    cdk --version
    

    This command should print the installed version of the CDK.

Next Steps

After completing these steps, you're ready to create your first CDK application!