ecs_composex.dns package

Submodules

ecs_composex.dns.dns_conditions module

ecs_composex.dns.dns_lookup module

ecs_composex.dns.dns_lookup. filter_out_cloudmap_zones ( zones , zone_name ) [source]

Function to filter out the Hosted Zones linked to CloudMap

Parameters

zones ( list ) –

Returns

The only valid zone

Return type

dict

ecs_composex.dns.dns_lookup. get_all_dns_namespaces ( session , namespaces = None , next_token = None ) [source]

Function to recursively fetch all namespaces in account

Parameters
  • namespaces ( list ) –

  • session ( boto3.session.Session ) –

  • next_token ( str ) –

Returns

ecs_composex.dns.dns_lookup. lookup_namespace ( zone , session ) [source]

Function to find the namespace infos

Parameters
Returns

ecs_composex.dns.dns_lookup. lookup_route53_namespace ( zone , session , private ) [source]
ecs_composex.dns.dns_lookup. lookup_service_discovery_namespace ( zone , session , private ) [source]
ecs_composex.dns.dns_lookup. validate_zone_id_input ( zone_id ) [source]

Function to validate the ZoneID is conform to expectations

Parameters

zone_id ( str ) –

Returns

True/False

Return type

str

ecs_composex.dns.dns_params module

Module for DNS parameters

ecs_composex.dns.dns_records module

Module to handle creation of the DNS records for specific targets

class ecs_composex.dns.dns_records. DnsRecords ( settings ) [source]

Bases: object

associate_records_to_resources ( settings , root_stack , dns_settings ) [source]
main_key = 'Records'
class ecs_composex.dns.dns_records. Record ( definition ) [source]

Bases: object

Class to represent a DNS record

alias_target_types = ['x-elbv2', 'x-s3']
alias_targets = [('elbv2', <function handle_elbv2_target>), ('s3', None)]
allowed_keys = [('Properties', <class 'dict'>), ('Target', <class 'str'>), ('Names', <class 'list'>)]
map_record_to_target ( settings , root_stack , dns_settings ) [source]

Method to go and identify the target resource

Parameters
Returns

validate_names ( ) [source]
ecs_composex.dns.dns_records. define_external_record_set ( properties ) [source]

Function to define a record set without any targets in ComposeX

Parameters

properties

Returns

ecs_composex.dns.dns_records. handle_elbv2_target ( record , elbv2 , settings , root_stack , dns_settings ) [source]

Function to define the TargetAlias properties for the record from an ELBv2

Parameters
Returns

Module contents

Package for x-dns

class ecs_composex.dns. DnsSettings ( root_stack , settings , vpc ) [source]

Bases: object

Class to ingest the x-dns settings

associate_settings_to_nested_stacks ( root_stack ) [source]

Method to apply the public and private zone parameters to nested stacks if they needed it.

Parameters

root_stack ( ecs_composex.common.stacks.ComposeXStack ) –

Returns

default_private_name = 'cluster.internal'
main_key = 'x-dns'
private_namespace_key = 'PrivateNamespace'
public_namespace_key = 'PublicNamespace'
public_zone_key = 'PublicZone'
supported_keys = ['PrivateNamespace', 'PublicNamespace']
class ecs_composex.dns. DnsZone ( definition ) [source]

Bases: object

Class to represent a zone

key = None
nested_id_parameter = None
nested_name_parameter = None
set_zone_default ( ) [source]
set_zone_from_lookup ( settings ) [source]
set_zone_from_use ( ) [source]

Method to create the CFN Mapping for Use on DNS Zone. :return:

setup ( settings ) [source]
update_nested_stack_parameters ( nested_stack ) [source]

Method to updated a nested stack parameters to point to the right value for DNS Settings.

Parameters

nested_stack ( ecs_composex.common.stacks.ComposeXStack ) –

Returns

class ecs_composex.dns. PrivateNamespace ( definition ) [source]

Bases: ecs_composex.dns.DnsZone

Class to handle the private DNS Namespace associated with the VPC used for Service discovery

add_zone ( template , vpc ) [source]
key = 'PrivateNamespace'
nested_id_parameter = <ecs_composex.common.cfn_params.Parameter object>
nested_name_parameter = <ecs_composex.common.cfn_params.Parameter object>
zone_id_parameter = <ecs_composex.common.cfn_params.Parameter object>
class ecs_composex.dns. PublicZone ( definition ) [source]

Bases: ecs_composex.dns.DnsZone

Class to represent the Public DNS Zone used for inbound. This is a Route53 DNS Zone.

add_zone ( template ) [source]
key = 'PublicZone'
nested_id_parameter = <ecs_composex.common.cfn_params.Parameter object>
nested_name_parameter = <ecs_composex.common.cfn_params.Parameter object>