Skip to content

create_ipam_resource_discovery async

create_ipam_resource_discovery(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    description: Optional[String] = None,
    operating_regions: Optional[AddIpamOperatingRegionSet] = None,
    tag_specifications: Optional[TagSpecificationList] = None,
    client_token: Optional[String] = None,
) -> CreateIpamResourceDiscoveryResult

Creates an IPAM resource discovery. 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.

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

    A description for the IPAM resource discovery.

  • operating_regions (Optional[AddIpamOperatingRegionSet], default: None ) –

    Operating Regions for the IPAM resource discovery. Operating Regions are Amazon Web Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only discovers and monitors resources in the Amazon Web Services Regions you select as operating Regions.

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

    Tag specifications for the IPAM resource discovery.

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

    A client token for the IPAM resource discovery.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def create_ipam_resource_discovery(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    description: Optional["capo_ec2.types.string.String"] = None,
    operating_regions: Optional[
        "capo_ec2.types.add_ipam_operating_region_set.AddIpamOperatingRegionSet"
    ] = 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_resource_discovery_result.CreateIpamResourceDiscoveryResult":
    """<p>Creates an IPAM resource discovery. 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>
        description: <p>A description for the IPAM resource discovery.</p>
        operating_regions: <p>Operating Regions for the IPAM resource discovery. Operating Regions are Amazon Web Services Regions where the IPAM is allowed to manage IP address CIDRs. IPAM only discovers and monitors resources in the Amazon Web Services Regions you select as operating Regions.</p>
        tag_specifications: <p>Tag specifications for the IPAM resource discovery.</p>
        client_token: <p>A client token for the IPAM resource discovery.</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_resource_discovery_request.CreateIpamResourceDiscoveryRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.create_ipam_resource_discovery_result.CreateIpamResourceDiscoveryResult"
    ]:
        import capo_ec2._operations.amazon_ec2.create_ipam_resource_discovery

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateIpamResourceDiscovery")
    )
    input_: capo_ec2.types.create_ipam_resource_discovery_request.CreateIpamResourceDiscoveryRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if description is not None:
        input_["description"] = description
    if operating_regions is not None:
        input_["operating_regions"] = operating_regions
    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 = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output