:doc:`Route53 <../../route53>` / Client / create_traffic_policy

*********************
create_traffic_policy
*********************



.. py:method:: Route53.Client.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 <https://docs.aws.amazon.com/goto/WebAPI/route53-2013-04-01/CreateTrafficPolicy>`_  


  **Request Syntax**
  ::

    response = client.create_traffic_policy(
        Name='string',
        Document='string',
        Comment='string'
    )
    
  :type Name: string
  :param Name: **[REQUIRED]** 

    The name of the traffic policy.

    

  
  :type Document: string
  :param Document: **[REQUIRED]** 

    The definition of this traffic policy in JSON format. For more information, see `Traffic Policy Document Format <https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html>`__.

    

  
  :type Comment: string
  :param Comment: 

    (Optional) Any comments that you want to include about the traffic policy.

    

  
  
  :rtype: 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'|'TLSA'|'SSHFP'|'SVCB'|'HTTPS',
              '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 <https://docs.aws.amazon.com/Route53/latest/APIReference/api-policies-traffic-policy-document-format.html>`__.

          
        

        - **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**
  
  *   :py:class:`Route53.Client.exceptions.InvalidInput`

  
  *   :py:class:`Route53.Client.exceptions.TooManyTrafficPolicies`

  
  *   :py:class:`Route53.Client.exceptions.TrafficPolicyAlreadyExists`

  
  *   :py:class:`Route53.Client.exceptions.InvalidTrafficPolicyDocument`

  