pcf.particle.aws.route53 package

Submodules

pcf.particle.aws.route53.route53_hosted_zone module

class pcf.particle.aws.route53.hosted_zone.HostedZone(particle_definition, session=None)

Bases: pcf.core.aws_resource.AWSResource

Particle that maps to AWS hosted zone

START_PARAM_FILER = {'CallerReference', 'DelegationSetId', 'HostedZoneConfig', 'Name', 'VPC'}
UNIQUE_KEYS = ['aws_resource.Name']
_set_unique_keys()

Logic that sets keys from state definition that are used to uniquely identify the Route53 Hosted Zone

_start()

Creates a Route53 Hosted Zone using boto3 create_hosted_zone :returns: boto3 response :rtype: hosted_zone

_stop()

Calls _terminate

_terminate()

Deletes a Route53 Hosted Zone using boto3 delete_hosted_zone :returns: boto3 response

_update()

Removes existing tags and adds new tags using boto3 change_tags_for_resource and list_tags_for_resource

equivalent_states = {<State.running: 1>: 1, <State.stopped: 2>: 0, <State.terminated: 3>: 0}
flavor = 'route53_hosted_zone'
get_status()

Get the current definition of the route 53 hosted zone :returns: current definition of the hosted zone

is_state_definition_equivalent()

This class is only concerned with changes to tags since there is a separate particle for record sets :returns: True :rtype: bool

is_state_equivalent(state1, state2)

Determines if states are equivalent :param state1: first state :type state1: state :param state2: second state :type state2: state

Returns:whether the two states are equivalent
Return type:bool
sync_state()

Sync state calls get_status to determines and set the state of the hosted zone

pcf.particle.aws.route53.route53_record module

class pcf.particle.aws.route53.route53_record.Route53Record(particle_definition, session=None)

Bases: pcf.core.aws_resource.AWSResource

Particle that maps to AWS route53 record set. Before using this particle make sure that you have created a hosted zone in AWS.

Required Parameters:

Parameters:
  • Name (string) – the name of your record set
  • HostedZoneId (string) – the hosted zone you want you record set to be in
  • ResourceRecords (object list) – list of your resource records
  • Type (string) – type of your resource records
REMOVE_PARAM_CONVERSIONS = {'HostedZoneId': ''}
UNIQUE_KEYS = ['aws_resource.Name']
_set_unique_keys()

Logic that sets keys from state definition that are used to uniquely identify the Route53 Record

_start()

Creates the route53 record set that matches current state definition

Returns:response of boto3 change resource record set with action CREATE
_stop()

Route53 record set does not have a stopped state so it calls terminate :return: terminate()

_terminate()

Deletes the route53 record set that matches current state definition

Returns:response of boto3 change resource record set with action DELETE
_update()

Updates the route53 record set that matches current state definition

Returns:response of boto3 change resource record set with action UPSERT
equivalent_states = {<State.running: 1>: 1, <State.stopped: 2>: 0, <State.terminated: 3>: 0}
flavor = 'route53_record'
get_desired_state_definition()

Returns the desires state definition. If Route53 Record has parents that are EC2 instances then ip addresses of those instances are automatically added to the resource_records in the desired state definition.

Returns:desired_state_definition
get_status()

Get the current status of your route 53 record set

Returns:list of record sets sorted by record name
is_state_definition_equivalent()

Determines if the current state definition matches the current state definition. Uses keep and remove function from pcf util to remove extra params in desired state that are not in the current state.

Returns:bool
is_state_equivalent(state1, state2)

Determines if states are equivalent :param state1: :param state2: :type: state1: State :type: state2: State

Returns:bool
sync_state()

Sync state calls get_status to determines and set the state of the route53 record set particle.

Module contents