CloudWatchLogs / Client / put_integration

put_integration#

CloudWatchLogs.Client.put_integration(**kwargs)#

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.

See also: AWS API Documentation

Request Syntax

response = client.put_integration(
    integrationName='string',
    resourceConfig={
        'openSearchResourceConfig': {
            'kmsKeyArn': 'string',
            'dataSourceRoleArn': 'string',
            'dashboardViewerPrincipals': [
                'string',
            ],
            'applicationArn': 'string',
            'retentionDays': 123
        }
    },
    integrationType='OPENSEARCH'
)
Parameters:
  • integrationName (string) –

    [REQUIRED]

    A name for the integration.

  • resourceConfig (dict) –

    [REQUIRED]

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

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: openSearchResourceConfig.

    • openSearchResourceConfig (dict) –

      This structure contains configuration details about an integration between CloudWatch Logs and OpenSearch Service.

      • kmsKeyArn (string) –

        To have the vended dashboard data encrypted with KMS instead of the CloudWatch Logs default encryption method, specify the ARN of the KMS key that you want to use.

      • dataSourceRoleArn (string) – [REQUIRED]

        Specify the ARN of an IAM role that CloudWatch Logs will use to create the integration. This role must have the permissions necessary to access the OpenSearch Service collection to be able to create the dashboards. For more information about the permissions needed, see Create an IAM role to access the OpenSearch Service collection in the CloudWatch Logs User Guide.

      • dashboardViewerPrincipals (list) – [REQUIRED]

        Specify the ARNs of IAM roles and IAM users who you want to grant permission to for viewing the dashboards.

        Warning

        In addition to specifying these users here, you must also grant them the CloudWatchOpenSearchDashboardsAccess IAM policy. For more information, see

        • (string) –

      • applicationArn (string) –

        If you want to use an existing OpenSearch Service application for your integration with OpenSearch Service, specify it here. If you omit this, a new application will be created.

      • retentionDays (integer) – [REQUIRED]

        Specify how many days that you want the data derived by OpenSearch Service to be retained in the index that the dashboard refers to. This also sets the maximum time period that you can choose when viewing data in the dashboard. Choosing a longer time frame will incur additional costs.

  • integrationType (string) –

    [REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'integrationName': 'string',
    'integrationStatus': 'PROVISIONING'|'ACTIVE'|'FAILED'
}

Response Structure

  • (dict) –

    • integrationName (string) –

      The name of the integration that you just created.

    • integrationStatus (string) –

      The status of the integration that you just created.

      After you create an integration, it takes a few minutes to complete. During this time, you’ll see the status as PROVISIONING.

Exceptions

  • CloudWatchLogs.Client.exceptions.InvalidParameterException

  • CloudWatchLogs.Client.exceptions.LimitExceededException

  • CloudWatchLogs.Client.exceptions.ServiceUnavailableException

  • CloudWatchLogs.Client.exceptions.ValidationException