Hi again! I am creating subnets with aws.ec2, and ...
# aws
s
Hi again! I am creating subnets with aws.ec2, and I give them names.
Copy code
public_subnet_1 = aws.ec2.Subnet(
    "subnet-public-1", # Seems like the name is not working in AWS console
    vpc_id=vpc.id,
    cidr_block="10.0.1.0/24",
)
private_subnet_1 = aws.ec2.Subnet(
    "subnetn-private-1", # Seems like the name is not working in AWS console
    vpc_id=vpc.id,
    cidr_block="10.0.2.0/24",
)
The subnets are created, but their names do not appear in the AWS console (they have no names). I also tried with
resource-name
attribute (
attribute="subnet-public-1"
), but it’s the same. Why?
Same with VPC :
vpc = aws.ec2.Vpc("my-vpc", _cidr_block_="10.0.0.0/16")
The created VPC has no name in AWS.
g
there is a difference between
resource_name
and
Name
(display name) Many AWS resources have a display name represented as the tag
Name
. And for those, the pulumi provider won't apply the value of
resource_name
to the tag
Name
. So you need to add
tags={"Name":"YOUR VALUE"}
👆🏻 1
s
Sorry for late reply @great-sunset-355, thank you, it helps a lot!
g
I did not have much time to respond yesterday, but you can also auto-tag resources like this: https://github.com/joeduffy/aws-tags-example/issues/3 tl;dr -> transform, check if resource has
tags
property, add your value