Skip to content

put_integration async

put_integration(
    integration_name: IntegrationName,
    resource_config: ResourceConfig,
    integration_type: IntegrationType,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> PutIntegrationResponse

Creates an integration between CloudWatch Logs and another service in this account. Currently, only integrations with OpenSearch Service are supported, and currently you can have only one integration in your account.

Integrating with OpenSearch Service makes it possible for you to create curated vended logs dashboards, powered by OpenSearch Service analytics. For more information, see Vended log dashboards powered by Amazon OpenSearch Service.

You can use this operation only to create a new integration. You can't modify an existing integration.

Parameters:

  • integration_name (IntegrationName) –

    A name for the integration.

  • resource_config (ResourceConfig) –

    A structure that contains configuration information for the integration that you are creating.

  • integration_type (IntegrationType) –

    The type of integration. Currently, the only supported type is OPENSEARCH.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def put_integration(
    self,
    integration_name: "capo_cloudwatch_logs.types.integration_name.IntegrationName",
    resource_config: "capo_cloudwatch_logs.types.resource_config.ResourceConfig",
    integration_type: "capo_cloudwatch_logs.types.integration_type.IntegrationType",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.put_integration_response.PutIntegrationResponse":
    """<p>Creates an integration between CloudWatch Logs and another service in this account. Currently, only integrations with OpenSearch Service are supported, and currently you can have only one integration in your account.</p> <p>Integrating with OpenSearch Service makes it possible for you to create curated vended logs dashboards, powered by OpenSearch Service analytics. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-OpenSearch-Dashboards.html">Vended log dashboards powered by Amazon OpenSearch Service</a>.</p> <p>You can use this operation only to create a new integration. You can't modify an existing integration.</p>

    Args:
        integration_name: <p>A name for the integration.</p>
        resource_config: <p>A structure that contains configuration information for the integration that you are creating.</p>
        integration_type: <p>The type of integration. Currently, the only supported type is <code>OPENSEARCH</code>.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.limit_exceeded_exception.LimitExceededException: <p>You have reached the maximum number of resources that can be created.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.validation_exception.ValidationException: <p>One of the parameters for the request is not valid.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.put_integration_request.PutIntegrationRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.put_integration_response.PutIntegrationResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.put_integration

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.put_integration.async_put_integration(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutIntegration")
    )
    input_: capo_cloudwatch_logs.types.put_integration_request.PutIntegrationRequest = {
        "integration_name": integration_name,
        "resource_config": resource_config,
        "integration_type": integration_type,
    }

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