Hey, I’m having trouble with using subnet names in...
# aws
Hey, I’m having trouble with using subnet names in
. Let’s say we have the following VPC:
Copy code
const vpc = new awsx.ec2.Vpc("myVpc", {
  subnets: [
      type: "isolated",
      name: "cool-subnet"
      cidrMask: 24,
What I expected to happen is that the created subnet will be named
, however it’s named
:( I think this isn’t the documented behaviour, but maybe I misread it. What I’m actually trying to do is have the ability to change a subent’s type in production without completely recreating the subnet, which is costly. It would be great if I could have temporary internet access in an isolated environment via Pulumi. Is this possible?
could you open an issue for the naming issue?
as for temporary access, you can add a route to the nat gateway
Thanks for the answer! I figured I could indeed add the route the following way:
Copy code
(async () => {
  const ngw = await vpc.natGateways;
  vpc.isolatedSubnets.then((nets) => nets[0].createRoute("nat", ngw[0]));
I don’t think it justifies an issue, because I don’t have any good use case other than that. Maybe the phrasing in the docs could be changed? The sentence “If not provided, the type of the subnet will be used” made me think that the type will not be used in the name
isolated isn’t meant to have any routes out to a nat gateway. it might be better to create another private subnet?
Hmm, the use case that my manager was worried about is a situation where I’d want temporary internet access to install something on a machine that’s inside an isolated subnet. Would adding a route be a plausible solution or is there a more elegant way?
you could create a proxy in the private subnet and configure proxy access in the isolated subnet, but it sounds like you might not need an isolated subnet?
I see, thank you! These are all hypothetical questions because we currently only evaluating Pulumi, so thanks for pointing this workflow out 🙂
happy to assist if you need any AWS design/infrastructure help! feel free to reach out via our contact form