Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/okruti-raghuraj/aws-1/llms.txt

Use this file to discover all available pages before exploring further.

The AWS CDK CLI uses the AWS CLI’s credential chain to authenticate every API call it makes — bootstrapping, deployment, context lookups, and diffs all require valid AWS credentials to be present. This page covers installing the AWS CLI v2 from the bundled installer included in the repository, configuring your credentials, and verifying that everything is working before you run cdk deploy.

Installing the AWS CLI v2

The repository includes a pre-built AWS CLI v2 installer under aws-pipeline/aws/. This is a self-contained executable bundle — you do not need internet access to install from it. Navigate to the aws/ directory and run the install script with sudo:
sudo ./install
The installer places the aws binary at /usr/local/bin/aws. Once the script completes, verify the installation:
aws --version
# aws-cli/2.x.x Python/3.x.x ...

Installing Without sudo

If you do not have sudo privileges, or if you want to install the AWS CLI only for your current user, use the -i (install directory) and -b (bin directory) options:
./install -i ~/.local/aws-cli -b ~/.local/bin
This installs the CLI to ~/.local/aws-cli and creates symlinks for aws and aws_completer in ~/.local/bin. Make sure ~/.local/bin is on your PATH. For a full list of install options, run:
./install -h

Updating an Existing Installation

If you have a previous version of the AWS CLI v2 already installed, the install script will refuse to overwrite it. Pass the --update flag to replace the existing version with the one bundled in the repository:
sudo ./install --update

Removing the Installation

To completely uninstall the AWS CLI v2 installed from this bundle, delete the installation directory and its symlinks:
sudo rm -rf /usr/local/aws-cli
sudo rm /usr/local/bin/aws
sudo rm /usr/local/bin/aws_completer
If you used the -i and -b flags during installation, remove the corresponding directories and symlinks you specified instead.
The awscliv2.zip bundled in this repository may not be the latest version of the AWS CLI. For production environments, or if you need recent features and security patches, download the current release directly from AWS:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
See the official AWS CLI installation guide for platform-specific instructions.

Configuring Credentials

After installation, run aws configure to store your IAM credentials locally. The CLI will prompt you for four values:
aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: ap-south-1
Default output format [None]: json
PromptWhat to enter
AWS Access Key IDThe access key ID from your IAM user’s security credentials
AWS Secret Access KeyThe corresponding secret access key
Default region nameEnter ap-south-1 to match the project default, or your preferred region
Default output formatjson is recommended; also accepts text, table, or yaml
Credentials are stored in ~/.aws/credentials and the region/output settings in ~/.aws/config.

Verifying Your Credentials

After configuration, confirm that the CLI can successfully authenticate to AWS and that the correct account is active:
aws sts get-caller-identity
A successful response looks like this:
{
    "UserId": "AIDAIOSFODNN7EXAMPLE",
    "Account": "602143770054",
    "Arn": "arn:aws:iam::602143770054:user/your-iam-user"
}
The Account value must match the account ID configured in bin/aws-cdk-pipeline.ts. If you see an error or the wrong account, check that your access key and secret are entered correctly, or switch profiles with AWS_PROFILE=your-profile aws sts get-caller-identity.
For team environments, consider using AWS IAM Identity Center (SSO) instead of long-lived access keys. SSO grants short-lived credentials that expire automatically, eliminating the risk of leaked static keys. Configure it with:
aws configure sso
Follow the prompts to link your AWS Organizations SSO portal URL. Once configured, authenticate before each session with:
aws sso login --profile your-sso-profile
Set AWS_PROFILE=your-sso-profile in your shell or pass --profile your-sso-profile to CDK commands to use SSO credentials.

Build docs developers (and LLMs) love