- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
PutIntegrationCommand
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.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CloudWatchLogsClient, PutIntegrationCommand } from "@aws-sdk/client-cloudwatch-logs"; // ES Modules import
// const { CloudWatchLogsClient, PutIntegrationCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
const client = new CloudWatchLogsClient(config);
const input = { // PutIntegrationRequest
integrationName: "STRING_VALUE", // required
resourceConfig: { // ResourceConfig Union: only one key present
openSearchResourceConfig: { // OpenSearchResourceConfig
kmsKeyArn: "STRING_VALUE",
dataSourceRoleArn: "STRING_VALUE", // required
dashboardViewerPrincipals: [ // DashboardViewerPrincipals // required
"STRING_VALUE",
],
applicationArn: "STRING_VALUE",
retentionDays: Number("int"), // required
},
},
integrationType: "OPENSEARCH", // required
};
const command = new PutIntegrationCommand(input);
const response = await client.send(command);
// { // PutIntegrationResponse
// integrationName: "STRING_VALUE",
// integrationStatus: "PROVISIONING" || "ACTIVE" || "FAILED",
// };
PutIntegrationCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
integrationName Required | string | undefined | A name for the integration. |
integrationType Required | IntegrationType | undefined | The type of integration. Currently, the only supported type is |
resourceConfig Required | ResourceConfig | undefined | A structure that contains configuration information for the integration that you are creating. |
PutIntegrationCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
integrationName | string | undefined | The name of the integration that you just created. |
integrationStatus | IntegrationStatus | undefined | 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 |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidParameterException | client | A parameter is specified incorrectly. |
LimitExceededException | client | You have reached the maximum number of resources that can be created. |
ServiceUnavailableException | server | The service cannot complete the request. |
ValidationException | client | One of the parameters for the request is not valid. |
CloudWatchLogsServiceException | Base exception class for all service exceptions from CloudWatchLogs service. |