Hi there! Newbie here. I have question, if anyone ...
# aws
d
Hi there! Newbie here. I have question, if anyone is able to help. I've managed to create a Fargate service + RDS Postgres. The database is obviously empty, so I'd like to run
create database X;
as part of my Pulumi flow. How might one go about doing that?
b
You can potentially use the pulumi-postgreql provider if the machine running your Pulumi has access to the RDS instance
d
Looking at the docs, trying to figure out how that would work. Might you have an example using pulumi-postgres?
b
No but I know that @better-actor-92669 uses that provider
he may be able to help
b
Hey. Yeah, I do use pulumi-postgresql, but with pulumi-gcp. I can send you some code samples, pm me for any questions
d
@better-actor-92669 I don't seem to be able to pm you... weird. would love to see some samples. In the meantime, I'm almost pulling it off with a Fargate Run Once Task. I'll make my main Fargate Service depend on it and wait for SUCCESS. But I'm not being able to figure out how to get this TaskDefinition into a Container that I can dependOn
b
I am not anywhere near my PC arm, I will send you samples regarding pulumi-postgresql either today or tomorrow, but I have never touched Fargate
👍 1
h
An alternative approach would be to write a script that use spulumi to create the resources, and then initializes the database once created. I do something similar with a bash script for bringing up CI environments.
d
@hundreds-musician-51496 is there some code you might be able to share? i guess that would require the database to the exposed to the world right?
probably the same problem I'm hitting with the pulumi postgres provider. it can't connect to the database because it is behind a vpc
h
I run the script via CodeBuild so I've set up permissions that allow the codebuild container to talk to the VPC
👍 1
Unforutnately I don't have any code that I could share