ecs_composex.sns package

Submodules

ecs_composex.sns.sns_aws module

Module to find the SQS topics in lookup

ecs_composex.sns.sns_aws. get_topic_config ( logical_name , topic_arn , session ) [source]

Function to create the mapping definition for SNS topics

Parameters
  • logical_name ( str ) – The logical name of the resource

  • topic_arn ( str ) –

  • session ( boto3.session.Session ) –

Returns

ecs_composex.sns.sns_aws. lookup_topic_config ( logical_name , lookup , session ) [source]

Function to find the DB in AWS account

Parameters
  • logical_name ( str ) – The logical name of the resource

  • lookup ( dict ) – The Lookup definition for DB

  • session ( boto3.session.Session ) – Boto3 session for clients

Returns

ecs_composex.sns.sns_ecs module

Module to apply SNS settings onto ECS Services

ecs_composex.sns.sns_ecs. sns_to_ecs ( resources , services_stack , res_root_stack , settings ) [source]

Function to apply SQS settings to ECS Services :return:

ecs_composex.sns.sns_params module

ecs_composex.sns.sns_perms module

Module to handle ECS services access.

ecs_composex.sns.sns_stack module

class ecs_composex.sns.sns_stack. Subscription ( name , definition , module_name , settings , mapping_key = None ) [source]

Bases: ecs_composex.common.compose_resources.XResource

Class for SNS Subscriptions

keyword = 'Subscriptions'
class ecs_composex.sns.sns_stack. Topic ( name , definition , module_name , settings , mapping_key = None ) [source]

Bases: ecs_composex.common.compose_resources.XResource

Class for SNS Topics

init_outputs ( ) [source]
keyword = 'Topics'
policies_scaffolds = {'Publish': {'Action': ['sns:Publish'], 'Effect': 'Allow'}}
class ecs_composex.sns.sns_stack. XStack ( title , settings , ** kwargs ) [source]

Bases: ecs_composex.common.stacks.ComposeXStack

Class to handle SQS Root stack related actions

add_xdependencies ( root_stack , settings ) [source]

Method to add a dependencies from other X-Resources :param ComposeXStack root_stack: The ComposeX Root template :param ecs_composex.common.ComposeXSettings settings:

handle_sqs ( root_template , sqs_root_stack ) [source]

Function to handle the SQS configuration to allow SNS to send messages to queues.

ecs_composex.sns.sns_stack. create_sns_mappings ( resources , settings ) [source]

ecs_composex.sns.sns_templates module

Module to add topics and subscriptions to the SNS stack

ecs_composex.sns.sns_templates. add_sns_topics ( root_template , new_topics , content ) [source]

Function to add SNS topics to the root template

Parameters
  • root_template ( troposphere.Template ) –

  • content ( dict ) –

Returns

ecs_composex.sns.sns_templates. add_topics_to_template ( template , topics , content ) [source]

Function to interate over the topics and add them to the CFN Template

Parameters
  • template ( troposphere.Template ) –

  • topics ( dict ) –

  • content ( dict ) – Content of the compose file

ecs_composex.sns.sns_templates. check_queue_exists ( queue_name , content ) [source]

Function to check

Parameters
  • queue_name ( str ) – Name of the queue defined in the subscription

  • content ( dict ) – docker compose file content

Returns

ecs_composex.sns.sns_templates. define_resources ( res_content ) [source]

Function to determine how many resources are going to be created. :return:

ecs_composex.sns.sns_templates. define_topic ( topic , content ) [source]

Function that builds the SNS topic template from cli.Dockerfile Properties

Parameters

topic ( ecs_composex.sns.sns_stack.Topic ) – The topic and its definition

ecs_composex.sns.sns_templates. define_topic_subscriptions ( subscriptions , content ) [source]

Function to define an SNS topic subscriptions

Parameters
  • subscriptions ( list ) – list of subscriptions as defined in the docker compose file

  • content ( dict ) – docker compose file content

Returns

ecs_composex.sns.sns_templates. generate_sns_templates ( settings , new_topics , new_subscriptions , xstack , root_template ) [source]

Entrypoint function to generate the SNS topics templates

Parameters

settings ( ecs_composex.common.settings.ComposeXSettings ) –

Returns

ecs_composex.sns.sns_templates. set_sqs_topic ( subscription , content ) [source]

Function to set permissions and import for SQS subscription :return:

Module contents