1. Packages
  2. Ucloud Provider
  3. API Docs
  4. IamUserPolicyAttachment
ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud

ucloud.IamUserPolicyAttachment

Explore with Pulumi AI

Provides an IAM group membership resource.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  fooIamUser:
    type: ucloud:IamUser
    properties:
      loginEnable: false
      isFrozen: false
  fooIamProject:
    type: ucloud:IamProject
  fooIamPolicy:
    type: ucloud:IamPolicy
    properties:
      comment: comment
      policy:
        fn::toJSON:
          Version: '1'
          Statement:
            - Action:
                - '*'
              Effect: Allow
              Resource:
                - '*'
      scopeType: Project
  fooIamUserPolicyAttachment:
    type: ucloud:IamUserPolicyAttachment
    properties:
      userName: ${fooIamUser.name}
      policyUrn: ${fooIamPolicy.ucloudUrn}
      projectId: ${fooIamProject.iamProjectId}
Copy

Create IamUserPolicyAttachment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new IamUserPolicyAttachment(name: string, args: IamUserPolicyAttachmentArgs, opts?: CustomResourceOptions);
@overload
def IamUserPolicyAttachment(resource_name: str,
                            args: IamUserPolicyAttachmentArgs,
                            opts: Optional[ResourceOptions] = None)

@overload
def IamUserPolicyAttachment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            policy_urn: Optional[str] = None,
                            user_name: Optional[str] = None,
                            iam_user_policy_attachment_id: Optional[str] = None,
                            project_id: Optional[str] = None)
func NewIamUserPolicyAttachment(ctx *Context, name string, args IamUserPolicyAttachmentArgs, opts ...ResourceOption) (*IamUserPolicyAttachment, error)
public IamUserPolicyAttachment(string name, IamUserPolicyAttachmentArgs args, CustomResourceOptions? opts = null)
public IamUserPolicyAttachment(String name, IamUserPolicyAttachmentArgs args)
public IamUserPolicyAttachment(String name, IamUserPolicyAttachmentArgs args, CustomResourceOptions options)
type: ucloud:IamUserPolicyAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. IamUserPolicyAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. IamUserPolicyAttachmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. IamUserPolicyAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. IamUserPolicyAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. IamUserPolicyAttachmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var iamUserPolicyAttachmentResource = new Ucloud.IamUserPolicyAttachment("iamUserPolicyAttachmentResource", new()
{
    PolicyUrn = "string",
    UserName = "string",
    IamUserPolicyAttachmentId = "string",
    ProjectId = "string",
});
Copy
example, err := ucloud.NewIamUserPolicyAttachment(ctx, "iamUserPolicyAttachmentResource", &ucloud.IamUserPolicyAttachmentArgs{
PolicyUrn: pulumi.String("string"),
UserName: pulumi.String("string"),
IamUserPolicyAttachmentId: pulumi.String("string"),
ProjectId: pulumi.String("string"),
})
Copy
var iamUserPolicyAttachmentResource = new IamUserPolicyAttachment("iamUserPolicyAttachmentResource", IamUserPolicyAttachmentArgs.builder()
    .policyUrn("string")
    .userName("string")
    .iamUserPolicyAttachmentId("string")
    .projectId("string")
    .build());
Copy
iam_user_policy_attachment_resource = ucloud.IamUserPolicyAttachment("iamUserPolicyAttachmentResource",
    policy_urn="string",
    user_name="string",
    iam_user_policy_attachment_id="string",
    project_id="string")
Copy
const iamUserPolicyAttachmentResource = new ucloud.IamUserPolicyAttachment("iamUserPolicyAttachmentResource", {
    policyUrn: "string",
    userName: "string",
    iamUserPolicyAttachmentId: "string",
    projectId: "string",
});
Copy
type: ucloud:IamUserPolicyAttachment
properties:
    iamUserPolicyAttachmentId: string
    policyUrn: string
    projectId: string
    userName: string
Copy

IamUserPolicyAttachment Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The IamUserPolicyAttachment resource accepts the following input properties:

PolicyUrn This property is required. string
URN of the IAM policy, including user policy and system policy.
UserName This property is required. string
Name of the IAM user.
IamUserPolicyAttachmentId string
ProjectId string
ID of the IAM project, which is the scope of the policy.
PolicyUrn This property is required. string
URN of the IAM policy, including user policy and system policy.
UserName This property is required. string
Name of the IAM user.
IamUserPolicyAttachmentId string
ProjectId string
ID of the IAM project, which is the scope of the policy.
policyUrn This property is required. String
URN of the IAM policy, including user policy and system policy.
userName This property is required. String
Name of the IAM user.
iamUserPolicyAttachmentId String
projectId String
ID of the IAM project, which is the scope of the policy.
policyUrn This property is required. string
URN of the IAM policy, including user policy and system policy.
userName This property is required. string
Name of the IAM user.
iamUserPolicyAttachmentId string
projectId string
ID of the IAM project, which is the scope of the policy.
policy_urn This property is required. str
URN of the IAM policy, including user policy and system policy.
user_name This property is required. str
Name of the IAM user.
iam_user_policy_attachment_id str
project_id str
ID of the IAM project, which is the scope of the policy.
policyUrn This property is required. String
URN of the IAM policy, including user policy and system policy.
userName This property is required. String
Name of the IAM user.
iamUserPolicyAttachmentId String
projectId String
ID of the IAM project, which is the scope of the policy.

Outputs

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

CreateTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
Id string
The provider-assigned unique ID for this managed resource.
CreateTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
Id string
The provider-assigned unique ID for this managed resource.
createTime String
The time of creation of group policy attachment, formatted in RFC3339 time string.
id String
The provider-assigned unique ID for this managed resource.
createTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
id string
The provider-assigned unique ID for this managed resource.
create_time str
The time of creation of group policy attachment, formatted in RFC3339 time string.
id str
The provider-assigned unique ID for this managed resource.
createTime String
The time of creation of group policy attachment, formatted in RFC3339 time string.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing IamUserPolicyAttachment Resource

Get an existing IamUserPolicyAttachment 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?: IamUserPolicyAttachmentState, opts?: CustomResourceOptions): IamUserPolicyAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        create_time: Optional[str] = None,
        iam_user_policy_attachment_id: Optional[str] = None,
        policy_urn: Optional[str] = None,
        project_id: Optional[str] = None,
        user_name: Optional[str] = None) -> IamUserPolicyAttachment
func GetIamUserPolicyAttachment(ctx *Context, name string, id IDInput, state *IamUserPolicyAttachmentState, opts ...ResourceOption) (*IamUserPolicyAttachment, error)
public static IamUserPolicyAttachment Get(string name, Input<string> id, IamUserPolicyAttachmentState? state, CustomResourceOptions? opts = null)
public static IamUserPolicyAttachment get(String name, Output<String> id, IamUserPolicyAttachmentState state, CustomResourceOptions options)
resources:  _:    type: ucloud:IamUserPolicyAttachment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreateTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
IamUserPolicyAttachmentId string
PolicyUrn string
URN of the IAM policy, including user policy and system policy.
ProjectId string
ID of the IAM project, which is the scope of the policy.
UserName string
Name of the IAM user.
CreateTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
IamUserPolicyAttachmentId string
PolicyUrn string
URN of the IAM policy, including user policy and system policy.
ProjectId string
ID of the IAM project, which is the scope of the policy.
UserName string
Name of the IAM user.
createTime String
The time of creation of group policy attachment, formatted in RFC3339 time string.
iamUserPolicyAttachmentId String
policyUrn String
URN of the IAM policy, including user policy and system policy.
projectId String
ID of the IAM project, which is the scope of the policy.
userName String
Name of the IAM user.
createTime string
The time of creation of group policy attachment, formatted in RFC3339 time string.
iamUserPolicyAttachmentId string
policyUrn string
URN of the IAM policy, including user policy and system policy.
projectId string
ID of the IAM project, which is the scope of the policy.
userName string
Name of the IAM user.
create_time str
The time of creation of group policy attachment, formatted in RFC3339 time string.
iam_user_policy_attachment_id str
policy_urn str
URN of the IAM policy, including user policy and system policy.
project_id str
ID of the IAM project, which is the scope of the policy.
user_name str
Name of the IAM user.
createTime String
The time of creation of group policy attachment, formatted in RFC3339 time string.
iamUserPolicyAttachmentId String
policyUrn String
URN of the IAM policy, including user policy and system policy.
projectId String
ID of the IAM project, which is the scope of the policy.
userName String
Name of the IAM user.

Import

IAM user policy attachment can be imported using account/<user-name>/<policy-urn> for account scope policy, or project/<project-id>/<user-name>/<policy-urn> for project scope policy, e.g.

$ pulumi import ucloud:index/iamUserPolicyAttachment:IamUserPolicyAttachment example project/org-xxx/test-user/ucs:iam::ucs:policy/AdministratorAccess
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
ucloud ucloud/terraform-provider-ucloud
License
Notes
This Pulumi package is based on the ucloud Terraform Provider.