Create Workspace

Create Workspace

  1. Access the interface AWS Management Console
  • Find Cloud9
  • Select Cloud9

CreateAWSCloud9

  1. In AWS Cloud9 interface
  • Select Create environment

CreateAWSCloud9

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

CreateAWSCloud9

  1. Next Step

  2. In Network settings

  • Select AWS SSM
  • Select Network (VPC)
  • Select Public subnet

CreateAWSCloud9

  1. Select Create

CreateAWSCloud9

  1. Environment interface just initialized

CreateAWSCloud9

  1. In the environment interface just initialized
  • Select the R icon
  • Select Manage EC2 Instance

CreateAWSCloud9

  1. In the EC2 interface
  • Select Action
  • Select Security
  • Select Modify IAM role

CreateAWSCloud9

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

CreateAWSCloud9

  1. Completed role assignment successfully

CreateAWSCloud9

  1. In the view of the AWS Cloud9 environment
  • Select AWS Cloud9
  • Select Preferences

CreateAWSCloud9

  1. 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

CreateAWSCloud9

  1. 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

CreateAWSCloud9

  1. 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

CreateAWSCloud9

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

CreateAWSCloud9

  1. Install taskcat
pip install taskcat

CreateAWSCloud9

  1. 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))

CreateAWSCloud9

  1. 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

CreateAWSCloud9

  1. 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"

CreateAWSCloud9