Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

create_traffic_policy

create_traffic_policy(**kwargs)

Creates a traffic policy, which you use to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com).

See also: AWS API Documentation

Request Syntax

response = client.create_traffic_policy(
    Name='string',
    Document='string',
    Comment='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the traffic policy.

  • Document (string) --

    [REQUIRED]

    The definition of this traffic policy in JSON format. For more information, see Traffic Policy Document Format.

  • Comment (string) -- (Optional) Any comments that you want to include about the traffic policy.
Return type

dict

Returns

Response Syntax

{
    'TrafficPolicy': {
        'Id': 'string',
        'Version': 123,
        'Name': 'string',
        'Type': 'SOA'|'A'|'TXT'|'NS'|'CNAME'|'MX'|'NAPTR'|'PTR'|'SRV'|'SPF'|'AAAA'|'CAA'|'DS',
        'Document': 'string',
        'Comment': 'string'
    },
    'Location': 'string'
}

Response Structure

  • (dict) --

    A complex type that contains the response information for the CreateTrafficPolicy request.

    • TrafficPolicy (dict) --

      A complex type that contains settings for the new traffic policy.

      • Id (string) --

        The ID that Amazon Route 53 assigned to a traffic policy when you created it.

      • Version (integer) --

        The version number that Amazon Route 53 assigns to a traffic policy. For a new traffic policy, the value of Version is always 1.

      • Name (string) --

        The name that you specified when you created the traffic policy.

      • Type (string) --

        The DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.

      • Document (string) --

        The definition of a traffic policy in JSON format. You specify the JSON document to use for a new traffic policy in the CreateTrafficPolicy request. For more information about the JSON format, see Traffic Policy Document Format.

      • Comment (string) --

        The comment that you specify in the CreateTrafficPolicy request, if any.

    • Location (string) --

      A unique URL that represents a new traffic policy.

Exceptions

  • Route53.Client.exceptions.InvalidInput
  • Route53.Client.exceptions.TooManyTrafficPolicies
  • Route53.Client.exceptions.TrafficPolicyAlreadyExists
  • Route53.Client.exceptions.InvalidTrafficPolicyDocument