Create D schema/users on RDS instance, which is not publicly available.

Hi,

This might have been asked before. I am wondering if there is a way Ansible can create db schema/users, using the “mysql_<db|user>” in my instance, on a RDS instance that is not publicly accessible?

I have been able to successfully create the appropriate db security group and RDS instance using Ansible. I can also remotely connect (SSH) to the RDS instance using MySQL Workbench using an EC2 instance to access the private network within the VPC that allows access to the RDS. Ie. is there a way Ansible can connect to the RDS via the EC2 instance, similar to what MySQL Workbench does (using SSH)?

Any help or pointers are much appreciated, cheerio,
Luuk

you can setup the host with a jumphost command in your .ssh/config,
ansible will just execute ssh and follow that.

Thanks Brian,

You definitely pointed me in the right direction :slight_smile: Reading up on bastion/jump hosts; amongst the many articles out there I found one by Alex Bilbie which give me enough input to get a working ansible playbook.

The only gotcha is that my current solution required me to put python-mysqldb on the jump host to get the mysql_db module to work. But I suppose this is manageable.

Thanks again :slight_smile:
Luuk