How to access Aurora from a scheduled job #3084
-
Hi there, I configured an Aurora database through copilot for my load balanced service and I now need to get access to it from my new scheduled job. On the API an environment variable is automatically there when the container runs, is it possible to set this up for the scheduled job too?
Beyond passing in the secret do I need to do anything regarding security groups etc. Or is everything within the same environment accessible by default? Thanks a lot for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello 👋🏼 ! Your intuition is right, the security group needs to be configured to allow access from the scheduled job. By default, the Aurora database is only accessible to the service (in your case, the Load-Balanced Web Service)! In your Aurora template, you can modify the security group ingress of the resource named |
Beta Was this translation helpful? Give feedback.
Hello 👋🏼 ! Your intuition is right, the security group needs to be configured to allow access from the scheduled job.
By default, the Aurora database is only accessible to the service (in your case, the Load-Balanced Web Service)! In your Aurora template, you can modify the security group ingress of the resource named
<clusterName>DBClusterSecurityGroup
to allow ingress from the scheduled job. I have an example on how to modify it here!