July 2017
Intermediate to advanced
402 pages
9h 38m
English
We have an ECS cluster and a load balancer ready to take on traffic on one side, and an ECR repository containing the image of our application on the other side. We now need to tie the two together. This is done by creating an ECS service resource.
We will create a new file called helloworld-ecs-service-cf-template.py and start as usual with its imports, template variable creation, and template description, shown in the following code:
"""Generating CloudFormation template."""
from troposphere.ecs import (
TaskDefinition,
ContainerDefinition
)from troposphere import ecs
from awacs.aws import ( Allow, Statement, Principal, Policy ) from troposphere.iam import Role from troposphere import ( Parameter, Ref, ...Read now
Unlock full access