powerful-rain-97767
10/06/2022, 2:05 PMpulumi-awsx
. The snippet below works, however I need to add a set of tags to the private subnets that are generated, as well as adding a different set of tags to the public subnets.
Conceptually, I understand that I need to add the tags before Pulumi creates the resources, but I am not sure how to go about that, even for all subnets. There's an arg called subnet_specs
but adding tags is not an option. There's also the tags
are for the Vpc
, but that just adds tags to the VPC. Help?
import pulumi
import pulumi_awsx as awsx
config = pulumi.Config()
vpc_network_cidr = config.get("vpcNetworkCidr", "10.0.0.0/16")
# Create a VPC for the EKS cluster
eks_vpc = awsx.ec2.Vpc(
"eks-vpc", enable_dns_hostnames=True, cidr_block=vpc_network_cidr,
)
stocky-restaurant-98004
10/06/2022, 7:53 PMsubnet_specs
and should be applied. (They are not, which is the issue.)powerful-rain-97767
10/07/2022, 3:10 PMerror: Program failed with an unhandled exception:
Traceback (most recent call last):
File "/Users/cmarteepants/PycharmProjects/env-bootstrapper/./__main__.py", line 23, in <module>
awsx.ec2.SubnetSpecArgs(
TypeError: SubnetSpecArgs.__init__() got an unexpected keyword argument 'tags'
eks_vpc = awsx.ec2.Vpc(
"eks-vpc", awsx.ec2.VpcArgs(
enable_dns_hostnames=True,
cidr_block=vpc_network_cidr,
subnet_specs=[
awsx.ec2.SubnetSpecArgs(
type=awsx.ec2.SubnetType.PUBLIC,
tags={"ingress": "HECK YEAH, BUDDY!"}
),
awsx.ec2.SubnetSpecArgs(
type=awsx.ec2.SubnetType.PRIVATE,
tags={"ingress": "NO WAY, JOSE"}
)
],
tags={
"createdBy": "Constance"
}
)
)
stocky-restaurant-98004
10/07/2022, 4:33 PMpowerful-rain-97767
10/07/2022, 6:28 PMgreat-sunset-355
10/09/2022, 8:38 PM