1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. resourcemanager
  5. PolicyAttachment
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.resourcemanager.PolicyAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a Resource Manager Policy Attachment resource to attaches a policy to an object. After you attach a policy to an object, the object has the operation permissions on the current resource group or the resources under the current account. For information about Resource Manager Policy Attachment and how to use it, see How to authorize and manage resource groups.

    NOTE: Available since v1.93.0.

    Create PolicyAttachment Resource

    new PolicyAttachment(name: string, args: PolicyAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def PolicyAttachment(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         policy_name: Optional[str] = None,
                         policy_type: Optional[str] = None,
                         principal_name: Optional[str] = None,
                         principal_type: Optional[str] = None,
                         resource_group_id: Optional[str] = None)
    @overload
    def PolicyAttachment(resource_name: str,
                         args: PolicyAttachmentArgs,
                         opts: Optional[ResourceOptions] = None)
    func NewPolicyAttachment(ctx *Context, name string, args PolicyAttachmentArgs, opts ...ResourceOption) (*PolicyAttachment, error)
    public PolicyAttachment(string name, PolicyAttachmentArgs args, CustomResourceOptions? opts = null)
    public PolicyAttachment(String name, PolicyAttachmentArgs args)
    public PolicyAttachment(String name, PolicyAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:resourcemanager:PolicyAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args PolicyAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PolicyAttachmentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PolicyAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PolicyAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PolicyAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    PolicyAttachment Resource Properties

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

    Inputs

    The PolicyAttachment resource accepts the following input properties:

    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.
    PrincipalName string
    The name of the object to which you want to attach the policy.
    PrincipalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    ResourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    PrincipalName string
    The name of the object to which you want to attach the policy.
    PrincipalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    ResourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName String
    The name of the object to which you want to attach the policy.
    principalType String
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId String
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName string
    The name of the object to which you want to attach the policy.
    principalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principal_name str
    The name of the object to which you want to attach the policy.
    principal_type str
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resource_group_id str
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName String
    The name of the object to which you want to attach the policy.
    principalType String
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId String
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PolicyAttachment Resource

    Get an existing PolicyAttachment 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?: PolicyAttachmentState, opts?: CustomResourceOptions): PolicyAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            policy_name: Optional[str] = None,
            policy_type: Optional[str] = None,
            principal_name: Optional[str] = None,
            principal_type: Optional[str] = None,
            resource_group_id: Optional[str] = None) -> PolicyAttachment
    func GetPolicyAttachment(ctx *Context, name string, id IDInput, state *PolicyAttachmentState, opts ...ResourceOption) (*PolicyAttachment, error)
    public static PolicyAttachment Get(string name, Input<string> id, PolicyAttachmentState? state, CustomResourceOptions? opts = null)
    public static PolicyAttachment get(String name, Output<String> id, PolicyAttachmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    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.
    PrincipalName string
    The name of the object to which you want to attach the policy.
    PrincipalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    ResourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    PrincipalName string
    The name of the object to which you want to attach the policy.
    PrincipalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    ResourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName String
    The name of the object to which you want to attach the policy.
    principalType String
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId String
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName string
    The name of the object to which you want to attach the policy.
    principalType string
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId string
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principal_name str
    The name of the object to which you want to attach the policy.
    principal_type str
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resource_group_id str
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.
    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.
    principalName String
    The name of the object to which you want to attach the policy.
    principalType String
    The type of the object to which you want to attach the policy. Valid values: IMSUser: RAM user, IMSGroup: RAM user group, ServiceRole: RAM role.
    resourceGroupId String
    The ID of the resource group or the ID of the Alibaba Cloud account to which the resource group belongs.

    Import

    Resource Manager Policy Attachment can be imported using the id, e.g.

    $ pulumi import alicloud:resourcemanager/policyAttachment:PolicyAttachment example tf-testaccrdpolicy:Custom:tf-testaccrdpolicy@11827252********.onaliyun.com:IMSUser:rg******
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi