Can anyone help me how to pass vpc.id to get netwo...
# aws
f
Can anyone help me how to pass vpc.id to get network acl? Thanks for the help
l
This function is provided by Pulumi as a wrapper around the SDK function. Generally, you should prefer to create your own NACLs and use those, or to import existing ones and use those.
If you really need to use getNetworkAcls, you would need to to call it inside an
apply()
, since it needs a string vpcId, not an Input<string>. It assumes you already have the VPC id, and don't have to wait for it to be created.
There is another form of this function,
getNetworkAclsOutput()
, which can handle vpcId as an Input<string>. So if you cannot create or import the NACLs, this form is the way to go.
☝️ 1
f
I need update acl tag after vpc has been created. what the best way for updating the tag name?
b
@few-mechanic-54967 use
aws.ec2.Tag
f
I got error like this: @billowy-army-68599
l
Is the NACL object being created by Pulumi? If it is, then you can use a resource transformation to update the tags before they're created. If it's a default NACL that AWS creates, it might be better to ignore it, and create your own NACL with the correct tags. Generally, avoid trying to get Pulumi to update resources it doesn't manage.
f
I think when run aws.ec2.Vpc, actually it is default NACL that AWS creates, but I just change the name of resource. Yaah I think that is useless but I want to know.
l
To update this NACL's tags, you're going to have to use the AWS SDK. It's available via the aws.sdk pulumi namespace, as a convenience.