AWS / ChatOps

How to start an AWS database from Slack

The staging database stops at 7 p.m. to save money. At 8 p.m. a developer needs it for a hotfix, has no AWS console access, and the admin has gone home. A start button in Slack solves that, if it is built with the right limits.

The problem with scheduled databases

Stopping non-production RDS instances outside working hours is one of the simplest ways to cut a development bill. AWS states that you are not charged for DB instance hours while an instance is stopped. Storage and backups are still billed.

The schedule works until someone needs the database at an unusual time. A late deploy, a support case from another time zone, or a weekend migration test. If starting the database requires console access or an admin, the developer waits, or the team stops trusting the schedule and turns it off.

Starting from the team's chat tool is the obvious fix. The question is how much power that chat command should have. A database start is a cost decision; a database stop can break someone's work. They deserve different rules.

Keep one AWS detail in mind for every option: starting a stopped RDS instance can take minutes to hours depending on the instance and engine, and there is a 10-minute minimum charge each time it starts.

Option 1: Amazon Q Developer in chat applications

AWS Chatbot has been renamed Amazon Q Developer in chat applications. It works with Slack, Microsoft Teams and Amazon Chime. Besides forwarding notifications, it lets channel members run AWS CLI commands in a chat channel, so a start looks like this:

@Amazon Q rds start-db-instance --db-instance-identifier staging-db

The command syntax is the normal AWS CLI syntax after the @Amazon Q prefix. Missing parameters are prompted for, and commands time out after 15 seconds.

Permissions come from IAM. According to the permissions guide, a channel role gives every member of the channel the same permissions, while user roles let each member choose their own. Channel guardrail policies cap both: what a user can do is the intersection of the guardrails and their role.

This is a good fit when the team already works with the AWS CLI and you want one tool for alarms and actions. The trade-offs for this use case:

  • The scope is whatever IAM allows. You have to write a policy that allows rds:StartDBInstance on the right databases and nothing broader.
  • There is no built-in duration. The database runs until someone stops it or your existing schedule does.
  • Users need to know the exact CLI command and instance identifier.
  • Installing it in a Slack workspace requires workspace admin approval, and someone must be comfortable with IAM roles and policies.

Option 2: a custom Slack bot and Lambda

A slash command that calls an API Gateway endpoint and a Lambda function gives you full control over the experience. It also makes you responsible for every security property. At a minimum, you need to build:

  • Request verification. Slack signs each request. Slack's guide describes the steps: compute an HMAC SHA256 of v0:timestamp:body with your signing secret, compare it with the X-Slack-Signature header using a constant-time comparison, and reject timestamps more than five minutes old.
  • Fast acknowledgment. Interactive payloads must be acknowledged within 3 seconds. The RDS call and the final reply happen afterwards, through the response_url, which accepts up to 5 responses within 30 minutes.
  • A narrow IAM role. The Lambda role should only allow starting the databases you intend. RDS policies can be scoped by resource ARN and, for many actions, by tag conditions such as rds:db-tag/stage.
  • An audit trail with the human. CloudTrail logs RDS API calls, but the identity it records is the Lambda role, not the Slack user. Log the Slack user and team yourself.
  • The stop afterwards. Without it, a late-night start runs until morning. One approach is an EventBridge Scheduler one-time schedule that calls StopDBInstance at the expiry time. You then need to handle the case where the regular schedule wants the database running at that time.

None of this is hard on its own. Together it is a small service to maintain, with a signing secret to rotate and edge cases to test. Our comparison of EventBridge and Lambda scheduling covers the same trade-off for the schedule itself.

A slash command in a chat channel starts a stopped RDS database for 1, 3 or 5 hours. When the temporary start expires, the normal schedule takes over again.
A time-limited start: the database runs for the chosen duration, then the regular schedule decides again.

Option 3: the SnoozeDB Slack integration

SnoozeDB schedules RDS, EC2 and EKS dev and test resources. Its Slack integration has a deliberately narrow scope: list RDS databases and start one temporarily. It cannot stop anything.

An owner or admin connects Slack from Settings, then Cloud integrations. After that, two commands are available:

/snoozedb-list
/snoozedb-start staging-db

The list command returns the RDS identifiers of the connected organization with a running or stopped state. The start command takes an exact identifier and offers 1h, 3h, 5h and Cancel. Choosing a duration starts the instance and saves an override until the displayed expiry time. When the override expires, the normal schedule applies again: if the database is outside its schedule window, the scheduler stops it.

Before calling AWS, SnoozeDB:

  • verifies the Slack request signature for commands and button clicks;
  • finds the organization from the Slack workspace installation, not from anything in the message;
  • checks again that the database is still active in SnoozeDB, not protected or removed from AWS, and that the organization's subscription or trial is valid;
  • uses the existing AWS role and External ID of the database's account.

Responses are only visible to the person who ran the command. A successful start writes an automation log and an activity entry with the Slack user ID and the duration.

One point to decide consciously: once a workspace is connected, any member of that Slack workspace can list and temporarily start databases. They do not need a SnoozeDB account or role. Connect only a workspace whose membership matches who should have that access. The Slack integration guide covers setup and troubleshooting.

Comparing the options

OptionWhat a user can startStop afterwardsWho started it
Amazon Q Developer in chat applicationsAny CLI command the IAM role and guardrails allowManual, or your own automationCloudTrail shows the channel or user role
Custom Slack bot + LambdaWhatever you buildYou build it, for example a one-time scheduleWhatever you log
SnoozeDB Slack integrationEligible RDS databases, 1, 3 or 5 hoursThe normal schedule resumes after the overrideSnoozeDB Activity Logs with the Slack user ID

Security questions to answer first

Whichever option you pick, answer these before you let a chat channel touch AWS.

Who can start what? Decide whether the boundary is a Slack workspace, a channel, or an individual IAM role. Workspace membership is coarse; IAM user roles are precise but need someone to manage them. Exclude production databases at the policy level, not by convention.

Start-only or start and stop? Starting a dev database costs money for a few hours. Stopping one can interrupt a colleague's test run or migration. Giving chat users only the start action keeps the worst case small.

How long does it run? A start without an end is how schedules drift. Fixed durations make the cost of an exception predictable and remove the need to remember to stop.

Can you tell who did it? Record the Slack user and team alongside the AWS action. Keep CloudTrail as well: it records the AWS call itself, and an application log complements it rather than replacing it.

If you are still setting up the schedule itself, start with how to start and stop RDS automatically. A Slack start then becomes the exception path, not the main one.