More Info:
Your AWS RDS resources should have event notifications enabled in order to be notified when an event occurs for a given database instance, database snapshot, database security group or database parameter groupRisk Level
LowAddress
Reliability, Operational MaturityCompliance Standards
CBPRemediation
Using Console
To remediate the misconfiguration of Event Notifications not being enabled for an AWS RDS instance using the AWS Management Console, follow these step-by-step instructions:- Log in to the AWS Management Console: Go to https://aws.amazon.com/ and log in using your credentials.
- Navigate to the RDS Console: Once logged in, navigate to the Amazon RDS console by clicking on the “Services” dropdown menu at the top of the page and selecting “RDS” under the Database category.
- Select the RDS Instance: In the RDS dashboard, locate and select the RDS instance for which you want to enable Event Notifications.
- Enable Event Notifications: In the RDS instance details page, scroll down to the “Event subscriptions” section and click on the “Modify” button.
- Configure Event Notifications: In the Modify RDS instance page, scroll down to the “Event subscriptions” section and click on the “Add event subscription” button.
-
Set up Event Subscription: In the Add event subscription dialog box, configure the following settings:
- Subscription name: Enter a name for the event subscription.
- SNS topic: Select an existing SNS topic or create a new one to receive the event notifications.
- Event categories: Select the event categories for which you want to receive notifications. For example, you can choose “All” to receive notifications for all event categories.
- Severity: Select the severity level of events for which you want to receive notifications.
- Enable: Make sure the “Enable” checkbox is checked to activate the event subscription.
- Save Changes: Click on the “Add subscription” button to save the event subscription settings.
- Verify Configuration: Once the event subscription is added, verify that the Event Notifications are now enabled for the RDS instance by checking the Event Subscriptions section in the RDS instance details page.
Using CLI
To remediate the misconfiguration of Event Notifications not being enabled for AWS RDS using AWS CLI, you can follow these steps:-
List Current Event Subscriptions: First, you need to list the current event subscriptions to check if there are any existing subscriptions. You can use the following AWS CLI command:
-
Enable Event Notifications: If there are no existing event subscriptions or if the required event notification is not enabled, you can enable event notifications for RDS by creating a new event subscription. Use the following AWS CLI command to create a new event subscription:
- Replace
<subscription-name>with a unique name for the event subscription. - Replace
<sns-topic-arn>with the ARN of the SNS topic to which you want to send the notifications. - Replace
<rds-instance-identifier>with the identifier of the RDS instance for which you want to enable event notifications. - Replace
<event-category>with the specific event categories you want to receive notifications for (e.g., “configuration change”, “failover”, “backup”, etc.).
- Replace
- Verify Event Subscription: After creating the event subscription, you can verify if the event notifications are successfully enabled by listing the event subscriptions again using the command in step 1.
Using Python
To remediate the misconfiguration of Event Notifications not being enabled for AWS RDS using Python, you can follow these steps:- Import the necessary libraries:
- Create an AWS RDS client:
- Enable Event Notifications for the specific RDS instance:
'YOUR_REGION', 'YOUR_DB_INSTANCE_IDENTIFIER', and 'YOUR_SNS_TOPIC_ARN' with your actual AWS region, RDS instance identifier, and SNS topic ARN respectively.
- Verify that Event Notifications have been successfully enabled by checking the RDS instance details or the CloudWatch Events console.
Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
Below are concise, step‑by‑step instructions to enable RDS event notifications using the AWS Management Console.
1. Create or Identify an SNS Topic
- Sign in to the AWS Management Console.
- Go to Amazon SNS:
- In the search bar, type
SNSand open Simple Notification Service.
- In the search bar, type
- Create a topic (if you don’t already have one):
- In the left menu, select Topics → Create topic.
- Choose Standard topic.
- Enter a Name (e.g.,
rds-event-notifications). - Leave other settings default unless you have specific requirements.
- Click Create topic.
- Create a subscription to that topic:
- Open the topic you just created.
- Click Create subscription.
- Protocol: choose how you want to receive notifications (e.g.,
Email). - Endpoint: enter your email address (or endpoint).
- Click Create subscription.
- Confirm the subscription if needed (e.g., click confirmation link in email).
2. Create an RDS Event Subscription
- In the console, go to Amazon RDS:
- In the search bar, type
RDSand open RDS.
- In the search bar, type
- In the left navigation pane, click Event subscriptions.
- Click Create event subscription.
- Configure the subscription:
- Name: e.g.,
rds-instance-events. - Target (SNS topic): select the SNS topic you created (e.g.,
rds-event-notifications).
- Name: e.g.,
- Choose Source type based on what you want to monitor:
- Common options:
DB instance,DB cluster,DB parameter group, etc.
- Common options:
- Select Event categories:
- You can select broad options like Availability, Backup, Configuration change, Failure, Notification, Restoration, etc.
- For compliance, it’s typical to include at least:
Availability,Configuration change, andFailure.
- Select the Source:
- Either:
- All instances (or all sources of that type), or
- Specific DB instances / clusters you want to monitor.
- Either:
- Ensure Enabled is checked so the subscription is active immediately.
- Click Create.
3. Validate Notifications
- Trigger or wait for an event (e.g., modify a DB instance configuration or restart the instance).
- Confirm you receive a notification via your chosen SNS subscription (email, etc.).
Using CLI
Using CLI
Below are step‑by‑step AWS CLI commands to enable RDS Event Notifications using Amazon SNS.Assumptions:
Note the
Then:
Ensure
To target only specific instances, add
Check that:
- You have AWS CLI configured with proper permissions.
- You want email notifications (most common).
1. Create an SNS Topic
TopicArn from the output (e.g. arn:aws:sns:us-east-1:123456789012:rds-event-notifications).2. Subscribe Your Email to the Topic
- Check your email.
- Confirm the subscription by clicking the link.
3. (Optional) Verify Subscription
SubscriptionArn is not PendingConfirmation.4. Create an RDS Event Subscription
Choose:--source-type=db-instance|db-cluster|db-parameter-group| etc.--event-categorieslist, such as:availability,backup,creation,deletion,failover,failure,maintenance,notification,restoration.
--source-ids:5. Confirm Subscription Status
StatusisactiveEnabledistrue
Using Python
Using Python
Below is a straightforward way to enable RDS event notifications using Python (boto3).
Then:
Check that:
1. Prerequisites
-
Install boto3:
-
Configure AWS credentials with permission to:
rds:CreateEventSubscriptionrds:ModifyEventSubscriptionrds:DescribeDBInstancessns:CreateTopicsns:Subscribesns:SetTopicAttributesiam:CreateRole/iam:AttachRolePolicy(if needed)
-
Decide:
- Which RDS instances/clusters you want notifications for.
- Which email(s) or HTTPS endpoint will receive notifications.
2. Create or Reuse an SNS Topic
3. Subscribe Email (or Other Endpoint) to SNS Topic
- Check the email inbox and confirm the subscription from AWS.
4. Allow RDS to Publish to the SNS Topic (Optional Explicit Policy)
Often not needed if default permissions are fine, but to be explicit:5. Enable RDS Event Notifications via Event Subscription
You usually:- Select event categories (e.g., availability, configuration change, backup).
- Select
SourceType(e.g.,db-instance,db-cluster,db-parameter-group). - Select specific DB identifiers, or leave empty to cover all in the region.
6. Verify the Subscription
EnabledisTrue.Statusbecomesactive.SnsTopicArnis correct.EventCategoriesListandSourceTypematch your needs.
7. Test
Trigger a test scenario, for example:- Modify an RDS instance parameter or configuration.
- Perform a manual snapshot or reboot. You should receive an email notification via SNS for the corresponding RDS event.
Using Terraform
Using Terraform
terraform plan should show + (create) for aws_sns_topic.rds_events, optionally aws_sns_topic_subscription.rds_events_email, and aws_db_event_subscription.rds_event_subscription with enabled = true and your chosen event_categories/source_type.
