https://pulumi.com logo
Title
f

full-energy-64138

11/14/2022, 1:37 PM
Hey, I’m having trouble with using subnet names in
awsx.ec2.Vpc
. Let’s say we have the following VPC:
typescript
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
myVpc-hi-0
, however it’s named
myVpc-hi-isolated-0
:( 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?
b

billowy-army-68599

11/14/2022, 3:05 PM
could you open an issue for the naming issue?
as for temporary access, you can add a route to the nat gateway
f

full-energy-64138

11/14/2022, 5:20 PM
Thanks for the answer! I figured I could indeed add the route the following way:
(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
b

billowy-army-68599

11/14/2022, 5:24 PM
isolated isn’t meant to have any routes out to a nat gateway. it might be better to create another private subnet?
f

full-energy-64138

11/14/2022, 5:27 PM
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?
b

billowy-army-68599

11/14/2022, 5:28 PM
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?
f

full-energy-64138

11/14/2022, 5:32 PM
I see, thank you! These are all hypothetical questions because we currently only evaluating Pulumi, so thanks for pointing this workflow out 🙂
b

billowy-army-68599

11/14/2022, 5:33 PM
happy to assist if you need any AWS design/infrastructure help! feel free to reach out via our contact form