I have created a RDS Aurora Postgres Database Cluster and Database Instance through CDK (using java as a language). Now I am trying to achieve creating a database schema through CDK. I tried but did not find any documentation or help anywhere which tells
If anyone has already done it or has knowledge, I will appreciate pointing me to right direction.
Thanks, Horizon7
The CDK itself does not have an out of the box solution for creating SQL schemas as it is used for managing the provisioning of infrastructure.
However, there is a tool for creating additional processes, this tool is a CustomResource.
A CustomResource
will allow you to invoke a Lambda function, this function could be developed to perform SQL interaction with the RDS instance and then create the schemas.
If you enable RDS Proxy your Lambda function should be able to interact with the RDS instance without any additional considerations for networking. As long as it has the IAM permissions it can invoke the commands.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With