Enabling CloudWatch Logs for AWS Chatbot / AWS chatbot channel via Cloudformation

0

Please how can i enable Amazon Cloudwatch Log for my AWS chatbot/AWS chatbot channel Using Cloudformation.

Nafiu
asked a month ago130 views
1 Answer
2
Accepted Answer

Hello,

To enable Logging for AWS Chatbot using AWS Cloudformation, This is how an example template will look like:

AWSTemplateFormatVersion: '2010-09-09'
Resources:
  ChatbotLogsRole:
    Type: 'AWS::IAM::Role'
    Properties:
      AssumeRolePolicyDocument:
        Version: '2012-10-17'
        Statement:
          - Effect: 'Allow'
            Principal:
              Service: 'chatbot.amazonaws.com'
            Action: 'sts:AssumeRole'
      Policies:
        - PolicyName: 'ChatbotLogsPolicy'
          PolicyDocument:
            Version: '2012-10-17'
            Statement:
              - Effect: 'Allow'
                Action:
                  - 'logs:CreateLogGroup'
                  - 'logs:CreateLogStream'
                  - 'logs:PutLogEvents'
                Resource: 'arn:aws:logs:*:*:*'
  ChatbotNotification:
    Type: 'AWS::Chatbot::SlackChannelConfiguration'
    Properties:
      ConfigurationName: 'MyChatbotConfiguration'
      IamRoleArn: !GetAtt ChatbotLogsRole.Arn
      SlackChannelId: 'YOUR_TEAMS_CHANNEL_ID'
      SlackWorkspaceId: 'YOUR_TEAMS_WORKSPACE_ID'

You can refer this documentation of Cloud Formation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_Chatbot.html

profile picture
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions