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:
- 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 (-).
- Default
Version 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 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 (-).
- Default
Version 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 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 (-).
- default
Version 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:
- Create
Date string The time when the policy was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Type string The type of the policy. Valid values:
Custom,System.
- Create
Date string The time when the policy was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Type string The type of the policy. Valid values:
Custom,System.
- create
Date string The time when the policy was created.
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Type 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): Policystatic 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:
- Create
Date string The time when the policy was created.
- Default
Version 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 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 (-).
- Policy
Type string The type of the policy. Valid values:
Custom,System.
- Create
Date string The time when the policy was created.
- Default
Version 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 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 (-).
- Policy
Type string The type of the policy. Valid values:
Custom,System.
- create
Date string The time when the policy was created.
- default
Version 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 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 (-).
- policy
Type 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
alicloudTerraform Provider.