a. Lab Environment

In this step, we will create an IAM role with Administrator access and configure Cloud9 to use the IAM role for the rest of this lab.

  1. Follow this deep link to create an IAM role with Administrator access.

  2. Confirm that AWS service and EC2 are selected, then click Next: Permissions to view permissions.

  3. Confirm that AdministratorAccess is checked, then click Next: Tags to assign tags.

  4. Take the defaults, and click Next: Review to review.

  5. Enter hpcworkshop-admin for the Name, and click Create role. AWS Batch

  6. Follow this deep link to find your Cloud9 EC2 instance.

  7. Select the instance, then choose Actions / Instance Settings / Attach/Replace IAM Role. AWS Batch

  8. Choose hpcworkshop-admin from the IAM Role drop down, and select Apply. AWS Batch

  9. In Cloud9, click the gear icon (in top right corner), or click to open a new tab and choose “Open Preferences”. Select AWS SETTINGS to turn off AWS managed temporary credentials, then close the Preferences tab. AWS Batch

  10. To ensure temporary credentials aren’t already in place we will also remove any existing credentials file:

rm -vf ${HOME}/.aws/credentials
  1. Identify the AWS region with the following commands:
export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
echo $AWS_REGION
  1. Configure the AWS CLI to use this AWS region:
aws configure set default.region ${AWS_REGION}
aws configure get default.region