ecs_composex.ecs.ecs_family.family_helpers package

Submodules

ecs_composex.ecs.ecs_family.family_helpers.compute_finalizers module

Functions to finalize the family compute & scaling settings

ecs_composex.ecs.ecs_family.family_helpers.compute_finalizers. finalize_family_compute ( family ) [source]

Finalizes the family compute settings

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers.compute_finalizers. finalize_scaling_settings ( family ) [source]

If family has scaling target configured, ensures that the scalable target gets created.

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers.network_finalizers module

Functions to finalize the family networking settings

ecs_composex.ecs.ecs_family.family_helpers.network_finalizers. finalize_lb_settings ( family ) [source]

Ensures that the LoadBalancers & ServiceRegistries (LB & CloudMap) are set appropriately based on the deployment settings. Especially, resets properties if the service is deployed to ECS Anywhere. Ensures correctness of LinuxParameters for each of the services.

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers.network_finalizers. finalize_network_settings ( family , settings ) [source]

Evaluates the ECS Connect settings to be configured by the service. If there is a configuration to be set, ensures it’s set on the ECS Service definition.

Return type :

None

Module contents

ecs_composex.ecs.ecs_family.family_helpers. assign_policy_to_role ( role_secrets , role ) [source]

Function to assign the policy to role Policies :param list role_secrets: :param troposphere.iam.Role role: :rtype: None :return:

ecs_composex.ecs.ecs_family.family_helpers. assign_secrets_to_roles ( secrets , exec_role , task_role ) [source]

Function to assign secrets access policies to exec_role and/or task_role

Parameters :
  • secrets

  • exec_role ( troposphere.iam.Role ) –

  • task_role ( troposphere.iam.Role ) –

Return type :

None

Returns :

ecs_composex.ecs.ecs_family.family_helpers. ensure_essential_containers ( family ) [source]

Iterates over the services of the family, and ensures that containers.Essential is set appropriately according to the service requirements

Parameters :

family ( ecs_composex.ecs.ecs_family.ComposeFamily ) –

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. handle_same_task_services_dependencies ( services_config ) [source]

Function to define inter-tasks dependencies. It defines a priority value (service[0]) based on how many parents (i.e, they depend on the parents) they have. The lowest priority value are the first ones to have to start, the highest value is the last container to start.

Parameters :

services_config ( list [ list [ ] ] ) –

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. set_ecs_cluster_logging_access ( settings , policy , role_stack ) [source]

Based on ECS Cluster settings / configurations, grant permissions to specific resources for all functionalities to work.

Parameters :
Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. set_ecs_cluster_logging_cw_access ( settings , policy , role_stack ) [source]

Based on ECS Cluster settings / configurations, grant permissions to CW Log defined to log ECS Execute command feature

Parameters :
Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. set_ecs_cluster_logging_kms_access ( settings , policy , role_stack ) [source]

Based on ECS Cluster settings / configurations, grant permissions to KMS key encrypting Log defined to log ECS Execute command feature

Parameters :
ecs_composex.ecs.ecs_family.family_helpers. set_ecs_cluster_logging_s3_access ( settings , policy , role_stack ) [source]

Based on ECS Cluster settings / configurations, grant permissions to put logs to S3 Bucket for logs defined to log ECS Execute command feature

Parameters :
ecs_composex.ecs.ecs_family.family_helpers. set_service_dependency_on_all_iam_policies ( family ) [source]

Function to ensure the Service does not get created/updated before all IAM policies were set completely

Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. swap_environment_value_with_parameter ( family , service ) [source]
Return type :

None

ecs_composex.ecs.ecs_family.family_helpers. update_env_var_to_parameter ( family , service , env_var , set_as_params ) [source]

Function that will replace a user-defined environment variable with a Template Parameter If the SetAsParameter is a list, goes through them and generates the CFN Parameter properties If SetAsParameter is a dict, it will import the user-defined Parameter settings.

Return type :

None