Getting started with AWS Chatbot
To get started using AWS Chatbot to help manage your AWS infrastructure, follow the steps below to set up AWS Chatbot with chat rooms and Amazon SNS topic subscriptions.
Topics
- Setting up AWS Chatbot
- Tutorial: Get started with Slack
- Tutorial: Get started with Amazon Chime
- Tutorial: Get started with Microsoft Teams
- Tutorial: Create or configure an Amazon Simple Notification Service topic as a notification target for Microsoft Teams and AWS CodeStar
- Tutorial: Subscribing an Amazon SNS topic to AWS Chatbot
- Test notifications from AWS services to chat channels using CloudWatch
- Next steps
Setting up AWS Chatbot
To use AWS Chatbot, you authorize a chat client configuration with AWS Chatbot, and optionally configure AWS Chatbot to use an Amazon Simple Notification Service (Amazon SNS) topic to deliver notifications to the chat rooms. Before you can get started, you must complete the following setup tasks.
Prerequisites
With AWS Chatbot, you can use chat rooms to monitor and respond to events in your AWS Cloud.
Below are some prerequisites you should have before you begin using AWS Chatbot:
-
You have started using some AWS services. For more information about AWS services you can use with AWS Chatbot, see Monitoring AWS services using AWS Chatbot.
-
You have administrator privileges with your chosen chat client chat room, tenant, or workspace.
-
You understand AWS Chatbot's permission schemes. For more information about AWS Chatbot's permission schemes, see Understanding permissions.
If you have an existing AWS administrator user, you can access the AWS Chatbot console with no additional permissions. AWS recommends that you grant only the permissions required to perform a task for other users. For more information, see Apply least-privilege permissions in the AWS Identity and Access Management User Guide.
Sign up for an AWS account
If you do not have an AWS account, complete the following steps to create one.
To sign up for an AWS account
Follow the online instructions.
Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
When you sign up for an AWS account, an AWS account root user is created. The root user has access to all AWS services and resources in the account. As a security best practice, assign administrative access to a user, and use only the root user to perform tasks that require root user access.
AWS sends you a confirmation email after the sign-up process is
complete. At any time, you can view your current account activity and manage your account by
going to https://aws.amazon.com/
Create a user with administrative access
After you sign up for an AWS account, secure your AWS account root user, enable AWS IAM Identity Center, and create an administrative user so that you don't use the root user for everyday tasks.
Secure your AWS account root user
-
Sign in to the AWS Management Console
as the account owner by choosing Root user and entering your AWS account email address. On the next page, enter your password. For help signing in by using root user, see Signing in as the root user in the AWS Sign-In User Guide.
-
Turn on multi-factor authentication (MFA) for your root user.
For instructions, see Enable a virtual MFA device for your AWS account root user (console) in the IAM User Guide.
Create a user with administrative access
-
Enable IAM Identity Center.
For instructions, see Enabling AWS IAM Identity Center in the AWS IAM Identity Center User Guide.
-
In IAM Identity Center, grant administrative access to a user.
For a tutorial about using the IAM Identity Center directory as your identity source, see Configure user access with the default IAM Identity Center directory in the AWS IAM Identity Center User Guide.
Sign in as the user with administrative access
-
To sign in with your IAM Identity Center user, use the sign-in URL that was sent to your email address when you created the IAM Identity Center user.
For help signing in using an IAM Identity Center user, see Signing in to the AWS access portal in the AWS Sign-In User Guide.
Assign access to additional users
-
In IAM Identity Center, create a permission set that follows the best practice of applying least-privilege permissions.
For instructions, see Create a permission set in the AWS IAM Identity Center User Guide.
-
Assign users to a group, and then assign single sign-on access to the group.
For instructions, see Add groups in the AWS IAM Identity Center User Guide.
Setting up IAM permissions for AWS Chatbot
If you would like to add AWS Chatbot access to an existing user or group, you can choose from allowed Chatbot actions in IAM.
If you need to customize an IAM role to work with AWS Chatbot, you can use the procedure in this topic.
If you want to allow AWS Chatbot to answer questions about your AWS resources, make sure to add the AWSResourceExplorerReadOnlyAccess
policy to your IAM role. You must also make sure that your channel guardrail policies allow AWSResourceExplorerReadOnlyAccess
permissions.
To create a policy to configure AWS Chatbot
-
Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
. -
Choose Policies from the navigation pane.
-
Choose Create policy.
-
Expand Service and find Chatbot.
-
Under Actions, expand the Read and Write sections to see the available actions.
Read actions include DescribeChimeWebhookConfigurations, DescribeSlackChannelConfigurations, DescribeTeamsChannelConfiguration, and more.
Write actions include CreateChimeWebhookConfiguration, DeleteChimeWebhookConfiguration, and more.
-
After selecting the actions you want to include, choose Review policy.
-
Give your policy a name and description, then choose Create policy. You can now add your new policy to any of your users or groups.
For more information on updating the permissions of existing users, see Adding Permissions to a User (Console) in the IAM User Guide.
Note
AWS Chatbot is a global service that requires access to all AWS Regions. If there is a policy in place that prevents access to services in certain Regions, you must change the policy to allow global AWS Chatbot access. For more information about policy types that might limit how IAM roles can be assumed and how to override them, see Other policy types.
Setting up Amazon SNS topics
To use AWS Chatbot, you must have Amazon SNS topics set up. If you don't have any Amazon SNS topics yet, follow the steps to get started in Getting Started with Amazon SNS in the Amazon Simple Notification Service Developer Guide.
Note
AWS Chatbot doesn't support SNS FIFO topics because these topics can't deliver messages to HTTPS endpoints. For more information, see Message delivery for FIFO topics in the Amazon Simple Notification Service Developer Guide.
If you have server-side encryption enabled for your Amazon SNS topics, you must give permissions to the sending services in your AWS KMS key policy to post events to the encrypted SNS topics. The following policy is an example for Amazon EventBridge.
{ "Sid": "Allow CWE to use the key", "Effect": "Allow", "Principal": { "Service": "events.amazonaws.com" }, "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "*" }
In order to successfully test the configuration from the console, your role must also have permission to use the AWS KMS key.
AWS managed service keys don’t allow you to modify access policies, so you will need AWS KMS/CMK for encrypted SNS topics. You can then update the access permissions in the AWS KMS key policy to allow the service that sends messages to publish to your encrypted SNS topics (for example, EventBridge).
Next steps
Once you've taken the necessary steps to set up AWS Chatbot, you can get started configuring the chat client of your choice. For a step-by-step guide on how to do this, choose the appropriate tutorial below: