volcengine.cloud_identity.UserAttachment
Explore with Pulumi AI
Provides a resource to manage cloud identity user attachment
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const fooGroup = new volcengine.cloud_identity.Group("fooGroup", {
groupName: "acc-test-group",
displayName: "tf-test-group",
joinType: "Manual",
description: "tf",
});
const fooUser = new volcengine.cloud_identity.User("fooUser", {
userName: "acc-test-user",
displayName: "tf-test-user",
description: "tf",
email: "88@qq.com",
phone: "181",
});
const fooUserAttachment = new volcengine.cloud_identity.UserAttachment("fooUserAttachment", {
userId: fooUser.id,
groupId: fooGroup.id,
});
import pulumi
import pulumi_volcengine as volcengine
foo_group = volcengine.cloud_identity.Group("fooGroup",
group_name="acc-test-group",
display_name="tf-test-group",
join_type="Manual",
description="tf")
foo_user = volcengine.cloud_identity.User("fooUser",
user_name="acc-test-user",
display_name="tf-test-user",
description="tf",
email="88@qq.com",
phone="181")
foo_user_attachment = volcengine.cloud_identity.UserAttachment("fooUserAttachment",
user_id=foo_user.id,
group_id=foo_group.id)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cloud_identity"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooGroup, err := cloud_identity.NewGroup(ctx, "fooGroup", &cloud_identity.GroupArgs{
GroupName: pulumi.String("acc-test-group"),
DisplayName: pulumi.String("tf-test-group"),
JoinType: pulumi.String("Manual"),
Description: pulumi.String("tf"),
})
if err != nil {
return err
}
fooUser, err := cloud_identity.NewUser(ctx, "fooUser", &cloud_identity.UserArgs{
UserName: pulumi.String("acc-test-user"),
DisplayName: pulumi.String("tf-test-user"),
Description: pulumi.String("tf"),
Email: pulumi.String("88@qq.com"),
Phone: pulumi.String("181"),
})
if err != nil {
return err
}
_, err = cloud_identity.NewUserAttachment(ctx, "fooUserAttachment", &cloud_identity.UserAttachmentArgs{
UserId: fooUser.ID(),
GroupId: fooGroup.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooGroup = new Volcengine.Cloud_identity.Group("fooGroup", new()
{
GroupName = "acc-test-group",
DisplayName = "tf-test-group",
JoinType = "Manual",
Description = "tf",
});
var fooUser = new Volcengine.Cloud_identity.User("fooUser", new()
{
UserName = "acc-test-user",
DisplayName = "tf-test-user",
Description = "tf",
Email = "88@qq.com",
Phone = "181",
});
var fooUserAttachment = new Volcengine.Cloud_identity.UserAttachment("fooUserAttachment", new()
{
UserId = fooUser.Id,
GroupId = fooGroup.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.cloud_identity.Group;
import com.pulumi.volcengine.cloud_identity.GroupArgs;
import com.pulumi.volcengine.cloud_identity.User;
import com.pulumi.volcengine.cloud_identity.UserArgs;
import com.pulumi.volcengine.cloud_identity.UserAttachment;
import com.pulumi.volcengine.cloud_identity.UserAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var fooGroup = new Group("fooGroup", GroupArgs.builder()
.groupName("acc-test-group")
.displayName("tf-test-group")
.joinType("Manual")
.description("tf")
.build());
var fooUser = new User("fooUser", UserArgs.builder()
.userName("acc-test-user")
.displayName("tf-test-user")
.description("tf")
.email("88@qq.com")
.phone("181")
.build());
var fooUserAttachment = new UserAttachment("fooUserAttachment", UserAttachmentArgs.builder()
.userId(fooUser.id())
.groupId(fooGroup.id())
.build());
}
}
resources:
fooGroup:
type: volcengine:cloud_identity:Group
properties:
groupName: acc-test-group
displayName: tf-test-group
joinType: Manual
description: tf
fooUser:
type: volcengine:cloud_identity:User
properties:
userName: acc-test-user
displayName: tf-test-user
description: tf
email: 88@qq.com
phone: '181'
fooUserAttachment:
type: volcengine:cloud_identity:UserAttachment
properties:
userId: ${fooUser.id}
groupId: ${fooGroup.id}
Create UserAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserAttachment(name: string, args: UserAttachmentArgs, opts?: CustomResourceOptions);
@overload
def UserAttachment(resource_name: str,
args: UserAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def UserAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
user_id: Optional[str] = None)
func NewUserAttachment(ctx *Context, name string, args UserAttachmentArgs, opts ...ResourceOption) (*UserAttachment, error)
public UserAttachment(string name, UserAttachmentArgs args, CustomResourceOptions? opts = null)
public UserAttachment(String name, UserAttachmentArgs args)
public UserAttachment(String name, UserAttachmentArgs args, CustomResourceOptions options)
type: volcengine:cloud_identity:UserAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UserAttachmentArgs
- 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 UserAttachmentArgs
- 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 UserAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserAttachmentArgs
- 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 userAttachmentResource = new Volcengine.Cloud_identity.UserAttachment("userAttachmentResource", new()
{
GroupId = "string",
UserId = "string",
});
example, err := cloud_identity.NewUserAttachment(ctx, "userAttachmentResource", &cloud_identity.UserAttachmentArgs{
GroupId: pulumi.String("string"),
UserId: pulumi.String("string"),
})
var userAttachmentResource = new UserAttachment("userAttachmentResource", UserAttachmentArgs.builder()
.groupId("string")
.userId("string")
.build());
user_attachment_resource = volcengine.cloud_identity.UserAttachment("userAttachmentResource",
group_id="string",
user_id="string")
const userAttachmentResource = new volcengine.cloud_identity.UserAttachment("userAttachmentResource", {
groupId: "string",
userId: "string",
});
type: volcengine:cloud_identity:UserAttachment
properties:
groupId: string
userId: string
UserAttachment 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 UserAttachment resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the UserAttachment 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 UserAttachment Resource
Get an existing UserAttachment 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?: UserAttachmentState, opts?: CustomResourceOptions): UserAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_id: Optional[str] = None,
user_id: Optional[str] = None) -> UserAttachment
func GetUserAttachment(ctx *Context, name string, id IDInput, state *UserAttachmentState, opts ...ResourceOption) (*UserAttachment, error)
public static UserAttachment Get(string name, Input<string> id, UserAttachmentState? state, CustomResourceOptions? opts = null)
public static UserAttachment get(String name, Output<String> id, UserAttachmentState 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.
Import
CloudIdentityUserAttachment can be imported using the group_id:user_id, e.g.
$ pulumi import volcengine:cloud_identity/userAttachment:UserAttachment default resource_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.