PolicyVersion

class PolicyVersion : KotlinCustomResource

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

NOTE: Available since v1.84.0. NOTE: It is not recommended to use this resource management policy version, it is recommended to directly use the policy resource to manage your policy. Please refer to the link for usage resource_manager_policy.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.Policy;
import com.pulumi.alicloud.resourcemanager.PolicyArgs;
import com.pulumi.alicloud.resourcemanager.PolicyVersion;
import com.pulumi.alicloud.resourcemanager.PolicyVersionArgs;
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("tfexample");
var examplePolicy = new Policy("examplePolicy", PolicyArgs.builder()
.policyName(name)
.policyDocument("""
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:*"]
}],
"Version": "1"
}
""")
.build());
var examplePolicyVersion = new PolicyVersion("examplePolicyVersion", PolicyVersionArgs.builder()
.policyName(examplePolicy.policyName())
.policyDocument("""
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:myphotos"]
}],
"Version": "1"
}
""")
.build());
}
}

Import

Resource Manager Policy Version can be imported using the id, e.g.

$ pulumi import alicloud:resourcemanager/policyVersion:PolicyVersion example tftest:v2

Properties

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

Specifies whether to set the policy version as the default version. Default to false.

Link copied to clipboard
val policyDocument: Output<String>

The content of the policy. The content must be 1 to 2,048 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>