Class: AWSCDK::Chatbot::SlackChannelConfigurationProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
chatbot/slack_channel_configuration_props.rb

Overview

Properties for a new Slack channel configuration.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slack_channel_configuration_name:, slack_channel_id:, slack_workspace_id:, guardrail_policies: nil, logging_level: nil, log_retention: nil, log_retention_retry_options: nil, log_retention_role: nil, notification_topics: nil, role: nil, user_role_required: nil) ⇒ SlackChannelConfigurationProps

Returns a new instance of SlackChannelConfigurationProps.

Parameters:

  • slack_channel_configuration_name (String)

    The name of Slack channel configuration.

  • slack_channel_id (String)

    The ID of the Slack channel.

  • slack_workspace_id (String)

    The ID of the Slack workspace authorized with AWS Chatbot.

  • guardrail_policies (Array<AWSCDK::IAM::IManagedPolicy>, nil) (defaults to: nil)

    A list of IAM managed policies that are applied as channel guardrails.

  • logging_level (AWSCDK::Chatbot::LoggingLevel, nil) (defaults to: nil)

    Specifies the logging level for this configuration.

  • log_retention (AWSCDK::Logs::RetentionDays, nil) (defaults to: nil)

    The number of days log events are kept in CloudWatch Logs.

  • log_retention_retry_options (AWSCDK::Logs::LogRetentionRetryOptions, nil) (defaults to: nil)

    When log retention is specified, a custom resource attempts to create the CloudWatch log group.

  • log_retention_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

  • notification_topics (Array<AWSCDK::SNS::ITopic>, nil) (defaults to: nil)

    The SNS topics that deliver notifications to AWS Chatbot.

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The permission role of Slack channel configuration.

  • user_role_required (Boolean, nil) (defaults to: nil)

    Enables use of a user role requirement in your chat configuration.



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'chatbot/slack_channel_configuration_props.rb', line 18

def initialize(slack_channel_configuration_name:, slack_channel_id:, slack_workspace_id:, guardrail_policies: nil, logging_level: nil, log_retention: nil, log_retention_retry_options: nil, log_retention_role: nil, notification_topics: nil, role: nil, user_role_required: nil)
  @slack_channel_configuration_name = slack_channel_configuration_name
  Jsii::Type.check_type(@slack_channel_configuration_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "slackChannelConfigurationName")
  @slack_channel_id = slack_channel_id
  Jsii::Type.check_type(@slack_channel_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "slackChannelId")
  @slack_workspace_id = slack_workspace_id
  Jsii::Type.check_type(@slack_workspace_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "slackWorkspaceId")
  @guardrail_policies = guardrail_policies
  Jsii::Type.check_type(@guardrail_policies, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19pYW0uSU1hbmFnZWRQb2xpY3kifSwia2luZCI6ImFycmF5In19")), "guardrailPolicies") unless @guardrail_policies.nil?
  @logging_level = logging_level
  Jsii::Type.check_type(@logging_level, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2hhdGJvdC5Mb2dnaW5nTGV2ZWwifQ==")), "loggingLevel") unless @logging_level.nil?
  @log_retention = log_retention
  Jsii::Type.check_type(@log_retention, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5SZXRlbnRpb25EYXlzIn0=")), "logRetention") unless @log_retention.nil?
  @log_retention_retry_options = log_retention_retry_options.is_a?(Hash) ? ::AWSCDK::Logs::LogRetentionRetryOptions.new(**log_retention_retry_options.transform_keys(&:to_sym)) : log_retention_retry_options
  Jsii::Type.check_type(@log_retention_retry_options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbG9ncy5Mb2dSZXRlbnRpb25SZXRyeU9wdGlvbnMifQ==")), "logRetentionRetryOptions") unless @log_retention_retry_options.nil?
  @log_retention_role = log_retention_role
  Jsii::Type.check_type(@log_retention_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "logRetentionRole") unless @log_retention_role.nil?
  @notification_topics = notification_topics
  Jsii::Type.check_type(@notification_topics, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zbnMuSVRvcGljIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "notificationTopics") unless @notification_topics.nil?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
  @user_role_required = user_role_required
  Jsii::Type.check_type(@user_role_required, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "userRoleRequired") unless @user_role_required.nil?
end

Instance Attribute Details

#guardrail_policiesArray<AWSCDK::IAM::IManagedPolicy>? (readonly)

Note:

Default: - The AWS managed 'AdministratorAccess' policy is applied as a default if this is not set.

A list of IAM managed policies that are applied as channel guardrails.

Returns:



67
68
69
# File 'chatbot/slack_channel_configuration_props.rb', line 67

def guardrail_policies
  @guardrail_policies
end

#log_retentionAWSCDK::Logs::RetentionDays? (readonly)

Note:

Default: logs.RetentionDays.INFINITE

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

Returns:



83
84
85
# File 'chatbot/slack_channel_configuration_props.rb', line 83

def log_retention
  @log_retention
end

#log_retention_retry_optionsAWSCDK::Logs::LogRetentionRetryOptions? (readonly)

Note:

Default: - Default AWS SDK retry options.

When log retention is specified, a custom resource attempts to create the CloudWatch log group.

These options control the retry policy when interacting with CloudWatch APIs.



90
91
92
# File 'chatbot/slack_channel_configuration_props.rb', line 90

def log_retention_retry_options
  @log_retention_retry_options
end

#log_retention_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A new role is created.

The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

Returns:



95
96
97
# File 'chatbot/slack_channel_configuration_props.rb', line 95

def log_retention_role
  @log_retention_role
end

#logging_levelAWSCDK::Chatbot::LoggingLevel? (readonly)

Note:

Default: LoggingLevel.NONE

Specifies the logging level for this configuration.

This property affects the log entries pushed to Amazon CloudWatch Logs.



74
75
76
# File 'chatbot/slack_channel_configuration_props.rb', line 74

def logging_level
  @logging_level
end

#notification_topicsArray<AWSCDK::SNS::ITopic>? (readonly)

Note:

Default: None

The SNS topics that deliver notifications to AWS Chatbot.

Returns:



100
101
102
# File 'chatbot/slack_channel_configuration_props.rb', line 100

def notification_topics
  @notification_topics
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - A role will be created.

The permission role of Slack channel configuration.

Returns:



105
106
107
# File 'chatbot/slack_channel_configuration_props.rb', line 105

def role
  @role
end

#slack_channel_configuration_nameString (readonly)

The name of Slack channel configuration.

Returns:

  • (String)


46
47
48
# File 'chatbot/slack_channel_configuration_props.rb', line 46

def slack_channel_configuration_name
  @slack_channel_configuration_name
end

#slack_channel_idString (readonly)

The ID of the Slack channel.

To get the ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.

Returns:

  • (String)


53
54
55
# File 'chatbot/slack_channel_configuration_props.rb', line 53

def slack_channel_id
  @slack_channel_id
end

#slack_workspace_idString (readonly)

The ID of the Slack workspace authorized with AWS Chatbot.

To get the workspace ID, you must perform the initial authorization flow with Slack in the AWS Chatbot console. Then you can copy and paste the workspace ID from the console. For more details, see steps 1-4 in Setting Up AWS Chatbot with Slack in the AWS Chatbot User Guide.



62
63
64
# File 'chatbot/slack_channel_configuration_props.rb', line 62

def slack_workspace_id
  @slack_workspace_id
end

#user_role_requiredBoolean? (readonly)

Note:

Default: false

Enables use of a user role requirement in your chat configuration.

Returns:

  • (Boolean, nil)


110
111
112
# File 'chatbot/slack_channel_configuration_props.rb', line 110

def user_role_required
  @user_role_required
end

Class Method Details

.jsii_propertiesObject



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'chatbot/slack_channel_configuration_props.rb', line 112

def self.jsii_properties
  {
    :slack_channel_configuration_name => "slackChannelConfigurationName",
    :slack_channel_id => "slackChannelId",
    :slack_workspace_id => "slackWorkspaceId",
    :guardrail_policies => "guardrailPolicies",
    :logging_level => "loggingLevel",
    :log_retention => "logRetention",
    :log_retention_retry_options => "logRetentionRetryOptions",
    :log_retention_role => "logRetentionRole",
    :notification_topics => "notificationTopics",
    :role => "role",
    :user_role_required => "userRoleRequired",
  }
end

Instance Method Details

#to_jsiiObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'chatbot/slack_channel_configuration_props.rb', line 128

def to_jsii
  result = {}
  result.merge!({
    "slackChannelConfigurationName" => @slack_channel_configuration_name,
    "slackChannelId" => @slack_channel_id,
    "slackWorkspaceId" => @slack_workspace_id,
    "guardrailPolicies" => @guardrail_policies,
    "loggingLevel" => @logging_level,
    "logRetention" => @log_retention,
    "logRetentionRetryOptions" => @log_retention_retry_options,
    "logRetentionRole" => @log_retention_role,
    "notificationTopics" => @notification_topics,
    "role" => @role,
    "userRoleRequired" => @user_role_required,
  })
  result.compact
end