Create Workspace
Create Workspace
- Access the interface AWS Management Console
- Find Cloud9
- Select Cloud9

- In AWS Cloud9 interface
- Select Create environment

- In the Create environment interface
- Name, enter
ASG-Cloud9-Workshop

-
Next Step
-
In Network settings
- Select AWS SSM
- Select Network (VPC)
- Select Public subnet

- Select Create

- Environment interface just initialized

- In the environment interface just initialized
- Select the R icon
- Select Manage EC2 Instance

- In the EC2 interface
- Select Action
- Select Security
- Select Modify IAM role

- In the Modify IAM role interface
- Select the created role, for this lab choose CloudFormation-Role
- Select Save

- Completed role assignment successfully

- In the view of the AWS Cloud9 environment
- Select AWS Cloud9
- Select Preferences

- Cloud9 will manage IAM credentials automatically. We will need to disable this feature and use the IAM Role.
- Select AWS SETTINGS
- Select Credentials
- Uncheck AWS managed temporary credentials

- Copy and Paste the command below into the Terminal of Cloud9 Workspace to install tools to support text processing on the command line.
sudo yum -y install jq gettext bash-completion moreutils

- Install tool cfn-lint - a tool to help you check CloudFormation yaml/json templates and other information. This includes checking that the resource’s properties are correct or that the configuration information is following best practices.
pip install cfn-lint

- Check the cfn-lint installation is successful using the following command:
cfn-lint --version

- Install taskcat
pip install taskcat

- We will configure the aws cli to use the current Region.
export ACCOUNT_ID=$(aws sts get-caller-identity --output text --query Account)
export AWS_REGION=$(curl -s 169.254.169.254/latest/dynamic/instance-identity/document | jq -r '.region')
export AZS=($(aws ec2 describe-availability-zones --query 'AvailabilityZones[].ZoneName' --output text --region $AWS_REGION))

- We will save the configuration information to bash_profile
echo "export ACCOUNT_ID=$ACCOUNT_ID" | tee -a ~/.bash_profile
echo "export AWS_REGION=$AWS_REGION" | tee -a ~/.bash_profile
echo "export AZS=${AZS[@]}" | tee -a ~/.bash_profile
aws configure set default.region $AWS_REGION
aws configure get default.region

- We will use the command to check if the Cloud9 IDE is using the IAM Role correctly.
aws sts get-caller-identity --query Arn | grep CloudFormation-Role -q && echo "IAM role valid" || echo "IAM role NOT valid"
