In the Cloud9 workspace, run the following commands:
aws iam get-role --role-name "AWSServiceRoleForElasticLoadBalancing" || aws iam create-service-linked-role --aws-service-name "elasticloadbalancing.amazonaws.com"
aws iam get-role --role-name "AWSServiceRoleForECS" || aws iam create-service-linked-role --aws-service-name "ecs.amazonaws.com"
In this section we will setup Container insights. In order to get started, we need to deploy the environment as well as a frontend service in ECS. If you deployed the microservices in the chapter prior, you can skip this step and move on to the next page.
Clone the service repos:
cd ~/environment
git clone https://github.com/aws-containers/ecsdemo-platform
git clone https://github.com/aws-containers/ecsdemo-frontend
git clone https://github.com/aws-containers/ecsdemo-nodejs
git clone https://github.com/aws-containers/ecsdemo-crystal
First, we need to build the environment for our frontend service to run. For more information on what we’re building, you can review the code here: Platform.
cd ~/environment/ecsdemo-platform/cdk
pip install -r requirements.txt
cdk context --clear && cdk deploy --require-approval never
Next, we will deploy a three-tier polyglot web app to our ECS cluster. For more information on what is being deployed, see the microservices section of the workshop.
cd ~/environment/ecsdemo-frontend/cdk
pip install -r requirements.txt
cdk context --clear && cdk deploy --require-approval never
cd ~/environment/ecsdemo-nodejs/cdk
pip install -r requirements.txt
cdk context --clear && cdk deploy --require-approval never
cd ~/environment/ecsdemo-crystal/cdk
pip install -r requirements.txt
cdk context --clear && cdk deploy --require-approval never
Once you’ve created the platform and deployed the services to the cluster, please move on to the next page.