Policy

class Policy : KotlinCustomResource

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

NOTE: Available since v1.203.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.tag.Policy;
import com.pulumi.alicloud.tag.PolicyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var example = new Policy("example", PolicyArgs.builder()
.policyName(name)
.policyDesc(name)
.userType("USER")
.policyContent("""
{"tags":{"CostCenter":{"tag_value":{"@@assign":["Beijing","Shanghai"]},"tag_key":{"@@assign":"CostCenter"}}}}
""")
.build());
}
}

Import

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

$ pulumi import alicloud:tag/policy:Policy example <id>

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val policyContent: Output<String>

The content of the policy.

Link copied to clipboard
val policyDesc: Output<String>?

The description of the policy. The description must be 1 to 512 characters in length.

Link copied to clipboard
val policyName: Output<String>

The name of the policy. name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userType: Output<String>

The type of the tag policy. Valid values: USER, RD.