resource_record#

State module for managing Route53 Resource records.

async idem_aws.states.aws.route53.resource_record.present(hub, ctx, name: str, hosted_zone_id: str, record_type: str, resource_records: List[str] = None, alias_target: Dict = None, resource_id: str = None, ttl: int = None) Dict[str, Any][source]#

Creates or changes a resource record set, which contains authoritative DNS information for a specified domain name or subdomain name.

Parameters:
  • name (str) – The name of the record. A (.) will be appended if not already present.

  • hosted_zone_id (str) – The ID of the hosted zone that contains the resource record sets.

  • record_type (str) – The DNS record type. For information about different record types and how data is encoded for them, see Supported DNS Resource Record Types https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html in the Amazon Route 53 Developer Guide.

  • resource_records (list, Optional) – Information about the resource records to act upon.

  • alias_target (dict, Optional) – Alias resource record sets only: Information about the Amazon Web Services resource, such as a CloudFront distribution or an Amazon S3 bucket, that you want to route traffic to.

  • resource_id (str, Optional) – Composite ID for a resource record in a hosted zone. String formatted as <hosted_zone_id>_<record_name>_<record_type>.

  • ttl (int, Optional) – The resource record cache time to live (TTL), in seconds.

Returns:

Dict[str, Any]

Examples

KL1PX9DBMUY9WHB_www.example.com_AAAA:
  aws.route53.resource_record.present:
    - hosted_zone_id: /hostedzone/KL1PX9DBMUY9WHB
    - name: www.example.com.
    - record_type: AAAA
    - resource_records:
        - 2001:0db8:85a3:0:0:8a2e:0370:7335
        - 2001:0db8:85a3:0:0:8a2e:0370:7334
    - ttl: 300

ZY51FUS5VYB_www.example.net_A:
  aws.route53.resource_record.present:
    - alias_target:
        dns_name: lb1.us-east-1.elb.amazonaws.com.
        evaluate_target_health: false
        hosted_zone_id: Z35SXDOTRQ7X7Z
    - hosted_zone_id: /hostedzone/ZY51FUS5VYB
    - name: www.example.net.
    - record_type: A
    - resource_id: ZY51FUS5VYB_www.example.net_A
async idem_aws.states.aws.route53.resource_record.absent(hub, ctx, name: str, resource_id: str = None) Dict[str, Any][source]#

Deletes the specified resource record

Parameters:
  • name (str) – Name of the resource record. Needed because of the Idem contract but not used.

  • resource_id (str, Optional) – Composite ID for a resource record in a hosted zone. String formatted as <hosted_zone_id>_<record_name>_<record_type>.

Returns:

Dict[str, Any]

Examples

MX_record_is_absent:
  aws.route53.resource_record.absent:
    - name: www.example.com.
    - resource_id: HSHMRK8IGWBU3PU_www.example.com_MX
async idem_aws.states.aws.route53.resource_record.describe(hub, ctx) Dict[str, Dict[str, Any]][source]#

Describe the resource in a way that can be recreated/managed with the corresponding “present” function

Lists the resource record sets in a specified hosted zone.

Returns:

Dict[str, Any]

Examples

$ idem describe aws.route53.resource_record