Policy Args
data class PolicyArgs(val defaultVersion: Output<String>? = null, val description: Output<String>? = null, val policyDocument: Output<String>? = null, val policyName: Output<String>? = null) : ConvertibleToJava<PolicyArgs>
Provides a Resource Manager Policy resource. For information about Resource Manager Policy and how to use it, see What is Resource Manager Policy.
NOTE: Available since v1.83.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "tfexample";
const example = new alicloud.resourcemanager.Policy("example", {
policyName: name,
policyDocument: `\x09\x09{
\x09\x09\x09"Statement": [{
\x09\x09\x09\x09"Action": ["oss:*"],
\x09\x09\x09\x09"Effect": "Allow",
\x09\x09\x09\x09"Resource": ["acs:oss:*:*:*"]
\x09\x09\x09}],
\x09\x09\x09"Version": "1"
\x09\x09}
`,
});
Content copied to clipboard
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "tfexample"
example = alicloud.resourcemanager.Policy("example",
policy_name=name,
policy_document="""\x09\x09{
\x09\x09\x09"Statement": [{
\x09\x09\x09\x09"Action": ["oss:*"],
\x09\x09\x09\x09"Effect": "Allow",
\x09\x09\x09\x09"Resource": ["acs:oss:*:*:*"]
\x09\x09\x09}],
\x09\x09\x09"Version": "1"
\x09\x09}
""")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "tfexample";
var example = new AliCloud.ResourceManager.Policy("example", new()
{
PolicyName = name,
PolicyDocument = @" {
""Statement"": [{
""Action"": [""oss:*""],
""Effect"": ""Allow"",
""Resource"": [""acs:oss:*:*:*""]
}],
""Version"": ""1""
}
",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "tfexample"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := resourcemanager.NewPolicy(ctx, "example", &resourcemanager.PolicyArgs{
PolicyName: pulumi.String(name),
PolicyDocument: pulumi.String(` {
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:*"]
}],
"Version": "1"
}
`),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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 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 example = new Policy("example", PolicyArgs.builder()
.policyName(name)
.policyDocument("""
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:*"]
}],
"Version": "1"
}
""")
.build());
}
}
Content copied to clipboard
configuration:
name:
type: string
default: tfexample
resources:
example:
type: alicloud:resourcemanager:Policy
properties:
policyName: ${name}
policyDocument: |
{
"Statement": [{
"Action": ["oss:*"],
"Effect": "Allow",
"Resource": ["acs:oss:*:*:*"]
}],
"Version": "1"
}
Content copied to clipboard
Import
Resource Manager Policy can be imported using the id, e.g.
$ pulumi import alicloud:resourcemanager/policy:Policy example abc12345
Content copied to clipboard
Properties
Link copied to clipboard
The version of the policy. Default to v1.
Link copied to clipboard
The description of the policy. The description must be 1 to 1,024 characters in length.
Link copied to clipboard
The content of the policy. The content must be 1 to 2,048 characters in length.
Link copied to clipboard
The name of the policy. name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).