Description
Hello, 你好!
I have noticed that VBR resources in terraform provider alicloud does not have possibility add tags.
https://github.com/aliyun/terraform-provider-alicloud/blob/master/alicloud/data_source_alicloud_express_connect_virtual_border_routers.go
Could you please add the tags cause otherwise it doesn't seem to be a good practice to add tags manually or via ugly workarounds as below:
`resource "null_resource" "vbr_tags" {
count = var.create_alicloud_vbr && length(var.tags) > 0 ? 1 : 0
triggers = {
vbr_id = alicloud_express_connect_virtual_border_router.this[0].id
tags = jsonencode(var.tags)
region_id = var.region_id
}
provisioner "local-exec" {
command = <<EOT
aliyun vpc TagResourcesForExpressConnect
--RegionId ${var.region_id}
--ResourceType VIRTUALBORDERROUTER
--ResourceId.1 ${alicloud_express_connect_virtual_border_router.this[0].id}
${join(" ", [for i, k in keys(var.tags) : "--Tag.${i + 1}.Key "${k}" --Tag.${i + 1}.Value "${var.tags[k]}""])}
EOT
}
provisioner "local-exec" {
when = destroy
command = <<EOT
for key in ${join(" ", [for k in keys(jsondecode(self.triggers.tags)) : ""${k}""])}; do
aliyun vpc UntagResourcesForExpressConnect
--RegionId ${self.triggers.region_id}
--ResourceType VIRTUALBORDERROUTER
--ResourceId.1 ${self.triggers.vbr_id}
--TagKey "$key"
done
EOT
}
depends_on = [alicloud_express_connect_virtual_border_router.this]
}`
Thanks a lot in advance!
多谢!
Regards, Vladimir