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

***********************
allocate_ipam_pool_cidr
***********************



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

  

  Allocate a CIDR from an IPAM pool. The Region you use should be the IPAM pool locale. The locale is the Amazon Web Services Region where this IPAM pool is available for allocations.

   

  In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM pool or to a resource. For more information, see `Allocate CIDRs <https://docs.aws.amazon.com/vpc/latest/ipam/allocate-cidrs-ipam.html>`__ in the *Amazon VPC IPAM User Guide*.

   

  .. note::

    

    This action creates an allocation with strong consistency. The returned CIDR will not overlap with any other allocations from the same pool.

    

  

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


  **Request Syntax**
  ::

    response = client.allocate_ipam_pool_cidr(
        DryRun=True|False,
        IpamPoolId='string',
        Cidr='string',
        NetmaskLength=123,
        ClientToken='string',
        Description='string',
        PreviewNextCidr=True|False,
        AllowedCidrs=[
            'string',
        ],
        DisallowedCidrs=[
            'string',
        ]
    )
    
  :type DryRun: boolean
  :param DryRun: 

    A check for 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 IpamPoolId: string
  :param IpamPoolId: **[REQUIRED]** 

    The ID of the IPAM pool from which you would like to allocate a CIDR.

    

  
  :type Cidr: string
  :param Cidr: 

    The CIDR you would like to allocate from the IPAM pool. Note the following:

     

    
    * If there is no DefaultNetmaskLength allocation rule set on the pool, you must specify either the NetmaskLength or the CIDR.
     
    * If the DefaultNetmaskLength allocation rule is set on the pool, you can specify either the NetmaskLength or the CIDR and the DefaultNetmaskLength allocation rule will be ignored.
    

     

    Possible values: Any available IPv4 or IPv6 CIDR.

    

  
  :type NetmaskLength: integer
  :param NetmaskLength: 

    The netmask length of the CIDR you would like to allocate from the IPAM pool. Note the following:

     

    
    * If there is no DefaultNetmaskLength allocation rule set on the pool, you must specify either the NetmaskLength or the CIDR.
     
    * If the DefaultNetmaskLength allocation rule is set on the pool, you can specify either the NetmaskLength or the CIDR and the DefaultNetmaskLength allocation rule will be ignored.
    

     

    Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.

    

  
  :type ClientToken: string
  :param ClientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see `Ensuring idempotency <https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html>`__.

    This field is autopopulated if not provided.

  
  :type Description: string
  :param Description: 

    A description for the allocation.

    

  
  :type PreviewNextCidr: boolean
  :param PreviewNextCidr: 

    A preview of the next available CIDR in a pool.

    

  
  :type AllowedCidrs: list
  :param AllowedCidrs: 

    Include a particular CIDR range that can be returned by the pool. Allowed CIDRs are only allowed if using netmask length for allocation.

    

  
    - *(string) --* 

    

  :type DisallowedCidrs: list
  :param DisallowedCidrs: 

    Exclude a particular CIDR range from being returned by the pool. Disallowed CIDRs are only allowed if using netmask length for allocation.

    

  
    - *(string) --* 

    

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

    
    ::

      {
          'IpamPoolAllocation': {
              'Cidr': 'string',
              'IpamPoolAllocationId': 'string',
              'Description': 'string',
              'ResourceId': 'string',
              'ResourceType': 'ipam-pool'|'vpc'|'ec2-public-ipv4-pool'|'custom'|'subnet'|'eip'|'anycast-ip-list',
              'ResourceRegion': 'string',
              'ResourceOwner': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **IpamPoolAllocation** *(dict) --* 

        Information about the allocation created.

        
        

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

          The CIDR for the allocation. A CIDR is a representation of an IP address and its associated network mask (or netmask) and refers to a range of IP addresses. An IPv4 CIDR example is ``10.24.34.0/23``. An IPv6 CIDR example is ``2001:DB8::/32``.

          
        

        - **IpamPoolAllocationId** *(string) --* 

          The ID of an allocation.

          
        

        - **Description** *(string) --* 

          A description of the pool allocation.

          
        

        - **ResourceId** *(string) --* 

          The ID of the resource.

          
        

        - **ResourceType** *(string) --* 

          The type of the resource.

          
        

        - **ResourceRegion** *(string) --* 

          The Amazon Web Services Region of the resource.

          
        

        - **ResourceOwner** *(string) --* 

          The owner of the resource.

          
    
  