PolicyVersion

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

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

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

}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

example_policy = alicloud.resourcemanager.Policy("examplePolicy",
    policy_name="tftest",
    policy_document="""      {
            "Statement": [{
                "Action": ["oss:*"],
                "Effect": "Allow",
                "Resource": ["acs:oss:*:*:*"]
            }],
            "Version": "1"
        }
""")
example_policy_version = alicloud.resourcemanager.PolicyVersion("examplePolicyVersion",
    policy_name=example_policy.policy_name,
    policy_document="""      {
            "Statement": [{
                "Action": ["oss:*"],
                "Effect": "Allow",
                "Resource": ["acs:oss:*:*:myphotos"]
            }],
            "Version": "1"
        }
""")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

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

Create a PolicyVersion Resource

def PolicyVersion(resource_name, opts=None, is_default_version=None, policy_document=None, policy_name=None, __props__=None);
name string
The unique name of the resource.
args PolicyVersionArgs
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 PolicyVersionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PolicyVersionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

PolicyVersion Resource Properties

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

Inputs

The PolicyVersion 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 (-).

IsDefaultVersion bool

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

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 (-).

IsDefaultVersion bool

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

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 (-).

isDefaultVersion boolean

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

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 (-).

is_default_version bool

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

Outputs

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

CreateDate string

The time when the policy version was created.

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

The ID of the policy version.

CreateDate string

The time when the policy version was created.

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

The ID of the policy version.

createDate string

The time when the policy version was created.

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

The ID of the policy version.

create_date str

The time when the policy version was created.

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

The ID of the policy version.

Look up an Existing PolicyVersion Resource

Get an existing PolicyVersion 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?: PolicyVersionState, opts?: CustomResourceOptions): PolicyVersion
static get(resource_name, id, opts=None, create_date=None, is_default_version=None, policy_document=None, policy_name=None, version_id=None, __props__=None);
func GetPolicyVersion(ctx *Context, name string, id IDInput, state *PolicyVersionState, opts ...ResourceOption) (*PolicyVersion, error)
public static PolicyVersion Get(string name, Input<string> id, PolicyVersionState? 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 version was created.

IsDefaultVersion bool

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

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 (-).

VersionId string

The ID of the policy version.

CreateDate string

The time when the policy version was created.

IsDefaultVersion bool

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

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 (-).

VersionId string

The ID of the policy version.

createDate string

The time when the policy version was created.

isDefaultVersion boolean

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

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 (-).

versionId string

The ID of the policy version.

create_date str

The time when the policy version was created.

is_default_version bool

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

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 (-).

version_id str

The ID of the policy version.

Package Details

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