Policy

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 in v1.83.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new AliCloud.ResourceManager.Policy("example", new AliCloud.ResourceManager.PolicyArgs
        {
            PolicyDocument = @"       {
         ""Statement"": [{
             ""Action"": [""oss:*""],
             ""Effect"": ""Allow"",
             ""Resource"": [""acs:oss:*:*:*""]
         }],
         ""Version"": ""1""
     }
    
",
            PolicyName = "abc12345",
        });
    }

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example = alicloud.resourcemanager.Policy("example",
    policy_document="""      {
            "Statement": [{
                "Action": ["oss:*"],
                "Effect": "Allow",
                "Resource": ["acs:oss:*:*:*"]
            }],
            "Version": "1"
        }
    
""",
    policy_name="abc12345")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.resourcemanager.Policy("example", {
    policyDocument: `       {
            "Statement": [{
                "Action": ["oss:*"],
                "Effect": "Allow",
                "Resource": ["acs:oss:*:*:*"]
            }],
            "Version": "1"
        }
    `,
    policyName: "abc12345",
});

Create a Policy Resource

new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);
def Policy(resource_name, opts=None, default_version=None, description=None, policy_document=None, policy_name=None, __props__=None);
func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)
public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Policy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Policy resource accepts the following input properties:

PolicyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

PolicyName string

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

DefaultVersion string

The version of the policy. Default to v1.

Description string

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

PolicyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

PolicyName string

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

DefaultVersion string

The version of the policy. Default to v1.

Description string

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

policyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

policyName string

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

defaultVersion string

The version of the policy. Default to v1.

description string

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

policy_document str

The content of the policy. The content must be 1 to 2,048 characters in length.

policy_name str

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

default_version str

The version of the policy. Default to v1.

description str

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

Outputs

All input properties are implicitly available as output properties. Additionally, the Policy resource produces the following output properties:

CreateDate string

The time when the policy was created.

Id string
The provider-assigned unique ID for this managed resource.
PolicyType string

The type of the policy. Valid values: Custom, System.

CreateDate string

The time when the policy was created.

Id string
The provider-assigned unique ID for this managed resource.
PolicyType string

The type of the policy. Valid values: Custom, System.

createDate string

The time when the policy was created.

id string
The provider-assigned unique ID for this managed resource.
policyType string

The type of the policy. Valid values: Custom, System.

create_date str

The time when the policy was created.

id str
The provider-assigned unique ID for this managed resource.
policy_type str

The type of the policy. Valid values: Custom, System.

Look up an Existing Policy Resource

Get an existing Policy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PolicyState, opts?: CustomResourceOptions): Policy
static get(resource_name, id, opts=None, create_date=None, default_version=None, description=None, policy_document=None, policy_name=None, policy_type=None, __props__=None);
func GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)
public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

CreateDate string

The time when the policy was created.

DefaultVersion string

The version of the policy. Default to v1.

Description string

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

PolicyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

PolicyName string

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

PolicyType string

The type of the policy. Valid values: Custom, System.

CreateDate string

The time when the policy was created.

DefaultVersion string

The version of the policy. Default to v1.

Description string

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

PolicyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

PolicyName string

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

PolicyType string

The type of the policy. Valid values: Custom, System.

createDate string

The time when the policy was created.

defaultVersion string

The version of the policy. Default to v1.

description string

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

policyDocument string

The content of the policy. The content must be 1 to 2,048 characters in length.

policyName string

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

policyType string

The type of the policy. Valid values: Custom, System.

create_date str

The time when the policy was created.

default_version str

The version of the policy. Default to v1.

description str

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

policy_document str

The content of the policy. The content must be 1 to 2,048 characters in length.

policy_name str

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

policy_type str

The type of the policy. Valid values: Custom, System.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.