ecs_composex.ecs.ecs_service package

Submodules

ecs_composex.ecs.ecs_service.helpers module

ecs_composex.ecs.ecs_service.helpers. define_deployment_options ( family , props ) [source]

Function to define the DeploymentConfiguration Default is to have Rollback and CircuitBreaker on.

Parameters :
Return type :

None

ecs_composex.ecs.ecs_service.helpers. define_family_deploy_percents ( values , default ) [source]

Simple function to average out sum of values or return default value :type values: list :param values: :type default: int :param default: :rtype: int :return: The default or average value

ecs_composex.ecs.ecs_service.helpers. define_placement_strategies ( ) [source]

Function to generate placement strategies. Defaults to spreading across all AZs

Return type :

troposphere.If

Returns :

list of placement strategies

ecs_composex.ecs.ecs_service.helpers. set_service_default_tags_labels ( family ) [source]

Sets default service tags and labels

Return type :

troposphere.Tags

ecs_composex.ecs.ecs_service.helpers. set_service_update_config ( family ) [source]

Method to determine the update_config for the service. When a family has multiple containers, this applies to all tasks.

Return type :

dict

Module contents

Package to build the ECS Service Definition

class ecs_composex.ecs.ecs_service. EcsService ( family ) [source]

Bases: object

Class representing the service from the Docker compose file and translate it into AWS ECS Task Definition and Service.

Variables :
  • links ( list ) – the links used for DependsOn of the service stack

  • dependencies ( list ) – list of services used for the DependsOn of the service stack

  • config ( ServiceConfig ) – The service configuration

  • task_definition ( troposphere.ecs.TaskDefinition ) – The service task definition for ECS

  • eips ( list<troposphere.ec2.EIP> ) – list of AWS EC2 EIPs which are used for the public NLB

  • service_attrs ( dict ) – Attributes defined to expand the troposphere.ecs.ServiceDefinition from prior settings.

generate_service_definition ( family ) [source]

Function to generate the Service definition. This is the last step in defining the service, after all other settings have been prepared.

Parameters :
Return type :

None