Automated, dependency-free AWS RDS PostgreSQL real-time environment creation with DNS endpoint extraction.
- Zero Dynamic Dependencies: Compiled with
CGO_ENABLED=0into a single, isolated static binary capable of running on bare Linux or minimal Docker containers. - Synchronous Lifecycle Tracking: Intercepts asynchronous AWS API instantiation loops to block and monitor state changes in the foreground.
- Real-time DNS Interception: Dynamically polls the target instance and prints the final live endpoint connection string the moment it changes from
creatingtoavailable.
- No Pipeline Clutter: Replaces heavy Terraform configs or Ansible playbooks with a single tool for fast sandbox deployments.
- Eliminates AWS Console Waiting: Stops you from manually refreshing the web console. It holds the foreground and prints the live DNS endpoint the second it goes live.
- Reduces Cloud Costs: Allows developers to easily destroy infrastructure at night and rebuild a fresh lab in minutes, preventing idle resource billing.
[Local CLI] -> (Invokes SDK) -> [AWS RDS API] (Status: creating)
^ |
+--- [Polling Loop (Foreground)] -+
v |
[Terminal Output] <- (Returns Endpoint) <- [AWS RDS API] (Status: available)
-
AWS Credentials: Ensure your standard local AWS environment variables or config files are populated:
export AWS_ACCESS_KEY_ID="your_access_key" export AWS_SECRET_ACCESS_KEY="your_secret_key" export AWS_REGION="us-east-1"
-
Configuration file: Clone the sample template and add your specific database deployment metadata:
cp config.json.example config.json
To generate an optimized, fully self-contained static executable with all linked libraries assembled inside the binary, run:
CGO_ENABLED=0 go build -o provision-db createRDS.goExecute the generated binary directly from your terminal workspace:
./provision-dbInitiating RDS PostgreSQL [lab-forensics-db] via Go...
Success. Initial Status: creating
Note: Staying in foreground to capture final DNS endpoint...
--- PROVISIONING COMPLETE ---
Endpoint: mylab-dbtname-db.csh2ci0webzp.us-east-1.rds.amazonaws.com:5432
You can check your RDS instance has been created with the following aws cli command:
$ aws rds describe-db-instances --db-instance-identifier lab-forensics-db --query "DBInstances[0].[DBInstanceStatus,Endpoint.Address]" --output table
---------------------------------------------------------------
| DescribeDBInstances |
+-------------------------------------------------------------+
| available |
| mylab-dbtname-db.csh2ci0webzp.us-east-1.rds.amazonaws.com |
+-------------------------------------------------------------+- Official AWS SDK for Go v2 (
https://github.com/aws/aws-sdk-go-v2) - Go 1.26+ Toolchain Standard Libraries