Anyone have an example setting up public RDS with ...
# aws
g
Anyone have an example setting up public RDS with vpc? I'm using Node
l
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
indeed it is
l
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
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
I mean the Slack feature "Create Text Snippet" 🙂
g
Ah
l
I think all the properties in that TF example have Pulumi equivalents. Is there one you can't find?
g
For starters vpc, nothing about public subnets or availability zones in pulumi
l
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
I don't know what the awsx package is, will take a look
Simpler interfaces encapsulating common AWS patterns.
ah
l
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
Thanks @little-cartoon-10569 this is the advice I needed I think
👍 1