Class: AWSCDK::Logs::CfnIntegration::OpenSearchResourceConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
logs/cfn_integration.rb

Overview

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dashboard_viewer_principals:, data_source_role_arn:, application_arn: nil, kms_key_arn: nil, retention_days: nil) ⇒ OpenSearchResourceConfigProperty

Returns a new instance of OpenSearchResourceConfigProperty.

Parameters:

  • dashboard_viewer_principals (Array<String>)

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

  • data_source_role_arn (String)

    Specify the ARN of an IAM role that CloudWatch Logs will use to create the integration.

  • application_arn (String, nil) (defaults to: nil)

    If you want to use an existing OpenSearch Service application for your integration with OpenSearch Service, specify it here.

  • kms_key_arn (String, nil) (defaults to: nil)

    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.

  • retention_days (Numeric, nil) (defaults to: nil)

    Specify how many days that you want the data derived by OpenSearch Service to be retained in the index that the dashboard refers to.



537
538
539
540
541
542
543
544
545
546
547
548
# File 'logs/cfn_integration.rb', line 537

def initialize(dashboard_viewer_principals:, data_source_role_arn:, application_arn: nil, kms_key_arn: nil, retention_days: nil)
  @dashboard_viewer_principals = dashboard_viewer_principals
  Jsii::Type.check_type(@dashboard_viewer_principals, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "dashboardViewerPrincipals")
  @data_source_role_arn = data_source_role_arn
  Jsii::Type.check_type(@data_source_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataSourceRoleArn")
  @application_arn = application_arn
  Jsii::Type.check_type(@application_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "applicationArn") unless @application_arn.nil?
  @kms_key_arn = kms_key_arn
  Jsii::Type.check_type(@kms_key_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKeyArn") unless @kms_key_arn.nil?
  @retention_days = retention_days
  Jsii::Type.check_type(@retention_days, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retentionDays") unless @retention_days.nil?
end

Instance Attribute Details

#application_arnString? (readonly)

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.



570
571
572
# File 'logs/cfn_integration.rb', line 570

def application_arn
  @application_arn
end

#dashboard_viewer_principalsArray<String> (readonly)

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

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



556
557
558
# File 'logs/cfn_integration.rb', line 556

def dashboard_viewer_principals
  @dashboard_viewer_principals
end

#data_source_role_arnString (readonly)

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



563
564
565
# File 'logs/cfn_integration.rb', line 563

def data_source_role_arn
  @data_source_role_arn
end

#kms_key_arnString? (readonly)

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.



575
576
577
# File 'logs/cfn_integration.rb', line 575

def kms_key_arn
  @kms_key_arn
end

#retention_daysNumeric? (readonly)

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.



582
583
584
# File 'logs/cfn_integration.rb', line 582

def retention_days
  @retention_days
end

Class Method Details

.jsii_propertiesObject



584
585
586
587
588
589
590
591
592
# File 'logs/cfn_integration.rb', line 584

def self.jsii_properties
  {
    :dashboard_viewer_principals => "dashboardViewerPrincipals",
    :data_source_role_arn => "dataSourceRoleArn",
    :application_arn => "applicationArn",
    :kms_key_arn => "kmsKeyArn",
    :retention_days => "retentionDays",
  }
end

Instance Method Details

#to_jsiiObject



594
595
596
597
598
599
600
601
602
603
604
# File 'logs/cfn_integration.rb', line 594

def to_jsii
  result = {}
  result.merge!({
    "dashboardViewerPrincipals" => @dashboard_viewer_principals,
    "dataSourceRoleArn" => @data_source_role_arn,
    "applicationArn" => @application_arn,
    "kmsKeyArn" => @kms_key_arn,
    "retentionDays" => @retention_days,
  })
  result.compact
end