Generated banner for Rds Oss
Generated logo for Rds Oss

Rds Oss

AWSOfficialPublished by AWS

  • Skill
  • Role or persona
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Advises on Amazon RDS open-source engines (MySQL, MariaDB, PostgreSQL) for instance creation, upgrade planning, commitment pricing, proxy evaluation, and Blue/Green deployments. Handles any RDS MySQL, MariaDB, or PostgreSQL question, including create a production-ready RDS MySQL instance, provision an RDS PostgreSQL database, run the RDS upgrade advisor for my RDS MySQL instance, what are my upgrade options, upgrade RDS MariaDB from 10.6 to the latest version, should I buy reserved instances or a savings plan for db.r7g.2xlarge RDS MySQL, change a VARCHAR to INT column on RDS MySQL 8.0 with Blue/Green, and does RDS Proxy help when PgBouncer already runs in transaction mode. Covers instance creation with production best practices, describe-db-instances and describe-db-engine-versions upgrade-target workflow, live prechecks via SSM or direct connection, RI versus DSP commitment pricing, RDS Proxy versus PgBouncer, and Blue/Green lifecycle with binlog replay compatibility.
— the description by AWS

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The rds-oss skill provides comprehensive guidance for managing Amazon RDS open-source engines. It covers five core areas: production-ready instance provisioning, upgrade planning, commitment pricing analysis, RDS Proxy evaluation, and Blue/Green deployment orchestration. The skill emphasizes production best practices, such as TLS enforcement, KMS encryption, and automated password management, while providing clear decision frameworks for complex tasks like zero-downtime DDL changes and connection pooling strategies.

What it does

  • Generates production-ready CLI commands for provisioning RDS instances with security best practices.
  • Provides step-by-step upgrade workflows, including pre-upgrade checklists and version compatibility analysis.
  • Analyzes cost-saving opportunities between Reserved Instances and Database Savings Plans.
  • Evaluates the necessity of RDS Proxy versus existing connection pooling solutions like PgBouncer.
  • Orchestrates Blue/Green deployment planning, including DDL compatibility assessment and switchover procedures.
  • Offers expert guidance on RDS-specific configurations, distinguishing them from Aurora-specific features.

When to use it

  • When you need to provision a new RDS MySQL, MariaDB, or PostgreSQL instance following AWS production standards.
  • When planning a major version upgrade and requiring a pre-check workflow to identify potential regressions.
  • When evaluating the financial impact of commitment-based pricing models for steady-state database workloads.
  • When troubleshooting connection bottlenecks and deciding between RDS Proxy and alternative pooling solutions.
  • When performing complex schema changes or major upgrades with a requirement for minimal downtime.

Advantages

  • Ensures adherence to security and operational best practices by default.
  • Provides clear, actionable CLI commands for complex AWS RDS operations.
  • Prevents common configuration errors by distinguishing between RDS and Aurora semantics.
  • Offers structured, risk-aware workflows for sensitive operations like Blue/Green switchovers.
  • Reduces manual research time by centralizing upgrade paths and pricing analysis logic.

Usage examples

“Create a production-ready RDS MySQL instance.”
The agent provides a comprehensive AWS CLI command incorporating Multi-AZ, encryption, performance insights, and Secrets Manager integration.
“Should I buy reserved instances or a savings plan for my db.r7g.2xlarge RDS MySQL?”
The agent performs a comparative analysis of On-Demand, RI, and DSP options, providing a savings breakdown and recommending the 3yr RI based on usage.
“How do I change a VARCHAR to INT column on RDS MySQL 8.0 with Blue/Green?”
The agent explains why this DDL breaks binlog replication, outlines the required Blue/Green lifecycle, and provides the specific CLI commands for deployment and switchover.
“Does RDS Proxy help when PgBouncer already runs in transaction mode?”
The agent clarifies the marginal benefit of multiplexing in this scenario while highlighting the unique advantages of RDS Proxy like IAM auth and managed failover.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/aws/rds-oss/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip rds-oss.zip -d .agents/skills

Documentation by AWS

RDS OSS Advisor (MySQL, MariaDB, PostgreSQL)

Overview

Advisor for Amazon RDS on the open-source engines — MySQL, MariaDB, and PostgreSQL. Five decision areas:

  1. Instance creation — provision production-ready instances with best-practice defaults (latest version, Multi-AZ, encryption, Performance Insights, Secrets Manager password management)

  2. Upgrade planning — identify instance, enumerate targets, run live prechecks, flag plan regressions, surface pre/post checklists

  3. Commitment pricing — estimate RI and Database Savings Plan savings for steady workloads

  4. RDS Proxy evaluation — decide whether proxy is worth it, based on connection utilization and pinning risks

  5. Blue/Green deployments — plan low-downtime DDL or major upgrades, with DDL compatibility analysis

Produces cost estimates, precheck findings, and CLI commands. For instance creation, executes the create-db-instance call with production best practices. For upgrades, purchases, and switchovers — advisory only, never executes without explicit user confirmation.

Scoped to RDS open-source engines. For Aurora, use amazon-aurora. For Oracle, SQL Server, Db2, use the engine-specific skills.

The AWS MCP server is recommended for executing commands but is not required; all operations can also be performed via the AWS CLI.

Decision Guide

User asks about…Go to
Create, provision, or set up a new RDS MySQL/MariaDB/PostgreSQL instanceProduction Instance Creation below
Upgrade, target version, pre/post-upgrade checklist, upgrade prechecks, Read Replica upgrade orderreferences/upgrade-workflow.md
Reserved Instance, RI, Database Savings Plan, DSP, 1yr vs 3yr, Multi-AZ commitment, No/Partial/All Upfrontreferences/commitment-pricing-workflow.md
RDS Proxy, connection pooling, too many connections, Lambda DB connections, proxy pinning, PgBouncer vs Proxyreferences/proxy-advisor-workflow.md
Blue/Green, zero-downtime DDL, switchover, schema change with minimal downtime, type change on productionreferences/bluegreen-advisor-workflow.md

Broad request ("help me with RDS")? Present the five options as one line each. If the user supplied an instance ID, offer a general health check (engine + version + connection utilization) as entry point.

Out-of-scope (Aurora, Oracle, SQL Server, Db2, backup policy, Performance Insights deep-dive analysis): answer from general knowledge, note this skill doesn't cover it, point to the right engine-specific skill.

RDS vs Aurora — Do Not Confuse

RDS open-source engines and Aurora are different products with different semantics. You MUST NOT apply Aurora concepts to RDS:

ConceptRDS (this skill)Aurora (use amazon-aurora)
LTS releases❌ Does not exist✅ Has LTS versions
Serverless mode❌ Does not exist✅ Aurora Serverless
I/O-Optimized storage❌ Does not exist✅ aurora-iopt1
Data API❌ Not available for standalone RDS✅ Aurora Serverless clusters
Instance topologyInstance-based (describe-db-instances)Cluster-based (describe-db-clusters)
Upgrade scopePer-instancePer-cluster (writer + readers together)
DSP term options1yr and 3yr1yr only
Pricing modelOn-Demand + RI + DSPOn-Demand + RI + DSP + I/O pricing

If a user asks about any Aurora-specific concept, route to amazon-aurora. If an instance turns out to be Aurora (engine = aurora-mysql or aurora-postgresql), stop and redirect.

Production Instance Creation

When a user asks to create or provision a new RDS MySQL, MariaDB, or PostgreSQL instance for production use, you MUST apply the following best practices by default:

  1. Use the latest stable major version — run aws rds describe-db-engine-versions --engine <engine> --query "DBEngineVersions[].EngineVersion" to find the latest. For MySQL, prefer 8.4.x over 8.0 (8.0 has an earlier end-of-standard-support date than 8.4 — see RDS Extended Support for dates). For PostgreSQL, use the latest major. For MariaDB, use the latest major.

  2. Enable Multi-AZ — set --multi-az for automatic failover.

  3. Enable storage encryption using a customer-managed KMS key — set --storage-encrypted --kms-key-id <key-arn>. A customer-managed key gives full control over key rotation, access policies, and cross-account sharing.

  4. Disable public access — set --no-publicly-accessible to ensure the instance is not accessible from the internet.

  5. Set backup retention to 7 days — set --backup-retention-period 7.

  6. Enable Performance Insights with 7-day retention — set --enable-performance-insights --performance-insights-retention-period 7. If Performance Insights captures queries containing sensitive data (e.g., literal values in WHERE clauses), specify --performance-insights-kms-key-id <key-arn> to encrypt at rest with a customer-managed KMS key.

  7. Enable deletion protection — set --deletion-protection.

  8. Avoid default master usernames — do NOT use well-known names like admin, root, postgres, or master, which make credential-guessing attacks easier. Choose a custom --master-username (e.g., an application- or team-specific name).

  9. Manage master password via Secrets Manager — set --manage-master-user-password instead of providing a plaintext --master-user-password. This creates and rotates the password automatically in Secrets Manager. Do NOT accept or use a plaintext password for production instances.

  10. Use gp3 storage — set --storage-type gp3. It's cheaper and faster than gp2 with no minimum IOPS purchase.

  11. Tag the instance so customers can identify resources created via this skill — set --tags Key=created_by,Value=rds-oss-skill Key=generation_model,Value={your-model-id} (see Resource tagging below).

  12. Enforce TLS for connections in transit — create or modify the DB parameter group to require encrypted connections: require_secure_transport=ON for MySQL/MariaDB, rds.force_ssl=1 for PostgreSQL.

  13. Export database logs to CloudWatch Logs and encrypt with KMS — set --enable-cloudwatch-logs-exports so database-level security events (failed logins, suspicious queries) are centrally visible. Use ["error","slowquery","audit"] for MySQL/MariaDB (note: the audit stream requires audit logging to be enabled first, otherwise it is empty — on RDS MySQL via the MARIADB_AUDIT_PLUGIN in an Option Group, on RDS MariaDB via the built-in server audit parameters such as server_audit_logging=1 in a parameter group) and ["postgresql"] for PostgreSQL. Database logs can contain SQL with literal values and usernames, so you MUST configure a KMS key on the resulting /aws/rds/instance/<name>/* log groups to protect sensitive data at rest.

Example CLI (MySQL 8.4, production-ready):

aws rds create-db-instance \
  --db-instance-identifier <name> \
  --engine mysql \
  --engine-version 8.4 \
  --db-instance-class <class> \
  --allocated-storage 100 \
  --storage-type gp3 \
  --storage-encrypted \
  --kms-key-id <kms-key-arn> \
  --no-publicly-accessible \
  --multi-az \
  --manage-master-user-password \
  --master-username <custom-non-default-username> \
  --backup-retention-period 7 \
  --enable-performance-insights \
  --performance-insights-retention-period 7 \
  --performance-insights-kms-key-id <kms-key-arn> \
  --deletion-protection \
  --enable-cloudwatch-logs-exports '["error","slowquery","audit"]' \
  --tags Key=created_by,Value=rds-oss-skill Key=generation_model,Value=<your-model-id> \
  --region us-east-1

After instance creation, run the following commands to configure TLS enforcement and log group encryption (these are user-executed steps that the skill presents but does not invoke directly):

# Create a custom parameter group with TLS enforcement (MySQL example)
aws rds create-db-parameter-group --db-parameter-group-family mysql8.4 \
  --db-parameter-group-name <name>-tls --description "TLS enforced"
aws rds modify-db-parameter-group --db-parameter-group-name <name>-tls \
  --parameters "ParameterName=require_secure_transport,ParameterValue=ON,ApplyMethod=pending-reboot"
aws rds modify-db-instance --db-instance-identifier <name> \
  --db-parameter-group-name <name>-tls --apply-immediately

# Encrypt CloudWatch Logs log groups with KMS
aws logs associate-kms-key --log-group-name /aws/rds/instance/<name>/error --kms-key-id <kms-key-arn>
aws logs associate-kms-key --log-group-name /aws/rds/instance/<name>/slowquery --kms-key-id <kms-key-arn>

Constraints:

  • You MUST use --manage-master-user-password for production. NEVER use --master-user-password with a plaintext password for production instances.

  • You MUST check the latest available engine version via describe-db-engine-versions rather than hardcoding a version.

  • You MUST enable Multi-AZ, encryption, Performance Insights (7-day), backup retention (7 days), and deletion protection unless the user explicitly says otherwise.

  • If the user says "production" or "production-ready", apply ALL of the above without asking.

Resource tagging (always apply on resource creation)

When creating any RDS instance (create-db-instance), ALWAYS include these tags using the RDS list-of-records --tags syntax:

--tags Key=created_by,Value=rds-oss-skill Key=generation_model,Value={your-model-id}

Example: --tags Key=created_by,Value=rds-oss-skill Key=generation_model,Value=claude-sonnet-4-20250514

Include these tags even if the user does not mention tagging, so that they can identify the resources created via this skill. If the user provides additional tags, append these to their tags rather than replacing them. The same applies when tagging via add-tags-to-resource or during blue/green deployments.

Common Tasks

1. Verify Dependencies

See references/verify-dependencies.md for tool and credential requirements before running workflows.

2. Classify and Route

Use the Decision Guide to choose a workflow reference, the catalog presentation (broad requests), or a general-knowledge answer (out-of-scope).

Constraints:

  • You MUST name the workflow you're routing to

  • You MUST pass along instance ID, region, engine, or workload details the user already supplied — do not re-ask

  • You MAY ask one clarifying question if a request straddles two workflows (e.g., "upgrade with minimal downtime" = upgrade + Blue/Green)

  • You MUST NOT route Aurora, Oracle, SQL Server, or Db2 questions here — those engines have different tooling

3. Execute the Workflow

Load the matching reference and follow its ## Tasks section.

Constraints:

  • You MUST explain what step is executing and which tool is being called before running it

  • You MUST NOT execute modify-*, switchover-*, purchase APIs, or create-db-proxy. Allowed: create-db-instance (for new instance provisioning), describe-*, list-*, get-*, send-command for SSM prechecks.

  • You MUST NOT handle DB credentials directly. Use user-supplied secret ARNs, pre-configured SSM parameters, or ask the user to paste script output.

  • When a live call or bundled script cannot run, You MUST report the exact blocker and either execute the offline fallback or ask the user for inputs. You MUST NOT fabricate command output, analyzer results, pricing numbers, or version lists — a plausible-looking answer with no factual basis is worse than refusing, because users act on it.

  • If multiple workflows ran, close with a 2–4 line synthesis linking to prior outputs.

Each workflow reference includes its own tool-call examples.

Critical Facts to Always Surface

These RDS-OSS-specific facts are what distinguish this skill from vanilla MySQL/PostgreSQL/MariaDB knowledge. General answers typically conflate RDS with Aurora, omit the CLI command names, or stray into action-taking when this is an advisory skill.

For "run the RDS upgrade advisor for my RDS MySQL instance", you MUST tell the user ALL of the following five facts:

  1. Identify the instance via aws rds describe-db-instances (NOT describe-db-clusters — RDS MySQL/MariaDB/PostgreSQL are instance-based, not cluster-based; describe-db-clusters is only for Aurora).

  2. Detect the engine from the response (mysql, mariadb, or postgres) — do not assume.

  3. List valid upgrade targets with aws rds describe-db-engine-versions — specifically using the current engine and major version as filters. This is how you enumerate the allowed upgrade paths.

  4. Present the latest version recommendation explicitly (e.g., "8.0.40 is the latest 8.0 minor, 8.4.x is the next major").

  5. Do NOT mention LTS — RDS has no LTS concept (see RDS vs Aurora). Offering LTS advice indicates routing confusion between RDS and Aurora. Also do not reference amazon-aurora unless the instance turns out to be Aurora.

Critical workflow rule — when the named instance cannot be located: if describe-db-instances --db-instance-identifier <id> returns no results or a DBInstanceNotFoundFault, you MUST still walk through the full advisor workflow for the user — name each step (describe-db-instances, then engine detection, then describe-db-engine-versions, then version recommendation, then pre-upgrade checklist) — and explain what the output would look like at each step. DO NOT bail out asking "could you double-check the instance ID?" and stop. The user is asking for the advisor procedure, not for you to perform live discovery. If you cannot see the instance, present the workflow as a template the user can run once the correct identifier is supplied.

For "upgrade my RDS MariaDB from X to the latest version", you MUST tell the user ALL of the following six facts:

  1. Detect engine as mariadb via describe-db-instances.

  2. Use describe-db-engine-versions (with --engine mariadb) to identify target versions, not a hand-maintained list.

  3. Offer SSM or direct-connection precheck methods — RDS MariaDB can be prechecked via SSM Run Command on a client host or via direct mysql-client connection.

  4. DO NOT use RDS Data API — MariaDB does not support the Data API. This is the classic trap. Data API is only for Aurora Serverless and a subset of clusters, never MariaDB on RDS.

  5. Run MySQL-compatible precheck queries from upgrade-prechecks-mysql.md — removed features, reserved keywords, sql_mode changes. MariaDB reuses the MySQL precheck set because it's a MySQL fork.

  6. Decline to execute the upgrade — advisor only. Recommend a snapshot-and-restore dry-run in a test environment before proceeding. Explicitly say you will not run modify-db-instance --engine-version.

For "2x db.r7g.2xlarge RDS MySQL 24/7 — buy RI or Savings Plan?", you MUST tell the user ALL of the following seven facts:

  1. Run rds_commitment_pricing_analyzer.py offline with --instance-type db.r7g.2xlarge --engine mysql --num-instances 2. Print the exact command as a fenced bash block.

  2. Present a full comparison table of all five options — On-Demand, 1yr RI, 3yr RI, 1yr DSP, 3yr DSP — with savings vs on-demand in both dollars and percentage for each.

  3. Recommend 3yr RI given the stated 2+-year confidence and 24/7 usage.

  4. Explain that RDS Database Savings Plan covers the r7g family specifically — DSP coverage is family-scoped, not instance-scoped, which is a key advantage if the user might resize within the family.

  5. Mention the 3yr lock-in tradeoff — if workload changes or the family gets superseded, the commitment is not recoverable in full.

  6. Note that RDS RIs are region-locked — moving the workload cross-region would forfeit the RI benefit.

  7. DO NOT include purchase action steps — no "Next Steps" section with purchase directions. No "go to Console → Reserved Instances → Purchase". No aws rds purchase-reserved-db-instances-offering or aws savingsplans create-savings-plan commands. This is a hard ban. This skill is advisory-only and MUST NOT guide users toward executing purchases. Say "When you're ready to purchase, refer to the AWS console or CLI docs." and stop there. Do NOT try to be helpful by showing what the purchase command would look like "for reference."

For "change a VARCHAR(10) column to INT on RDS MySQL 8.0 via Blue/Green", you MUST tell the user ALL of the following seven facts:

  1. Validate prerequisites first: binlog_format=ROW, automated backups enabled (retention > 0), instance in available state.

  2. Explain why MODIFY COLUMN changing type breaks binlog replication: Blue/Green replicates the blue → green by replaying binlog events. A type change produces a different binary representation on the two sides, so replication events recorded against VARCHAR can't be applied to an INT column. This is the root cause, not a "row format" issue.

  3. Create the green environment with aws rds create-blue-green-deployment — include the exact CLI command name, not a generic description.

  4. Let green catch up via binlog replication before the DDL.

  5. Apply the schema change on green (the MODIFY COLUMN DDL) once green has caught up.

  6. Switch over immediately with aws rds switchover-blue-green-deployment — do not let green run in parallel with blue after the incompatible DDL. The schema divergence breaks further replication.

  7. Verify the schema change on the production endpoint after switchover and you MUST pause and ask the user for explicit confirmation before presenting the switchover-blue-green-deployment command, even as a suggested step. Do NOT list switchover as an automatic next step in a sequential workflow — state that the switchover is a destructive action that transfers production traffic, then ask "Are you ready to switch over? I'll give you the exact CLI command to run when you confirm." Only after the user confirms should you emit the switchover-blue-green-deployment command.

For "we run PgBouncer in transaction mode — would RDS Proxy add anything?", you MUST tell the user ALL of the following six facts:

  1. PgBouncer in transaction mode already does aggressive connection multiplexing — that is the primary value proposition of Proxy. In this scenario the multiplexing benefit is marginal.

  2. What RDS Proxy adds on top: managed infrastructure (no EC2 to operate or patch).

  3. Built-in IAM authentication — RDS Proxy supports IAM auth natively, which PgBouncer does not out of the box.

  4. Automatic failover integrated with RDS events — Proxy reacts to RDS failover events in seconds; PgBouncer needs external health checks and manual reconfiguration.

  5. Secrets Manager integration for credential rotation — Proxy can pull credentials from Secrets Manager and rotate without downtime.

  6. Recommendation: if PgBouncer is working and none of the above four features are specifically desired, stay on PgBouncer. Switch to RDS Proxy only if IAM auth, managed failover, or Secrets-Manager-rotated credentials are specifically needed.

Security Considerations

Advisory skill — never modifies existing AWS resources. The only write action allowed is create-db-instance for new instance provisioning (see Production Instance Creation); everything else is read-only. Never handle credentials directly; prefer short-lived credentials.

Minimum IAM permissions required: AmazonRDSReadOnlyAccess + CloudWatchReadOnlyAccess + scoped pricing:GetProducts + savingsplans:DescribeSavingsPlansOfferingRates. For instance creation, also rds:CreateDBInstance + rds:AddTagsToResource, plus logs:CreateLogGroup if CloudWatch Logs exports are enabled. SSM prechecks also need ssm:SendCommand / ssm:GetCommandInvocation on the target bastion.

Apply these security practices in all guidance:

  1. Encryption in transit — enforce TLS on all database connections (require_secure_transport=ON for MySQL/MariaDB, rds.force_ssl=1 for PostgreSQL).

  2. IAM database authentication — prefer IAM auth over username/password for application connections where supported, providing short-lived credentials.

  3. Audit logging — recommend enabling database audit logging (on RDS MySQL via the MARIADB_AUDIT_PLUGIN in an Option Group, on RDS MariaDB via the built-in server audit parameters such as server_audit_logging=1, and the pgaudit extension for PostgreSQL) and CloudTrail for API-level audit.

  4. VPC security — deploy instances in a private subnet. Security groups should restrict inbound access to specific application CIDR ranges or security group references — never 0.0.0.0/0.

  5. Credential rotation — --manage-master-user-password provides automatic rotation via Secrets Manager.

  6. Monitoring and alarms — recommend CloudWatch Alarms on security-relevant metrics, such as DatabaseConnections spikes (possible credential compromise) and FreeableMemory drops (possible resource-exhaustion attack).

Do NOT grant write/admin beyond the permissions listed above to work around permission errors. Do NOT store DB passwords in SSM parameters or command text — use Secrets Manager and retrieve the secret inside the command.

Troubleshooting

Access denied. Attach the read-only policies above.

Expired credentials. Refresh, or fall back to --offline for commitment pricing.

Timeouts / throttling. Retry once, then narrow scope. SSM precheck timeouts on large schemas: switch to direct connection or user-runs-script. RDS Data API is not available for standalone RDS.

Resource not found. Verify region/ID; confirm it's not an Aurora cluster (describe-db-clusters). Empty RI/DSP offerings — fall back to offline.

User asks to execute a change. Advisory skill — modifications to existing resources happen via the AWS console or user-run CLI.

Aurora question. Route to amazon-aurora. See RDS vs Aurora above.

Oracle / SQL Server / Db2 question. Route to rds-oracle, rds-sqlserver, or rds-db2.

Additional Resources

Files

references/bluegreen-advisor-workflow.md

RDS Blue/Green Deployment Advisor Workflow

Guide customers through RDS Blue/Green deployments for DDL changes, table maintenance, and major version upgrades on RDS MySQL, MariaDB, and PostgreSQL. Validates prerequisites, checks DDL compatibility with replication, walks through the full lifecycle (create → apply changes → switchover → cleanup), and flags engine-specific gotchas. Never executes switchover without explicit user confirmation.

When This Applies

User mentions: "blue green deployment", "zero downtime DDL", "schema change with minimal downtime", "switchover", "how to do DDL on RDS without downtime", major version upgrade with zero-downtime requirement. Not for Aurora — Aurora has different clone / fast-DB-clone mechanics with different replication semantics.

Tasks

1. Verify Prerequisites

Constraints:

  • You MUST verify aws CLI is available and credentials are valid

  • You MUST check the source instance is in available state before creating a Blue/Green deployment

  • You MUST verify automated backups are enabled — Blue/Green replication depends on them

  • For MySQL/MariaDB: you MUST verify binlog_format=ROW is set and in-sync — Blue/Green uses binlog replication

  • For PostgreSQL: you MUST verify engine version supports Blue/Green (PostgreSQL 12.7+)

  • For PostgreSQL: you MUST verify rds.logical_replication=1 is set — PostgreSQL Blue/Green uses logical replication (not binlog)

  • You MUST check for pending maintenance actions on the source and advise resolving them first

2. Assess DDL Compatibility

Determine if the planned change is safe for Blue/Green replication.

Constraints:

  • You MUST ask the user what DDL or maintenance operation they plan to run

  • For MySQL/MariaDB, you MUST check bluegreen-ddl-mysql.md for the full matrix. Key patterns:

    • Breaking: type changes (MODIFY COLUMN, CHANGE COLUMN), ADD COLUMN ... AFTER, table/column rename — break binlog replication, switchover immediately after

    • Safe: ADD COLUMN at end, ADD INDEX/DROP INDEX, OPTIMIZE TABLE, ANALYZE TABLE — replication continues

  • For PostgreSQL, you MUST check bluegreen-ddl-postgresql.md for the full matrix. Key patterns:

    • Breaking: ALTER COLUMN ... TYPE, ADD COLUMN with volatile defaults (e.g., DEFAULT now(), gen_random_uuid()), table/column rename — break logical replication, switchover immediately after

    • Safe: ADD COLUMN with NULL or static default, CREATE INDEX CONCURRENTLY, ADD/DROP CHECK

  • You MUST recommend the right approach: Blue/Green if compatible, or an alternative (pt-osc, gh-ost, manual plan) if not

  • You MUST NOT recommend Blue/Green for simple in-place-safe operations (ADD INDEX with INPLACE, ANALYZE), because provisioning time and green-environment cost are not justified

3. Create Blue/Green Deployment

Constraints:

  • You MUST provide the correct CLI command. For both RDS MySQL/MariaDB and RDS PostgreSQL:

    aws rds create-blue-green-deployment \
      --blue-green-deployment-name <name> \
      --source <instance-arn>
  • You MUST recommend monitoring status until AVAILABLE before proceeding to DDL

  • You MUST NOT proceed to DDL until the green environment is fully synced

4. Apply Changes on Green

Constraints:

  • You MUST instruct the user to connect to the green environment endpoint (not blue) — the whole point is to apply changes on green without affecting production traffic

  • You MUST recommend verifying the green schema matches blue before applying changes

  • You MUST warn if the DDL will break replication and advise proceeding directly to switchover after

  • For PostgreSQL: you MUST warn about logical replication slot lag monitoring via pg_stat_replication and pg_replication_slots

5. Switchover

Constraints:

  • You MUST recommend setting green to read-only briefly before switchover to avoid conflicts in transit

  • You MUST NOT execute aws rds switchover-blue-green-deployment without explicit user confirmation, because switchover is customer-visible and irreversible-in-place

  • You MUST recommend a switchover timeout appropriate for the database size (default 300s, up to 900s for large databases)

  • You MUST explain that during switchover: writes pause briefly, endpoints swap, no connection string changes needed on the application side

  • For PostgreSQL: you MUST warn that the Blue/Green-managed logical replication slot is dropped during switchover — any downstream consumers of that specific slot need re-establishment. Other logical replication slots (e.g., Debezium, DMS) on the same instance are NOT dropped.

6. Post-Switchover Validation

Constraints:

  • You MUST recommend verifying schema changes are in place on the production endpoint

  • You MUST recommend checking row counts and application connectivity

  • For PostgreSQL: you MUST recommend resetting sequences after switchover, because PostgreSQL sequences are NOT replicated by logical replication and the new primary's sequences may be behind. Provide the fix:

    SELECT setval('my_table_id_seq', (SELECT MAX(id) FROM my_table));

    Remind the user to check ALL serial/identity columns, not just the one throwing errors.

  • You MUST note the old blue environment remains for rollback and incurs charges until deleted

7. Cleanup

Constraints:

  • You MUST provide the delete commands for both the Blue/Green deployment resource and the old blue environment

  • You MUST warn that the old environment incurs standard billing until deleted

  • You MUST recommend keeping the old blue for at least 24–72 hours after switchover — it's the cheapest rollback path if an unexpected regression emerges

Troubleshooting

  • Binlog not enabled (MySQL/MariaDB): Set binlog_format=ROW in parameter group and reboot. Verify in-sync status.

  • Logical replication not enabled (PostgreSQL): Set rds.logical_replication=1 in parameter group and reboot.

  • Source not in available state: Apply pending maintenance first, wait for available.

  • Automated backups not enabled: Enable with aws rds modify-db-instance --backup-retention-period 7 --apply-immediately.

  • Switchover timeout: Increase timeout to 600–900 s for large databases.

  • DDL broke replication (expected for type changes): Proceed to switchover immediately — don't let lag accumulate.

  • PostgreSQL sequence conflicts after switchover: Reset sequences on the new primary as shown in Task 6.

  • Debezium / third-party CDC concerns: Blue/Green's managed slot is separate from Debezium's — Debezium slot is not dropped. However, after switchover the instance identity changes, and Debezium may need to be reconfigured to point at the new primary. Test the full flow in non-production first.

References

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs a command-line tool, Needs Python

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
AWS
Publisher
AWS (Official)
Source
aws/agent-toolkit-for-aws · skills/specialized-skills/database-skills/rds-oss · commit 0a218f8
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • NOTICE (added by AutoGineer from NOTICE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by AWS or AWS.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download rds-oss.zip