I have currently created an RDS instance in the private subnets of my VPC. Now I want to create an user with some privileges and grants. For this I am using the mysql_user
and mysql_grants
resource types in TF. Since my instance is in the private subnet, the TF code cannot be executed as part of the CI pipeline to create the Mysql user and grants.
To my understanding I have two options:
Do not terraform the user and grants. Rather log in to the RDS instance via the bastion host and manually create the user.
Create the RDS instance in the public subnet (db subnet with the public subnets). Then use the TF to create the user and grants. The modify the db instance and move it to the private subnet.
I am more inclined to do no. 2 since everything is code and repeatable. But want to know if there is any better way in achieving this.