Attempting to govern a mixed fleet of Amazon RDS, RDS Custom, and self-managed EC2 Oracle databases with ad-hoc SSH scripts guarantees Support Perimeter lockouts, security blind spots, and fractured observability.

TL;DR

  • Problem: Uncoordinated OS agent installs on RDS Custom breach the AWS Support Perimeter (unsupported-configuration), halting automated backups and point-in-time recovery, while SSH keys across EC2 violate Zero Trust audit controls.
  • Answer: Standardize host execution on AWS Systems Manager (SSM) with AutomationMode='all-paused' wrappers and /opt cgroups v2 sandboxes for RDS Custom and EC2, and route Standard RDS telemetry through CloudWatch Metric Streams (opentelemetry1.0).
  • Watch out: ResumeFullAutomationModeMinutes accepts 60 to 1,440 minutes (never 30), unfiltered metric streams inflate Kinesis Firehose ingest costs, and agents binding TCP port 1521 block the Oracle Listener.

Shared responsibility boundaries across Amazon RDS, RDS Custom, and EC2 for Oracle

Situation

Organizations migrating Oracle portfolios to Amazon Web Services (AWS) rarely land on a single hosting model. Cloud-native microservices fit managed services, packaged COTS applications (SAP, PeopleSoft, Siebel) often require OS-level filesystem paths or root access, and high-throughput transactional monoliths may need custom kernel hugepages, ASM striping, or Data Guard configurations. Across AWS, those workloads split into three operational paradigms:

  1. Amazon RDS for Oracle (Managed): AWS owns the host, Linux OS, storage striping, and database binary patching. Administration is restricted to database-level PL/SQL APIs (rdsadmin), with no OS shell or root access.
  2. Amazon RDS Custom for Oracle (Co-Managed): AWS preserves automated backups, snapshots, and Multi-AZ storage replication while granting Linux root access and SYSDBA. That co-managed automation relies on an active Support Perimeter enforced by an AWS health monitor on the host.
  3. Self-Managed Oracle on Amazon EC2 (IaaS): The customer owns the entire stack—OS patching, Oracle ASM across Amazon EBS (gp3 or io2 Block Express), kernel parameters, Data Guard Broker, and RMAN backups.

When security teams mandate fleet-wide endpoint detection agents and unified APM telemetry, platform engineers must deploy and observe all three tiers without breaking managed invariants.

The Problem

Managing these three tiers with bastion SSH keys, cron-based shell scripts, and separate monitoring pipelines fails against four operational constraints:

  • Constraint 1 — RDS Custom Support Perimeter Invariants: AWS continuously polls the underlying EC2 host of every RDS Custom instance to verify that /rdsdbdata, /rdsdbbin, network routing, IAM instance profiles, the AmazonSSMAgent service, and the port 1521 listener remain intact. An uncoordinated package install that restarts sshd improperly, mutates /rdsdbdata, or interrupts SSM connectivity transitions the instance to unsupported-configuration. Once flagged, AWS halts automated backups, impairs point-in-time recovery (PITR), and blocks manual snapshots and host replacement until remediated.
  • Constraint 2 — Minimum Automation Pause Window: AWS exposes AutomationMode='all-paused' to suspend perimeter checks during maintenance, but ResumeFullAutomationModeMinutes enforces a valid range of 60 to 1,440 minutes (default 60). Scripts that pass values below 60 fail API validation; scripts that omit a finally resume block leave backups paused for the full timer window.
  • Constraint 3 — SGA/PGA Resource Isolation: Oracle workloads pin large memory regions in hugepages for the System Global Area (SGA) and Program Global Area (PGA). An uncapped third-party security or log-shipping daemon that spikes CPU or buffers multi-gigabyte trace files can trigger Linux OOM kills against Oracle background processes (LGWR, DBW0), crashing the instance.
  • Constraint 4 — Zero-SSH Auditability and Metric Convergence: Distributing static SSH keys across EC2 and RDS Custom hosts breaks IAM-based attribution and CloudTrail command auditing. Meanwhile, pushing EC2 metrics to one APM, RDS Custom logs to another, and Standard RDS metrics to CloudWatch splits incident triage across three uncorrelated consoles.

Support perimeter failure cascade when unguarded OS changes trigger unsupported-configuration

How do platform teams orchestrate security and telemetry agents across EC2 and RDS Custom without tripping the Support Perimeter, while converging Standard RDS metrics into the same observability pipeline?

Options Considered

Teams typically evaluate four ways to manage agents and telemetry across mixed AWS Oracle estates.

Fleet Management OptionRDS Custom SafetyZero-Trust / AuditStandard RDS CoverageWhy Rejected / Chosen
Direct SSH + Bastion HostsUnsafe — uncoordinated changesFails — static key sprawlNoneNo IAM command trail; high blast radius on /rdsdbdata.
Unpaused SSM InstallsFails — trips perimeterPasses — IAM + CloudTrailNoneHealth monitor flags unsupported-configuration mid-install.
Standard RDS OnlyN/APassesFullBlocks COTS apps needing OS paths, SYSDBA, or custom binaries.
SSM + Pause Lifecycle + Metric Streams (Chosen)Safe — 60m pause + /optPasses — zero SSH keysFull via OTLP 1.0Unifies host execution and telemetry across all three tiers.

Comparison of SSH bastions, unpaused installs, Standard RDS only, and SSM with cgroup sandboxing

Direct SSH was rejected because static keys bypass IAM session attribution and encourage manual drift. Running SSM without pausing RDS Custom automation was rejected because package managers that touch systemd targets or network sockets trigger perimeter lockouts. Standardizing exclusively on managed RDS was rejected because legacy ERP and third-party agents cannot run without OS access. Combining SSM with bounded automation pauses, /opt cgroup sandboxing, and CloudWatch Metric Streams addresses every tier cleanly.

The Unified AWS Systems Manager Fleet Architecture

The architecture eliminates SSH bastions and static keys by using AWS Systems Manager (SSM) as the single host control plane for EC2 and RDS Custom, paired with Amazon CloudWatch Metric Streams for Standard RDS.

Unified AWS SSM control plane for EC2 and RDS Custom paired with CloudWatch Metric Streams for Standard RDS

Architectural Control Plane Pillars

  1. Bastion-Less IAM Execution: Every EC2 and RDS Custom host runs amazon-ssm-agent authenticated via its IAM instance profile. Engineers and CI/CD pipelines never open port 22 or distribute static SSH private keys; commands execute via signed AWS SigV4 APIs (ssm:SendCommand or Session Manager) with full input/output logging to AWS CloudTrail and Amazon S3. Because RDS Custom instances are backed by AWS-managed EC2 instances named with the do-not-delete-rds-custom-{DbiResourceId} prefix, the control plane resolves the EC2 target dynamically from the RDS API rather than maintaining brittle static inventory files.
  2. Bounded RDS Custom Automation Pause: An orchestration wrapper transitions the RDS Custom instance to AutomationMode='all-paused' with ResumeFullAutomationModeMinutes=60 before dispatching SSM documents, waits for db_instance_available, executes the host change, and explicitly restores AutomationMode='full' in a finally block. That 60-minute minimum bound acts as a hard safety fuse: even if the CI runner crashes mid-execution, AWS automatically re-engages monitoring and backups once the timer expires.
  3. Isolated /opt Placement and cgroups v2 Sandboxing: Third-party binaries (such as AWS Distro for OpenTelemetry / ADOT collectors or endpoint security daemons) install strictly under /opt/enterprise/. Systemd unit drop-ins enforce CPUQuota=5% and MemoryMax=512M (with MemoryHigh=400M soft throttling) so an agent memory leak or trace-parsing spike is throttled or OOM-killed inside its own slice before it can compete with Oracle SGA hugepages or PGA allocations. Deployment scripts treat /rdsdbdata, /rdsdbbin, /u01/app/oracle, and /etc/oracle as strictly read-only.
  4. Unified OTLP Telemetry Mesh: Standard RDS instances cannot host OS agents, so Enhanced Monitoring and AWS/RDS CloudWatch metrics flow through a CloudWatch Metric Stream (output_format = "opentelemetry1.0") and Amazon Kinesis Data Firehose into the same central observability backend that receives EC2 and RDS Custom host metrics. Filtering include_filter to high-signal namespaces and metric names keeps Firehose ingest volume predictable: at 1-minute metric periods, streaming 8 core metrics per RDS instance produces 8 * 60 * 24 = 11,520 metric data points per instance per day, whereas an unfiltered stream emits dozens of storage, burst, and replica dimensions per instance.
  5. Immutable SSM State Manager Drift Remediation: On self-managed EC2 hosts, SSM State Manager associations run on a scheduled cadence to verify that /opt/enterprise/ binaries, systemd cgroup drop-ins, and chronyd configurations match the signed baseline. On RDS Custom hosts, State Manager only runs read-only compliance inventory checks unless wrapped in the all-paused automation workflow, preventing background drift-remediation jobs from colliding with AWS-managed patching windows.

Production Implementation Snippets

The Python orchestration wrapper pauses RDS Custom automation, resolves the underlying EC2 instance using the immutable DbiResourceId tag convention (do-not-delete-rds-custom-*), dispatches the SSM document, and guarantees resumption:

import boto3
import sys

rds = boto3.client("rds", region_name="us-east-1")
ssm = boto3.client("ssm", region_name="us-east-1")

def deploy_to_rds_custom(instance_id: str, doc_name: str) -> None:
    rds.modify_db_instance(
        DBInstanceIdentifier=instance_id,
        AutomationMode="all-paused",
        ResumeFullAutomationModeMinutes=60,
    )
    rds.get_waiter("db_instance_available").wait(DBInstanceIdentifier=instance_id)

    try:
        db = rds.describe_db_instances(DBInstanceIdentifier=instance_id)["DBInstances"][0]
        resource_id = db["DbiResourceId"]
        ssm.send_command(
            Targets=[{"Key": "tag:Name", "Values": [f"do-not-delete-rds-custom-{resource_id}*"]}],
            DocumentName=doc_name,
            TimeoutSeconds=600,
            Parameters={"PackageVersion": ["7.52.0"]},
        )
    finally:
        rds.modify_db_instance(DBInstanceIdentifier=instance_id, AutomationMode="full")

On the host, the SSM Command Document installs the agent under /opt and binds systemd resource limits:

schemaVersion: "2.2"
description: "Install and Sandbox Telemetry Agent on Oracle Hosts"
parameters:
  PackageVersion:
    type: String
    default: "7.52.0"
mainSteps:
  - action: aws:runShellScript
    name: installAndSandboxAgent
    inputs:
      runAsUser: root
      timeoutSeconds: "300"
      script:
        - |
          #!/bin/bash
          set -euo pipefail
          INSTALL_DIR="/opt/enterprise/telemetry"
          mkdir -p "${INSTALL_DIR}" /etc/systemd/system/telemetry-agent.service.d
          rpm -Uvh --prefix="${INSTALL_DIR}" \
            "https://internal-repo.enterprise.com/agents/telemetry-agent-{{ PackageVersion }}.rpm"
          cat <<EOF > /etc/systemd/system/telemetry-agent.service.d/resource-limits.conf
          [Service]
          CPUAccounting=true
          CPUQuota=5%
          MemoryAccounting=true
          MemoryMax=512M
          MemoryHigh=400M
          EOF
          systemctl daemon-reload
          systemctl enable --now telemetry-agent.service

For Standard RDS, Terraform provisions a filtered CloudWatch Metric Stream using opentelemetry1.0:

resource "aws_cloudwatch_metric_stream" "rds_telemetry_stream" {
  name          = "rds-database-telemetry-stream"
  role_arn      = aws_iam_role.metric_stream_role.arn
  firehose_arn  = aws_kinesis_firehose_delivery_stream.observability_firehose.arn
  output_format = "opentelemetry1.0"

  include_filter {
    namespace    = "AWS/RDS"
    metric_names = ["CPUUtilization", "FreeableMemory", "ReadLatency", "WriteLatency"]
  }
}

How It Rolls Out

Rolling out host agents across production Oracle fleets requires staged validation so a bad package or systemd unit never locks out backups across multiple databases simultaneously.

Four-step perimeter-safe deployment flow for RDS Custom and EC2

  1. Phase 1 — IAM and SSM Baseline Verification: Attach AmazonSSMManagedInstanceCore via Terraform and protect it with AWS Organizations Service Control Policies (SCPs) so no account administrator can detach the core management policy during ad-hoc troubleshooting. Verify all EC2 and RDS Custom targets appear Online in SSM Fleet Manager and enforce Amazon Time Sync Service (169.254.169.123) via Chrony so SigV4 API calls never fail with SignatureExpired. Validation gate: Execute a read-only ssm:SendCommand health check (chronyc tracking) across all targets and confirm CloudTrail logs the IAM caller ARN. Rollback: Revert the IAM instance profile attachment if a custom policy conflict occurs.
  2. Phase 2 — Standard RDS Metric Stream Activation: Deploy aws_cloudwatch_metric_stream with include_filter scoped strictly to core RDS latency, CPU, and memory metrics, backed by a Kinesis Data Firehose delivery stream with GZIP compression. Validation gate: Confirm OTLP 1.0 records arrive in the central APM within 60 seconds and check Firehose DeliveryToHttpEndpoint.Success metrics. Rollback: Delete or pause the metric stream resource with zero impact on RDS availability.
  3. Phase 3 — Staging RDS Custom Pause-and-Install Drill: Run the Python wrapper against a non-production RDS Custom instance. Validation gate: Confirm AutomationMode transitions cleanly to all-paused and back to full, database status returns to available (not unsupported-configuration), systemd-cgtop shows the agent bounded under 512M, and a manual RDS snapshot completes cleanly afterward. Rollback: Uninstall the /opt package while paused, restore AutomationMode='full', and verify a manual DB snapshot succeeds.
  4. Phase 4 — Canary and Fleet Rollout: Deploy to 10% of production EC2 and RDS Custom hosts first, monitoring unsupported-configuration RDS events, SSM command exit codes, and Oracle alert.log for listener or memory anomalies before expanding fleet-wide via SSM State Manager associations.

In Practice

This architecture aligns with documented AWS and Oracle operational behavior across co-managed and multicloud environments:

  • AWS RDS Custom Perimeter Behavior: Per AWS RDS Custom documentation, modifying core database directories, stopping the underlying EC2 instance directly, or breaking SSM Agent connectivity triggers unsupported-configuration, which immediately suspends automated backups and PITR. Using AutomationMode='all-paused' with ResumeFullAutomationModeMinutes (60 to 1,440 minutes) gives maintenance workflows a bounded window while guaranteeing AWS automatically re-engages monitoring if an orchestrator crashes.
  • OpenTelemetry via ADOT and SSM Distributor: Rather than embedding OpenTelemetry inside amazon-ssm-agent itself, AWS distributes the AWS Distro for OpenTelemetry (ADOT) Collector as a signed SSM Distributor package configured via SSM Parameter Store—keeping the SSM daemon minimal while standardizing OTLP collection across EC2 and RDS Custom.
  • Oracle Database@AWS Alternative: For massive Exadata or RAC workloads that previously forced teams onto self-managed EC2, Oracle Database@AWS places OCI-managed Exadata infrastructure physically inside AWS Availability Zones, offering sub-millisecond EC2 connectivity while shifting hardware and RAC lifecycle management to OCI rather than customer-managed EC2 scripts.
  • Standard RDS Telemetry Granularity: Because Standard RDS prohibits OS-level agents, CloudWatch Metric Streams export 1-minute AWS/RDS metrics via Kinesis Data Firehose, while Enhanced Monitoring captures OS process-level telemetry at 1-to-60-second intervals into CloudWatch Logs for unified correlation without breaching the managed host boundary.

Where It Breaks

Even with SSM and /opt isolation, subtle misconfigurations in cgroup caps, listener ports, or CloudWatch filters can disrupt production databases or inflate billing.

Failure-path overlay showing perimeter lockout, cgroup OOM, port 1521 collision, and metric stream cost

Failure ConditionBreaks HowHow to DetectMitigation
Protected path mutationScript alters /rdsdbdata, /rdsdbbin, or /etc/oracle; AWS flags unsupported-configuration and halts backups.Alert on RDS EventBridge/RDS events (SP-S0000 or status != available).Quarantine all third-party files in /opt; lint SSM scripts in CI for forbidden paths.
Orchestrator crash during pauseWrapper fails before finally block; backups stay paused until ResumeFullAutomationModeMinutes expires.Monitor CloudTrail ModifyDBInstance events and RDS AutomationMode state.Keep ResumeFullAutomationModeMinutes = 60 (minimum) so AWS auto-resumes within one hour.
Cgroup memory OOM killAgent buffers large Oracle trace files and hits MemoryMax=512M; kernel kills telemetry daemon.Alert on systemd oom-kill journal events and missing host heartbeats.Configure agents to tail logs incrementally; size MemoryMax from staging peak usage.
Port 1521 listener collisionActive vulnerability scanner binds TCP 1521; Oracle TNS Listener fails on restart.Monitor lsnrctl status and connection pool handshake errors.Run security scanners in passive inspection mode; forbid socket binding on 1521.
SSM IAM role driftInstance profile edit drops AmazonSSMManagedInstanceCore; host vanishes from SSM Fleet Manager.Alert on SSM ConnectionLost status in Fleet Manager.Lock core SSM role permissions with AWS Organizations SCPs.
Chrony NTP clock driftSkewed system clock causes AWS SigV4 requests to fail with SignatureExpired.Alert on chronyc tracking offset and SSM agent health check failures.Enforce Amazon Time Sync Service (169.254.169.123) in base AMIs and State Manager.
Unfiltered Metric StreamStreaming every AWS/RDS metric at high cardinality spikes Kinesis Firehose ingest fees.Monitor AWS Cost Explorer and Firehose IncomingBytes metrics.Restrict include_filter to essential CPU, memory, and I/O latency metrics.

Key Takeaways

  • Never manage RDS Custom like raw EC2: Any OS change outside /opt or without AutomationMode='all-paused' risks unsupported-configuration and an immediate halt to automated backups and PITR.
  • Use ResumeFullAutomationModeMinutes as a safety fuse: Set it to the minimum 60 minutes so a crashed deployment script cannot leave RDS Custom automation paused indefinitely.
  • Sandbox every third-party daemon with cgroups v2: Capping CPUQuota and MemoryMax prevents monitoring or security agents from starving Oracle SGA/PGA memory.
  • Eliminate SSH keys with AWS SSM: IAM-authenticated SSM Run Command and Session Manager provide full CloudTrail attribution across both EC2 and RDS Custom without bastion hosts.
  • Converge Standard RDS via filtered OTLP 1.0 streams: CloudWatch Metric Streams (opentelemetry1.0) bring managed RDS into the same observability mesh as EC2 and RDS Custom when filtered to high-signal metrics.

What to Do Next

  • Problem: Ad-hoc SSH scripts and fragmented monitoring across Amazon RDS, RDS Custom, and EC2 cause SSH key sprawl, observability blind spots, and RDS Custom Support Perimeter lockouts.
  • Solution: Standardize host management on IAM-governed AWS SSM with 60-minute all-paused wrappers and /opt cgroups v2 sandboxes, and export Standard RDS metrics via filtered opentelemetry1.0 CloudWatch Metric Streams.
  • Proof: Verify in staging that an SSM agent deployment on RDS Custom leaves DB status available, keeps the daemon under 512M RAM, and delivers AWS/RDS OTLP metrics within 60 seconds.
  • Action: Audit your AWS Oracle inventory this week: confirm no RDS Custom instances are stuck in unsupported-configuration, attach AmazonSSMManagedInstanceCore protected by an SCP, and disable port 22 bastion access.