Skip to content
v2.277.0

OpenSearchResourceConfigProperty Struct ​

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

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_logs as logs } from 'aws-cdk-lib';
const openSearchResourceConfigProperty: logs.CfnIntegration.OpenSearchResourceConfigProperty = {
  dashboardViewerPrincipals: ['dashboardViewerPrincipals'],
  dataSourceRoleArn: 'dataSourceRoleArn',

  // the properties below are optional
  applicationArn: 'applicationArn',
  kmsKeyArn: 'kmsKeyArn',
  retentionDays: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_logs as logs

open_search_resource_config_property = logs.CfnIntegration.OpenSearchResourceConfigProperty(
    dashboard_viewer_principals=["dashboardViewerPrincipals"],
    data_source_role_arn="dataSourceRoleArn",

    # the properties below are optional
    application_arn="applicationArn",
    kms_key_arn="kmsKeyArn",
    retention_days=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.logs.*;

OpenSearchResourceConfigProperty openSearchResourceConfigProperty = OpenSearchResourceConfigProperty.builder()
        .dashboardViewerPrincipals(List.of("dashboardViewerPrincipals"))
        .dataSourceRoleArn("dataSourceRoleArn")

        // the properties below are optional
        .applicationArn("applicationArn")
        .kmsKeyArn("kmsKeyArn")
        .retentionDays(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Logs;

var openSearchResourceConfigProperty = new OpenSearchResourceConfigProperty {
    DashboardViewerPrincipals = new [] { "dashboardViewerPrincipals" },
    DataSourceRoleArn = "dataSourceRoleArn",

    // the properties below are optional
    ApplicationArn = "applicationArn",
    KmsKeyArn = "kmsKeyArn",
    RetentionDays = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

openSearchResourceConfigProperty := &OpenSearchResourceConfigProperty{
	DashboardViewerPrincipals: []*string{
		jsii.String("dashboardViewerPrincipals"),
	},
	DataSourceRoleArn: jsii.String("dataSourceRoleArn"),

	// the properties below are optional
	ApplicationArn: jsii.String("applicationArn"),
	KmsKeyArn: jsii.String("kmsKeyArn"),
	RetentionDays: jsii.Number(123),
}

Properties ​

applicationArnoptionalstringapplication_arnoptionalstrapplicationArnoptionalStringApplicationArnoptionalstringApplicationArnoptional*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.

dashboardViewerPrincipalsstring[]dashboard_viewer_principalstyping.List[str]dashboardViewerPrincipalsList<String>DashboardViewerPrincipalsstring[]DashboardViewerPrincipals*[]*stringrequired#
Specify the ARNs of IAM roles and IAM users who you want to grant permission to for viewing the dashboards.
notes

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

dataSourceRoleArnstringdata_source_role_arnstrdataSourceRoleArnStringDataSourceRoleArnstringDataSourceRoleArn*stringrequired#
Specify the ARN of an IAM role that CloudWatch Logs will use to create the integration.
notes

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 Permissions that the integration needs in the CloudWatch Logs User Guide.

kmsKeyArnoptionalstringkms_key_arnoptionalstrkmsKeyArnoptionalStringKmsKeyArnoptionalstringKmsKeyArnoptional*string#
To have the vended dashboard data encrypted with AWS instead of the CloudWatch Logs default encryption method, specify the ARN of the AWS key that you want to use.
retentionDaysoptionalnumberretention_daysoptionalint | floatretentionDaysoptionalNumberRetentionDaysoptionaldoubleRetentionDaysoptional*float64#
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.