AWS SDK

Configuration

Configure Credentials:

aws configure

List of Configured Credentials:

aws configure list

Locate the AWS CLI Credentials File

View Credentials:

  1. Open a terminal or command prompt.
  2. Run the following command:
cat ~/.aws/credentials

This will display your configured access keys.

View Configuration:

To check the AWS region and other configuration details:

cat ~/.aws/config

AWS Systems Manager

Verify IAM Role Permissions

The EC2 instance you’re targeting needs an IAM role with the appropriate policies attached.

Steps:

1. Go to the EC2 Console, and check the IAM role attached to your instance:

2. Attach the following managed policies to the IAM role:

3. If you’re using a custom policy, ensure it includes the following permissions:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ssm:StartSession",
        "ssm:DescribeInstanceInformation",
        "ssm:SendCommand",
        "ssm:ListCommandInvocations",
        "ssm:GetCommandInvocation"
      ],
      "Resource": "*"
    }
  ]
}