Skip to content

create_anycast_ip_list

create_anycast_ip_list(
    name: AnycastIpListName,
    ip_count: integer,
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    tags: Optional[Tags] = None,
    ip_address_type: Optional[IpAddressType] = None,
    ipam_cidr_configs: Optional[IpamCidrConfigList] = None,
) -> CreateAnycastIpListResult

Creates an Anycast static IP list.

Parameters:

  • name (AnycastIpListName) –

    Name of the Anycast static IP list.

  • ip_count (integer) –

    The number of static IP addresses that are allocated to the Anycast static IP list. Valid values: 21 or 3.

  • ip_address_type (Optional[IpAddressType], default: None ) –

    The IP address type for the Anycast static IP list. You can specify one of the following options:

    • ipv4 only

    • ipv6 only

    • dualstack - Allocate a list of both IPv4 and IPv6 addresses

  • ipam_cidr_configs (Optional[IpamCidrConfigList], default: None ) –

    A list of IPAM CIDR configurations that specify the IP address ranges and IPAM pool settings for creating the Anycast static IP list.

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def create_anycast_ip_list(
    self,
    name: "capo_cloudfront.types.anycast_ip_list_name.AnycastIpListName",
    ip_count: "capo_cloudfront.types.integer.integer",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = None,
    tags: Optional["capo_cloudfront.types.tags.Tags"] = None,
    ip_address_type: Optional[
        "capo_cloudfront.types.ip_address_type.IpAddressType"
    ] = None,
    ipam_cidr_configs: Optional[
        "capo_cloudfront.types.ipam_cidr_config_list.IpamCidrConfigList"
    ] = None,
) -> (
    "capo_cloudfront.types.create_anycast_ip_list_result.CreateAnycastIpListResult"
):
    """<p>Creates an Anycast static IP list.</p>

    Args:
        name: <p>Name of the Anycast static IP list.</p>
        ip_count: <p>The number of static IP addresses that are allocated to the Anycast static IP list. Valid values: 21 or 3.</p>
        ip_address_type: <p>The IP address type for the Anycast static IP list. You can specify one of the following options:</p> <ul> <li> <p> <code>ipv4</code> only</p> </li> <li> <p> <code>ipv6</code> only </p> </li> <li> <p> <code>dualstack</code> - Allocate a list of both IPv4 and IPv6 addresses</p> </li> </ul>
        ipam_cidr_configs: <p> A list of IPAM CIDR configurations that specify the IP address ranges and IPAM pool settings for creating the Anycast static IP list. </p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.entity_already_exists.EntityAlreadyExists: <p>The entity already exists. You must provide a unique entity.</p>
        capo_cloudfront.errors.entity_limit_exceeded.EntityLimitExceeded: <p>The entity limit has been exceeded.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_tagging.InvalidTagging: <p>The tagging specified is not valid.</p>
        capo_cloudfront.errors.unsupported_operation.UnsupportedOperation: <p>This operation is not supported in this Amazon Web Services Region.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.create_anycast_ip_list_request.CreateAnycastIpListRequest]",
    ) -> OperationResponse[
        "capo_cloudfront.types.create_anycast_ip_list_result.CreateAnycastIpListResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.create_anycast_ip_list

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.create_anycast_ip_list.create_anycast_ip_list(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAnycastIpList")
    )
    input_: capo_cloudfront.types.create_anycast_ip_list_request.CreateAnycastIpListRequest = {
        "name": name,
        "ip_count": ip_count,
    }
    if tags is not None:
        input_["tags"] = tags
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type
    if ipam_cidr_configs is not None:
        input_["ipam_cidr_configs"] = ipam_cidr_configs

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output