Skip to content

create_dataset_integration async

create_dataset_integration(
    role_arn: ResourceArn,
    *,
    config_overrides: Optional[AsyncObservabilityAdminClientConfig] = None,
    tags: Optional[TagMapInput] = None,
) -> CreateDatasetIntegrationOutput

Creates a dataset integration for the caller's account in the current region and returns its ARN.

To use this operation, you must have permission to access the dataset integration resources through the IAM role specified in the RoleArn parameter.

If a dataset integration already exists for the account, this operation fails with a ConflictException.

Parameters:

  • role_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the IAM role that grants Amazon CloudWatch permission to access the resources needed for the dataset integration.

  • tags (Optional[TagMapInput], default: None ) –

    The key-value pairs to associate with the dataset integration resource for categorization and management purposes.

Raises:

  • AccessDeniedException –

    Indicates you don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see Access management for Amazon Web Services resources in the IAM user guide.

  • ConflictException –

    The requested operation conflicts with the current state of the specified resource or with another request.

  • InternalServerException –

    Indicates the request has failed to process because of an unknown server error, exception, or failure.

  • TooManyRequestsException –

    The request throughput limit was exceeded.

  • ValidationException –

    Indicates input validation failed. Check your request parameters and retry the request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_observabilityadmin/_services/async_observability_admin.py
async def create_dataset_integration(
    self,
    role_arn: "capo_observabilityadmin.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[AsyncObservabilityAdminClientConfig] = None,
    tags: Optional[
        "capo_observabilityadmin.types.tag_map_input.TagMapInput"
    ] = None,
) -> "capo_observabilityadmin.types.create_dataset_integration_output.CreateDatasetIntegrationOutput":
    """<p>Creates a dataset integration for the caller's account in the current region and returns its ARN.</p> <p>To use this operation, you must have permission to access the dataset integration resources through the IAM role specified in the <code>RoleArn</code> parameter.</p> <p>If a dataset integration already exists for the account, this operation fails with a <code>ConflictException</code>.</p>

    Args:
        role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that grants Amazon CloudWatch permission to access the resources needed for the dataset integration.</p>
        tags: <p>The key-value pairs to associate with the dataset integration resource for categorization and management purposes.</p>

    Raises:
        capo_observabilityadmin.errors.access_denied_exception.AccessDeniedException: <p> Indicates you don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html">Access management for Amazon Web Services resources</a> in the IAM user guide. </p>
        capo_observabilityadmin.errors.conflict_exception.ConflictException: <p> The requested operation conflicts with the current state of the specified resource or with another request. </p>
        capo_observabilityadmin.errors.internal_server_exception.InternalServerException: <p> Indicates the request has failed to process because of an unknown server error, exception, or failure. </p>
        capo_observabilityadmin.errors.too_many_requests_exception.TooManyRequestsException: <p> The request throughput limit was exceeded. </p>
        capo_observabilityadmin.errors.validation_exception.ValidationException: <p> Indicates input validation failed. Check your request parameters and retry the request. </p>
        capo_observabilityadmin.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_observabilityadmin.types.create_dataset_integration_input.CreateDatasetIntegrationInput]",
    ) -> AsyncOperationResponse[
        "capo_observabilityadmin.types.create_dataset_integration_output.CreateDatasetIntegrationOutput"
    ]:
        import capo_observabilityadmin._operations.observability_admin.create_dataset_integration

        (
            output,
            http_response,
        ) = await capo_observabilityadmin._operations.observability_admin.create_dataset_integration.async_create_dataset_integration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDatasetIntegration")
    )
    input_: capo_observabilityadmin.types.create_dataset_integration_input.CreateDatasetIntegrationInput = {
        "role_arn": role_arn
    }
    if tags is not None:
        input_["tags"] = tags

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