Class SlackChannelConfiguration

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.chatbot.SlackChannelConfiguration
All Implemented Interfaces:
IConstruct, IDependable, IResource, ISlackChannelConfiguration, INotificationRuleTarget, IGrantable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.219Z") @Stability(Stable) public class SlackChannelConfiguration extends Resource implements ISlackChannelConfiguration
A new Slack channel configuration.

Example:

 // Define CodeStar Notification rules for Pipelines
 import software.amazon.awscdk.services.chatbot.*;
 Pipeline pipeline;
 SlackChannelConfiguration target = SlackChannelConfiguration.Builder.create(this, "MySlackChannel")
         .slackChannelConfigurationName("YOUR_CHANNEL_NAME")
         .slackWorkspaceId("YOUR_SLACK_WORKSPACE_ID")
         .slackChannelId("YOUR_SLACK_CHANNEL_ID")
         .build();
 INotificationRule rule = pipeline.notifyOnExecutionStateChange("NotifyOnExecutionStateChange", target);
 
  • Constructor Details

    • SlackChannelConfiguration

      protected SlackChannelConfiguration(software.amazon.jsii.JsiiObjectRef objRef)
    • SlackChannelConfiguration

      protected SlackChannelConfiguration(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • SlackChannelConfiguration

      @Stability(Stable) public SlackChannelConfiguration(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull SlackChannelConfigurationProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromSlackChannelConfigurationArn

      @Stability(Stable) @NotNull public static ISlackChannelConfiguration fromSlackChannelConfigurationArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String slackChannelConfigurationArn)
      Import an existing Slack channel configuration provided an ARN.

      Parameters:
      scope - The parent creating construct. This parameter is required.
      id - The construct's name. This parameter is required.
      slackChannelConfigurationArn - configuration ARN (i.e. arn:aws:chatbot::1234567890:chat-configuration/slack-channel/my-slack). This parameter is required.
      Returns:
      a reference to the existing Slack channel configuration
    • metricAll

      @Stability(Stable) @NotNull public static Metric metricAll(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for All SlackChannelConfigurations.

      Parameters:
      metricName - This parameter is required.
      props -
    • metricAll

      @Stability(Stable) @NotNull public static Metric metricAll(@NotNull String metricName)
      Return the given named metric for All SlackChannelConfigurations.

      Parameters:
      metricName - This parameter is required.
    • addNotificationTopic

      @Stability(Stable) public void addNotificationTopic(@NotNull ITopic notificationTopic)
      Adds a SNS topic that deliver notifications to AWS Chatbot.

      Parameters:
      notificationTopic - This parameter is required.
    • addToRolePolicy

      @Stability(Stable) public void addToRolePolicy(@NotNull PolicyStatement statement)
      Adds extra permission to iam-role of Slack channel configuration.

      Specified by:
      addToRolePolicy in interface ISlackChannelConfiguration
      Parameters:
      statement - This parameter is required.
    • bindAsNotificationRuleTarget

      @Stability(Stable) @NotNull public NotificationRuleTargetConfig bindAsNotificationRuleTarget(@NotNull software.constructs.Construct _scope)
      Returns a target configuration for notification rule.

      Specified by:
      bindAsNotificationRuleTarget in interface INotificationRuleTarget
      Parameters:
      _scope - This parameter is required.
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      Return the given named metric for this SlackChannelConfiguration.

      Specified by:
      metric in interface ISlackChannelConfiguration
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Stable) @NotNull public Metric metric(@NotNull String metricName)
      Return the given named metric for this SlackChannelConfiguration.

      Specified by:
      metric in interface ISlackChannelConfiguration
      Parameters:
      metricName - This parameter is required.
    • getGrantPrincipal

      @Stability(Stable) @NotNull public IPrincipal getGrantPrincipal()
      The principal to grant permissions to.
      Specified by:
      getGrantPrincipal in interface IGrantable
    • getSlackChannelConfigurationArn

      @Stability(Stable) @NotNull public String getSlackChannelConfigurationArn()
      The ARN of the Slack channel configuration In the form of arn:aws:chatbot:{region}:{account}:chat-configuration/slack-channel/{slackChannelName}.
      Specified by:
      getSlackChannelConfigurationArn in interface ISlackChannelConfiguration
    • getSlackChannelConfigurationName

      @Stability(Stable) @NotNull public String getSlackChannelConfigurationName()
      The name of Slack channel configuration.
      Specified by:
      getSlackChannelConfigurationName in interface ISlackChannelConfiguration
    • getRole

      @Stability(Stable) @Nullable public IRole getRole()
      The permission role of Slack channel configuration.
      Specified by:
      getRole in interface ISlackChannelConfiguration