Hi All :wave: When we create a VPC using `Pulumi....
# aws
k
Hi All 👋 When we create a VPC using
Pulumi.Awsx.Ec2.Vpc
(Pulumi C#), Network ACLs and Route Tables with routes are automatically generated. (Suppose the VPC has
3 availability zones
, and each availability zone has a
public
and a
private
subnet.) I have a couple of questions: 1) How can we add new routes to the route table of the public subnet in availability-zone-1? AND how can we add new rules to the Network ACL of the public subnet in availability-zone-1? 2) Is that possible to access those automatically created resources like Network ACLs, Route Tables and modify them? OR Do we need to go with
Pulumi AWS Classic
package? Your input and guidance are highly valued. TYIA
s
To add routes and/or NACL rules, you need to do so in an
apply
. Here's an example in Python, but you should be able to translate without too much trouble: https://github.com/pulumi/examples/blob/master/aws-py-hub-and-spoke-network/spoke.py#L147C46-L231 You cannot modify the resources after they are created, so if there are not inputs for whatever you need to change, you'll need to create the resources yourself using the Classic package, but please file an issue in pulumi/pulumi-awsx for the inputs you want!
If it's an independent resource and you want to add a child resource using the parent's ID (like the example of adding routes to a route table that comes with awsx.ec2.Vpc), all the IDs you need should be available as outputs. If you need different properties on the resource itself, that would require dropping down to AWS Classic.
k
Thank you for the help. @stocky-restaurant-98004 🫡 Will look in to that PS: Looked into thiat and it seems I have to go with Classic package as you mentioned in above
s
You're welcome! Again, please submit an issue to AWSX with your use case if you have the time!