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
new PolicyVersion(name: string, args: PolicyVersionArgs, opts?: CustomResourceOptions);def PolicyVersion(resource_name, opts=None, is_default_version=None, policy_document=None, policy_name=None, __props__=None);func NewPolicyVersion(ctx *Context, name string, args PolicyVersionArgs, opts ...ResourceOption) (*PolicyVersion, error)public PolicyVersion(string name, PolicyVersionArgs args, CustomResourceOptions? opts = null)- 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:
- Policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- Policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Is
Default boolVersion Specifies whether to set the policy version as the default version. Default to
false.
- Policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- Policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Is
Default boolVersion Specifies whether to set the policy version as the default version. Default to
false.
- policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- is
Default booleanVersion 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_ boolversion 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:
- 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): PolicyVersionstatic 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:
- Create
Date string The time when the policy version was created.
- Is
Default boolVersion Specifies whether to set the policy version as the default version. Default to
false.- Policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- Policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Version
Id string The ID of the policy version.
- Create
Date string The time when the policy version was created.
- Is
Default boolVersion Specifies whether to set the policy version as the default version. Default to
false.- Policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- Policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- Version
Id string The ID of the policy version.
- create
Date string The time when the policy version was created.
- is
Default booleanVersion Specifies whether to set the policy version as the default version. Default to
false.- policy
Document string The content of the policy. The content must be 1 to 2,048 characters in length.
- policy
Name string The name of the policy. Name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).
- version
Id string The ID of the policy version.
- create_
date str The time when the policy version was created.
- is_
default_ boolversion 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
alicloudTerraform Provider.