This message was deleted.
# getting-started
s
This message was deleted.
l
AWSX, and all other convenience wrappers, will necessarily expose a smaller number of configuration options than the resources they're built on. If setting subnet tags via the Vpc constructor isn't possible (and it likely isn't), then you can use a transformation to achieve the same thing.
b
hmm, thanks for that. Apparently that’s going to be beyond my brain power to pull off, but thanks for the pointer 👍
l
It's not hard, I'm happy to help.
You define a function that adds tags to subnets: it'll be very like the one in the example code on that page, but only checking for
args.type_ == "aws:ec2/subnet:Subnet"
, and setting
tags
instead of
ignore_changes
.
Then you pass that function as a transformation to your awsx.ec2.Vpc constructor, just like in the last line of the example code.
b
i’ll give that a shot. uno momento.
i think the things that tripped me up was 1) what myvpccomponent was meant to be (possibly because i dont know what a component is in the first place, if thats a thing), and 2) i’m going to need to set the tags on the subnets differently based on which type of subnet it is, and this seems to be returning a single value which would include the tags. So somewhere in there i’m going to need to lookup what type of subnet it is.
l
If the logic is too complex, this suggests to be that you shouldn't be using awsx.ec2.Vpc. You'd be better off with the additional control you get from aws.ec2.Vpc.
b
yeah ok. makes sense. 👍
l
It's the old convention-over-configuration thing 🙂 Once you're configuring your conventionally-created resources... yeah, nah! (As we say here in New Zealand)