Skip to content

create_ipam_routing_policy_registration async

create_ipam_routing_policy_registration(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_internet_registry_association_id: Optional[
        IpamInternetRegistryAssociationId
    ] = None,
    cidr: Optional[String] = None,
    asns: Optional[AsnList] = None,
    permit_more_specific_announcements: Optional[BoxedBoolean] = None,
    max_length: Optional[IpamRoutingPolicyRegistrationMaxLength] = None,
    description: Optional[String] = None,
    force: Optional[BoxedBoolean] = None,
    client_token: Optional[String] = None,
) -> CreateIpamRoutingPolicyRegistrationResult

Creates a routing policy registration and publishes Route Origin Authorizations (ROAs) to the RPKI for the specified CIDR prefix and ASNs.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the operation, 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.

  • ipam_internet_registry_association_id (Optional[IpamInternetRegistryAssociationId], default: None ) –

    The ID of the IPAM internet registry association.

  • cidr (Optional[String], default: None ) –

    The IP address prefix in CIDR notation to authorize in the ROA.

  • asns (Optional[AsnList], default: None ) –

    The Autonomous System Numbers (ASNs) authorized to originate the prefix.

  • permit_more_specific_announcements (Optional[BoxedBoolean], default: None ) –

    Specifies whether to permit more specific route announcements than the CIDR prefix. When enabled, ASNs can announce sub-prefixes of the authorized CIDR up to the specified maximum length. Default: false.

  • max_length (Optional[IpamRoutingPolicyRegistrationMaxLength], default: None ) –

    The maximum prefix length that the ASNs are authorized to announce. Must be greater than or equal to the prefix length of the CIDR. If not specified, defaults to the prefix length of the CIDR (exact match only).

  • description (Optional[String], default: None ) –

    A description for the routing policy registration.

  • force (Optional[BoxedBoolean], default: None ) –

    Forces the creation of the routing policy registration even if it conflicts with an announced route. Default: false.

  • client_token (Optional[String], default: None ) –

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the operation ignores the request, but does not return an error.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_ipam_routing_policy_registration(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_internet_registry_association_id: Optional[
        "capo_ec2.types.ipam_internet_registry_association_id.IpamInternetRegistryAssociationId"
    ] = None,
    cidr: Optional["capo_ec2.types.string.String"] = None,
    asns: Optional["capo_ec2.types.asn_list.AsnList"] = None,
    permit_more_specific_announcements: Optional[
        "capo_ec2.types.boxed_boolean.BoxedBoolean"
    ] = None,
    max_length: Optional[
        "capo_ec2.types.ipam_routing_policy_registration_max_length.IpamRoutingPolicyRegistrationMaxLength"
    ] = None,
    description: Optional["capo_ec2.types.string.String"] = None,
    force: Optional["capo_ec2.types.boxed_boolean.BoxedBoolean"] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.create_ipam_routing_policy_registration_result.CreateIpamRoutingPolicyRegistrationResult":
    """<p>Creates a routing policy registration and publishes Route Origin Authorizations (ROAs) to the RPKI for the specified CIDR prefix and ASNs.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        ipam_internet_registry_association_id: <p>The ID of the IPAM internet registry association.</p>
        cidr: <p>The IP address prefix in CIDR notation to authorize in the ROA.</p>
        asns: <p>The Autonomous System Numbers (ASNs) authorized to originate the prefix.</p>
        permit_more_specific_announcements: <p>Specifies whether to permit more specific route announcements than the CIDR prefix. When enabled, ASNs can announce sub-prefixes of the authorized CIDR up to the specified maximum length. Default: <code>false</code>.</p>
        max_length: <p>The maximum prefix length that the ASNs are authorized to announce. Must be greater than or equal to the prefix length of the CIDR. If not specified, defaults to the prefix length of the CIDR (exact match only).</p>
        description: <p>A description for the routing policy registration.</p>
        force: <p>Forces the creation of the routing policy registration even if it conflicts with an announced route. Default: <code>false</code>.</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the operation ignores the request, but does not return an error.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.create_ipam_routing_policy_registration_request.CreateIpamRoutingPolicyRegistrationRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_ipam_routing_policy_registration_result.CreateIpamRoutingPolicyRegistrationResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_ipam_routing_policy_registration

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.create_ipam_routing_policy_registration.async_create_ipam_routing_policy_registration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateIpamRoutingPolicyRegistration")
    )
    input_: capo_ec2.types.create_ipam_routing_policy_registration_request.CreateIpamRoutingPolicyRegistrationRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_internet_registry_association_id is not None:
        input_["ipam_internet_registry_association_id"] = (
            ipam_internet_registry_association_id
        )
    if cidr is not None:
        input_["cidr"] = cidr
    if asns is not None:
        input_["asns"] = asns
    if permit_more_specific_announcements is not None:
        input_["permit_more_specific_announcements"] = (
            permit_more_specific_announcements
        )
    if max_length is not None:
        input_["max_length"] = max_length
    if description is not None:
        input_["description"] = description
    if force is not None:
        input_["force"] = force
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output