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.
Follow this deep link to create an IAM role with Administrator access.
Confirm that AWS service and EC2 are selected, then click Next: Permissions to view permissions.
Confirm that AdministratorAccess is checked, then click Next: Tags to assign tags.
Take the defaults, and click Next: Review to review.
Enter hpcworkshop-admin for the Name, and click Create role.
Select the instance, then choose Actions / Instance Settings / Attach/Replace IAM Role.
Choose hpcworkshop-admin from the IAM Role drop down, and select Apply.
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.
To ensure temporary credentials aren’t already in place we will also remove any existing credentials file:
rm -vf ${HOME}/.aws/credentials
export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
echo $AWS_REGION
aws configure set default.region ${AWS_REGION}
aws configure get default.region