https://pulumi.com logo
Title
g

gentle-piano-19726

02/14/2022, 8:49 PM
Anyone have an example setting up public RDS with vpc? I'm using Node
l

little-cartoon-10569

02/14/2022, 8:56 PM
Is it different to setting up a non-public RDS instances? There's an example in the API docs: https://www.pulumi.com/registry/packages/aws/api-docs/rds/instance/
g

gentle-piano-19726

02/14/2022, 8:56 PM
indeed it is
l

little-cartoon-10569

02/14/2022, 8:56 PM
So long as it's in a subnet with an IGW and appropriate NACLs and SGs, isn't public?
I see a
publiclyAccessible
property which defaults to false.
Ooo big. Text snippets are good 🙂
g

gentle-piano-19726

02/14/2022, 8:58 PM
I see a 
publiclyAccessible
 property which defaults to false.
Yes that's part of it
Text snippets are good
which snippet would I choose from above, that's already minimal
l

little-cartoon-10569

02/14/2022, 8:58 PM
I mean the Slack feature "Create Text Snippet" 🙂
g

gentle-piano-19726

02/14/2022, 8:58 PM
Ah
l

little-cartoon-10569

02/14/2022, 8:59 PM
I think all the properties in that TF example have Pulumi equivalents. Is there one you can't find?
g

gentle-piano-19726

02/14/2022, 9:00 PM
For starters vpc, nothing about public subnets or availability zones in pulumi
l

little-cartoon-10569

02/14/2022, 9:01 PM
That VPC is from the AWS module. The Pulumi equivalent is awsx.ec2.Vpc. You can create public subnets manually, or allow awsx do it for you.
If you're comfortable with Pulumi, I prefer doing it manually, but the awsx package does make it very easy to set up.
I don't know if the docs for awsx have moved to registry, but here's the old docs: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ec2/
g

gentle-piano-19726

02/14/2022, 9:05 PM
I don't know what the awsx package is, will take a look
Simpler interfaces encapsulating common AWS patterns.
ah
l

little-cartoon-10569

02/14/2022, 9:08 PM
The only gotcha for awsx.ec2.Vpc is that subnets are dynamically created, which you can avoid if you do it yourself.
The upside of this is that awsx can take something simple like "2 public and 2 private subnets sharing CIDR 10.1.0.0/16" and work it all out for you.
The downside is that the subnets are created inside an
apply()
which means that you can't get at them except via an
apply()
. Normally this is no problem, but sometimes, it makes code a little more complex and untidy.
If this is your first Pulumi project, use awsx. If it's not and if you're comfortable creating the IGW, NAT gateway etc. yourself, then do it manually.
g

gentle-piano-19726

02/14/2022, 9:13 PM
Thanks @little-cartoon-10569 this is the advice I needed I think
👍 1