alicloud_tag_policy

Provides a Tag Policy resource.

For information about Tag Policy and how to use it, see What is Policy.

Example Usage

Basic Usage

variable "name" {
  default = "terraform-example"
}
provider "alicloud" {
  region = "cn-shanghai"
}
resource "alicloud_tag_policy" "example" {
  policy_name    = var.name
  policy_desc    = var.name
  user_type      = "USER"
  policy_content = <<EOF
        {"tags":{"CostCenter":{"tag_value":{"@@assign":["Beijing","Shanghai"]},"tag_key":{"@@assign":"CostCenter"}}}}
    EOF
}
        {"tags":{"CostCenter":{"tag_value":{"@@assign":["Beijing","Shanghai"]},"tag_key":{"@@assign":"CostCenter"}}}}
    EOF
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

Tag Policy can be imported using the id, e.g.

$ terraform import alicloud_tag_policy.example <id>