This is an attempt to create a serverless Aurora cluster in AWS via Terraform. The Aurora cluster is placed in a private subnet and accessed via a Bastion in a public subnet.
Using Amazon Aurora Serverless v1: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html
Steps:
- Create a VPC, with 1 public subnet and 2 private subnets
- Create bastion
- Create a security group for SSH access for the bastion
- Create a security group for PostgeSQL access for the bastion?
- Create Aurora cluster
- Create a security group for PostgreSQL access to Aurora that the bastion will use
- Connect via pgAdmin
To connect with pgAdmin:
- Open pgAdmin
- Log in
- Hit 'Add New Server'
- Give it 'Name', i.e. 'aurora-spike'
- Hit the 'Connection' tab
- For 'Host name/address' use the output 'aurora_server_endpoint'
- For 'Username' use the output 'master_username'
- For 'Password' use the output 'mater_password'
- Click 'Save password?'
- Hit the 'SSH Tunnel' tab
- Toggle 'Use SSH tunneling' to 'Yes'
- For 'Tunnel host' use the output 'bastion_public_ip'
- Leave 'Tunnel port' as '22'
- For 'Username' use 'ec2-user'
- Toggle 'Authentication' to 'Identity file'
- For 'Identity file' browse to the location of the 'pem' file
- Hit the 'Advanced' tab
- Increase 'Connection timeout', i.e. 90
- Hit 'Save'
You should be connected to your Aurora cluster! :)