Skip to content

Conversation

@universe-ops
Copy link
Contributor

Implemented InitSQL support for AWS RDS Postgres instances to enable custom SQL execution during database initialization.

Changes Made

  • Added InitSQL field to PostgresConfig in pkg/clouds/aws/rds_postgres.go

    • Optional field for custom SQL commands during database setup
    • Supports multi-line SQL for complex initialization
  • Enhanced compute processor in pkg/clouds/pulumi/aws/compute_proc.go

    • Modified to pass InitSQL configuration to the initialization script
    • Leverages existing PSQL_DB_INIT_SH script infrastructure

Usage Example

resources:
  postgres-db:
    type: aws-rds-postgres
    config:
      name: "my-postgres"
      instanceClass: "db.t3.micro"
      engineVersion: "15.4"
      username: "dbuser"
      password: "${secret:postgres-password}"
      initSQL: |
        CREATE EXTENSION IF NOT EXISTS vector;
        CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
        ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';

@universe-ops universe-ops merged commit bdb55be into main Jan 6, 2026
1 check passed
@universe-ops universe-ops deleted the staging branch January 6, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants