ecs_composex.appmesh package ¶
Submodules ¶
ecs_composex.appmesh.appmesh_aws module ¶
Module to interact with AWS AppMesh API
ecs_composex.appmesh.appmesh_conditions module ¶
AppMesh related conditions
- ecs_composex.appmesh.appmesh_conditions. add_appmesh_conditions ( template ) [source] ¶
-
Function to add AppMesh default conditions to template
- Parameters :
-
template ( troposphere.Template ) – The template to add the conditions to
- ecs_composex.appmesh.appmesh_conditions. get_mesh_name ( mesh_obj ) [source] ¶
-
Function to return the mesh reference based on the type of parameter mesh_obj
- Returns :
-
ecs_composex.appmesh.appmesh_mesh module ¶
Main module for AppMesh.
Once all services have been deployed and their VirtualNodes are setup, we deploy the Mesh for it.
- class ecs_composex.appmesh.appmesh_mesh. Mesh ( mesh_definition , root_stack , settings ) [source] ¶
-
Bases:
object
Class for AppMesh mesh
- define_virtual_services ( settings ) [source] ¶
-
Method to parse the services and map them to nodes and routers.
- mesh_title = 'ServiceMesh' ¶
- nodes_key = 'Nodes' ¶
- render_mesh_template ( stack , settings ) [source] ¶
-
Method to create the AppMesh template stack.
- Parameters :
-
stack ( ComposeXStack ) – The services root stack
- required_keys = ['Nodes', 'Routers', 'Services'] ¶
- routers_key = 'Routers' ¶
- services_key = 'Services' ¶
ecs_composex.appmesh.appmesh_node module ¶
- class ecs_composex.appmesh.appmesh_node. MeshNode ( family , protocol , port , mesh , settings , backends = None ) [source] ¶
-
Bases:
object
Class representing an AppMesh Node.
- add_envoy_container_definition ( mesh , family ) [source] ¶
-
Method to expand the containers configuration and add the Envoy SideCar.
- create_ingress_rule ( root_stack , nodes ) [source] ¶
-
Creates EC2 ingress rules to allow all traffic from node to backends nodes SG.
- Parameters :
-
-
root_stack ( ecs_composex.common.stacks.ComposeXStack ) –
-
nodes ( list<ecs_composex.appmesh.appmesh_nodes.MeshNodes> ) – list of nodes
-
- create_service_virtual_node ( family , mesh , settings ) [source] ¶
-
Method to expand the service template with the AppMesh virtual node
- expand_backends ( mesh , root_stack , services ) [source] ¶
-
Method to set the backends to the service node.
- Parameters :
-
-
root_stack ( ecs_composex.ServicesStack ) – the root stack to put a dependency from.
-
services ( dict ) – the services in the mesh stack.
-
- set_node_weight ( weight ) [source] ¶
-
Method to set the weight of the service
- Parameters :
-
weight ( int ) –
- Returns :
-
- weight = 1 ¶
ecs_composex.appmesh.appmesh_params module ¶
AppMesh parameters
ecs_composex.appmesh.appmesh_router module ¶
Module to manage Routers specifically.
- class ecs_composex.appmesh.appmesh_router. MeshRouter ( name , definition , mesh , nodes ) [source] ¶
-
Bases:
object
Defines a router.
- handle_http_route ( routes , router , nodes , http2 = False ) [source] ¶
-
Function to create a HTTP or HTTP/2 route
- Parameters :
-
-
routes ( list ) – routes of HTTP or HTTP2 protocol
-
router ( troposphere.appmesh.VirtualRouter ) – The virtual router to attach the route to.
-
nodes ( dict ) – list of nodes.
-
http2 – whether it is http2
-
- Returns :
-
- handle_tcp_route ( routes , router , nodes ) [source] ¶
-
Function to create the TCP routes for the router
- Parameters :
-
-
routes ( list ) – routes of TCP protocol
-
router ( troposphere.appmesh.VirtualRouter ) – The virtual router to attach the route to.
-
nodes ( dict ) – Nodes in the mesh
-
- http_routes_keys = ['Match', 'Nodes'] ¶
- tcp_routes_keys = ['Nodes'] ¶
ecs_composex.appmesh.appmesh_service module ¶
Module to manage the AppMesh Virtual service
- class ecs_composex.appmesh.appmesh_service. MeshService ( name , definition , routers , nodes , mesh , settings ) [source] ¶
-
Bases:
object
Class to represent a mesh Virtual Service.
- add_dns_entries ( stack , settings ) [source] ¶
-
Method to add CloudMap service and record for DNS resolution.