Skip to content

associate_ipam_resource_discovery

associate_ipam_resource_discovery(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    ipam_id: Optional[IpamId] = None,
    ipam_resource_discovery_id: Optional[IpamResourceDiscoveryId] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    client_token: Optional[String] = None,
) -> AssociateIpamResourceDiscoveryResult

Associates an IPAM resource discovery with an Amazon VPC IPAM. A resource discovery is an IPAM component that enables IPAM to manage and monitor resources that belong to the owning account.

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_id (Optional[IpamId], default: None ) –

    An IPAM ID.

  • ipam_resource_discovery_id (Optional[IpamResourceDiscoveryId], default: None ) –

    A resource discovery ID.

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

    Tag specifications.

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

    A client token.

Raises:

Source code in docs_src/capo_ec2/_services/ec2.py
def associate_ipam_resource_discovery(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    ipam_id: Optional["capo_ec2.types.ipam_id.IpamId"] = None,
    ipam_resource_discovery_id: Optional[
        "capo_ec2.types.ipam_resource_discovery_id.IpamResourceDiscoveryId"
    ] = None,
    tag_specifications: Optional[
        "capo_ec2.types.tag_specification_list.TagSpecificationList"
    ] = None,
    client_token: Optional["capo_ec2.types.string.String"] = None,
) -> "capo_ec2.types.associate_ipam_resource_discovery_result.AssociateIpamResourceDiscoveryResult":
    """<p>Associates an IPAM resource discovery with an Amazon VPC IPAM. A resource discovery is an IPAM component that enables IPAM to manage and monitor resources that belong to the owning account.</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_id: <p>An IPAM ID.</p>
        ipam_resource_discovery_id: <p>A resource discovery ID.</p>
        tag_specifications: <p>Tag specifications.</p>
        client_token: <p>A client token.</p>

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

    def _handler(
        req: "OperationRequest[capo_ec2.types.associate_ipam_resource_discovery_request.AssociateIpamResourceDiscoveryRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.associate_ipam_resource_discovery_result.AssociateIpamResourceDiscoveryResult"
    ]:
        import capo_ec2._operations.amazon_ec2.associate_ipam_resource_discovery

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateIpamResourceDiscovery")
    )
    input_: capo_ec2.types.associate_ipam_resource_discovery_request.AssociateIpamResourceDiscoveryRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if ipam_id is not None:
        input_["ipam_id"] = ipam_id
    if ipam_resource_discovery_id is not None:
        input_["ipam_resource_discovery_id"] = ipam_resource_discovery_id
    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