Skip to content

Provides step-by-step configuration for AWS accounts and local development environment required for AWS CDK with Java.

License

Notifications You must be signed in to change notification settings

AdamBien/aws-java-cdk-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 

Repository files navigation

CDKv2 for Java Setup

Step-by-step configuration for AWS CDK with Java.

Prerequisites

Before starting, ensure you have the following installed:

πŸ“š Documentation: AWS CDK Prerequisites

AWS Credentials Setup

Obtain Credentials from AWS Access Portal

If your organization uses AWS IAM Identity Center (formerly AWS SSO):

  1. Navigate to your AWS Access Portal URL (provided by your administrator)
  2. Sign in with your credentials
  3. Select the AWS account you want to access
  4. Click on "Access Keys"
  5. Copy the credentials from: "Option 1: Set AWS environment variables" and paste them to the terminal

πŸ“š Documentation: AWS IAM Identity Center

Verify Credentials

After setting the environment variables, verify your credentials:

aws sts get-caller-identity

Expected output:

{
    "UserId": "AIDAXXXXXXXXXXXXXXXXX",
    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/your-username"
}

Tool Installation

Install AWS CLI

On macOS using Homebrew:

brew install awscli

Verify installation:

aws --version

Expected output: aws-cli/2.x.x ...

πŸ“š Documentation: Installing AWS CLI

Install AWS CDK CLI

Install CDK CLI globally using npm:

npm install -g aws-cdk

Verify installation:

cdk --version

Expected output: 2.x.x (build ...)

πŸ“š Documentation: Installing AWS CDK

Environment Bootstrap

Paste the credentials into the terminal before running the commands below.

Bootstrap your AWS environment for CDK deployments. This creates necessary resources (S3 bucket, IAM roles) in your AWS account:

cdk bootstrap aws://ACCOUNT-NUMBER/REGION

Example:

cdk bootstrap aws://123456789012/us-east-1

Or let CDK determine your account and region automatically:

cdk bootstrap

Expected output:

 ⏳  Bootstrapping environment aws://123456789012/us-east-1...
 βœ…  Environment aws://123456789012/us-east-1 bootstrapped.

What does bootstrap create?

  • S3 bucket for storing CDK assets (Lambda code, Docker images)
  • IAM roles for CloudFormation deployments
  • ECR repository for container images (if needed)

πŸ“š Documentation: Bootstrapping CDK

Verification

Verify your setup by deploying a working example project:

git clone https://github.com/AdamBien/aws-quarkus-lambda-function-url-cdk-plain.git
cd aws-quarkus-lambda-function-url-cdk-plain

Follow the deployment instructions in that repository to confirm your environment is properly configured.

πŸ“š Documentation: Deploying CDK Applications

About

Provides step-by-step configuration for AWS accounts and local development environment required for AWS CDK with Java.

Topics

Resources

License

Stars

Watchers

Forks