:doc:`EC2 <../../ec2>` / Client / associate_ipam_byoasn

*********************
associate_ipam_byoasn
*********************



.. py:method:: EC2.Client.associate_ipam_byoasn(**kwargs)

  

  Associates your Autonomous System Number (ASN) with a BYOIP CIDR that you own in the same Amazon Web Services Region. For more information, see `Tutorial\: Bring your ASN to IPAM <https://docs.aws.amazon.com/vpc/latest/ipam/tutorials-byoasn.html>`__ in the *Amazon VPC IPAM guide*.

   

  After the association succeeds, the ASN is eligible for advertisement. You can view the association with `DescribeByoipCidrs <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeByoipCidrs.html>`__. You can advertise the CIDR with `AdvertiseByoipCidr <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AdvertiseByoipCidr.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIpamByoasn>`_  


  **Request Syntax**
  ::

    response = client.associate_ipam_byoasn(
        DryRun=True|False,
        Asn='string',
        Cidr='string'
    )
    
  :type DryRun: boolean
  :param DryRun: 

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is ``DryRunOperation``. Otherwise, it is ``UnauthorizedOperation``.

    

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

    A public 2-byte or 4-byte ASN.

    

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

    The BYOIP CIDR you want to associate with an ASN.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'AsnAssociation': {
              'Asn': 'string',
              'Cidr': 'string',
              'StatusMessage': 'string',
              'State': 'disassociated'|'failed-disassociation'|'failed-association'|'pending-disassociation'|'pending-association'|'associated'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **AsnAssociation** *(dict) --* 

        The ASN and BYOIP CIDR association.

        
        

        - **Asn** *(string) --* 

          The association's ASN.

          
        

        - **Cidr** *(string) --* 

          The association's CIDR.

          
        

        - **StatusMessage** *(string) --* 

          The association's status message.

          
        

        - **State** *(string) --* 

          The association's state.

          
    
  