Skip to content

create_ipam_prefix_list_resolver_target

create_ipam_prefix_list_resolver_target(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_prefix_list_resolver_id: Optional[IpamPrefixListResolverId] = None,
    prefix_list_id: Optional[String] = None,
    prefix_list_region: Optional[String] = None,
    desired_version: Optional[BoxedLong] = None,
    track_latest_version: Optional[Boolean] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    client_token: Optional[String] = None,
) -> CreateIpamPrefixListResolverTargetResult

Creates an IPAM prefix list resolver target.

An IPAM prefix list resolver target is an association between a specific customer-managed prefix list and an IPAM prefix list resolver. The target enables the resolver to synchronize CIDRs selected by its rules into the specified prefix list, which can then be referenced in Amazon Web Services resources.

For more information about IPAM prefix list resolver, see Automate prefix list updates with IPAM in the Amazon VPC IPAM User Guide.

Parameters:

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

    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.

  • ipam_prefix_list_resolver_id (Optional[IpamPrefixListResolverId], default: None ) –

    The ID of the IPAM prefix list resolver that will manage the synchronization of CIDRs to the target prefix list.

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

    The ID of the managed prefix list that will be synchronized with CIDRs selected by the IPAM prefix list resolver. This prefix list becomes an IPAM managed prefix list.

    An IPAM-managed prefix list is a customer-managed prefix list that has been associated with an IPAM prefix list resolver target. When a prefix list becomes IPAM managed, its CIDRs are automatically synchronized based on the IPAM prefix list resolver's CIDR selection rules, and direct CIDR modifications are restricted.

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

    The Amazon Web Services Region where the prefix list is located. This is required when referencing a prefix list in a different Region.

  • desired_version (Optional[BoxedLong], default: None ) –

    The specific version of the prefix list to target. If not specified, the resolver will target the latest version.

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

    Indicates whether the resolver target should automatically track the latest version of the prefix list. When enabled, the target will always synchronize with the most current version of the prefix list.

    Choose this for automatic updates when you want your prefix lists to stay current with infrastructure changes without manual intervention.

  • tag_specifications (Optional[TagSpecificationList], default: None ) –

    The tags to apply to the IPAM prefix list resolver target during creation. Tags help you organize and manage your Amazon Web Services resources.

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensuring idempotency.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def create_ipam_prefix_list_resolver_target(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_prefix_list_resolver_id: Optional[
        "capo_ec2.types.ipam_prefix_list_resolver_id.IpamPrefixListResolverId"
    ] = None,
    prefix_list_id: Optional["capo_ec2.types.string.String"] = None,
    prefix_list_region: Optional["capo_ec2.types.string.String"] = None,
    desired_version: Optional["capo_ec2.types.boxed_long.BoxedLong"] = None,
    track_latest_version: Optional["capo_ec2.types.boolean.Boolean"] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.create_ipam_prefix_list_resolver_target_result.CreateIpamPrefixListResolverTargetResult":
    """<p>Creates an IPAM prefix list resolver target.</p> <p>An IPAM prefix list resolver target is an association between a specific customer-managed prefix list and an IPAM prefix list resolver. The target enables the resolver to synchronize CIDRs selected by its rules into the specified prefix list, which can then be referenced in Amazon Web Services resources.</p> <p>For more information about IPAM prefix list resolver, see <a href="https://docs.aws.amazon.com/vpc/latest/ipam/automate-prefix-list-updates.html">Automate prefix list updates with IPAM</a> in the <i>Amazon VPC IPAM User Guide</i>.</p>

    Args:
        dry_run: <p>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 <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        ipam_prefix_list_resolver_id: <p>The ID of the IPAM prefix list resolver that will manage the synchronization of CIDRs to the target prefix list.</p>
        prefix_list_id: <p>The ID of the managed prefix list that will be synchronized with CIDRs selected by the IPAM prefix list resolver. This prefix list becomes an IPAM managed prefix list.</p> <p>An IPAM-managed prefix list is a customer-managed prefix list that has been associated with an IPAM prefix list resolver target. When a prefix list becomes IPAM managed, its CIDRs are automatically synchronized based on the IPAM prefix list resolver's CIDR selection rules, and direct CIDR modifications are restricted.</p>
        prefix_list_region: <p>The Amazon Web Services Region where the prefix list is located. This is required when referencing a prefix list in a different Region.</p>
        desired_version: <p>The specific version of the prefix list to target. If not specified, the resolver will target the latest version.</p>
        track_latest_version: <p>Indicates whether the resolver target should automatically track the latest version of the prefix list. When enabled, the target will always synchronize with the most current version of the prefix list.</p> <p>Choose this for automatic updates when you want your prefix lists to stay current with infrastructure changes without manual intervention.</p>
        tag_specifications: <p>The tags to apply to the IPAM prefix list resolver target during creation. Tags help you organize and manage your Amazon Web Services resources.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">Ensuring idempotency</a>.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.create_ipam_prefix_list_resolver_target_request.CreateIpamPrefixListResolverTargetRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.create_ipam_prefix_list_resolver_target_result.CreateIpamPrefixListResolverTargetResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_ipam_prefix_list_resolver_target

        output, http_response = (
            capo_ec2._operations.amazon_ec2.create_ipam_prefix_list_resolver_target.create_ipam_prefix_list_resolver_target(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateIpamPrefixListResolverTarget")
    )
    input_: capo_ec2.types.create_ipam_prefix_list_resolver_target_request.CreateIpamPrefixListResolverTargetRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_prefix_list_resolver_id is not None:
        input_["ipam_prefix_list_resolver_id"] = ipam_prefix_list_resolver_id
    if prefix_list_id is not None:
        input_["prefix_list_id"] = prefix_list_id
    if prefix_list_region is not None:
        input_["prefix_list_region"] = prefix_list_region
    if desired_version is not None:
        input_["desired_version"] = desired_version
    if track_latest_version is not None:
        input_["track_latest_version"] = track_latest_version
    if tag_specifications is not None:
        input_["tag_specifications"] = tag_specifications
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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