O'Reilly logo

Effective DevOps with AWS - Second Edition by Nathaniel Felsen, Giuseppe Borgese, Yogesh Raheja

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating our ECS hello world service

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:

"""Generating CloudFormation template."""from troposphere.ecs import (    TaskDefinition,    ContainerDefinition)from troposphere import ecsfrom awacs.aws import (    Allow,    Statement,    Principal,    Policy)from troposphere.iam import Rolefrom troposphere import (    Parameter,    Ref,    Template,    Join,    ImportValue, Select, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required