volcengine.iam.UserGroupAttachment
Explore with Pulumi AI
Provides a resource to manage iam user group attachment
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooUser = new Volcengine.Iam.User("fooUser", new()
{
UserName = "acc-test-user",
Description = "acc test",
DisplayName = "name",
});
var fooUserGroup = new Volcengine.Iam.UserGroup("fooUserGroup", new()
{
UserGroupName = "acc-test-group",
Description = "acc-test",
DisplayName = "acctest",
});
var fooUserGroupAttachment = new Volcengine.Iam.UserGroupAttachment("fooUserGroupAttachment", new()
{
UserGroupName = fooUserGroup.UserGroupName,
UserName = fooUser.UserName,
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/iam"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooUser, err := iam.NewUser(ctx, "fooUser", &iam.UserArgs{
UserName: pulumi.String("acc-test-user"),
Description: pulumi.String("acc test"),
DisplayName: pulumi.String("name"),
})
if err != nil {
return err
}
fooUserGroup, err := iam.NewUserGroup(ctx, "fooUserGroup", &iam.UserGroupArgs{
UserGroupName: pulumi.String("acc-test-group"),
Description: pulumi.String("acc-test"),
DisplayName: pulumi.String("acctest"),
})
if err != nil {
return err
}
_, err = iam.NewUserGroupAttachment(ctx, "fooUserGroupAttachment", &iam.UserGroupAttachmentArgs{
UserGroupName: fooUserGroup.UserGroupName,
UserName: fooUser.UserName,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.iam.User;
import com.pulumi.volcengine.iam.UserArgs;
import com.pulumi.volcengine.iam.UserGroup;
import com.pulumi.volcengine.iam.UserGroupArgs;
import com.pulumi.volcengine.iam.UserGroupAttachment;
import com.pulumi.volcengine.iam.UserGroupAttachmentArgs;
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 fooUser = new User("fooUser", UserArgs.builder()
.userName("acc-test-user")
.description("acc test")
.displayName("name")
.build());
var fooUserGroup = new UserGroup("fooUserGroup", UserGroupArgs.builder()
.userGroupName("acc-test-group")
.description("acc-test")
.displayName("acctest")
.build());
var fooUserGroupAttachment = new UserGroupAttachment("fooUserGroupAttachment", UserGroupAttachmentArgs.builder()
.userGroupName(fooUserGroup.userGroupName())
.userName(fooUser.userName())
.build());
}
}
import pulumi
import pulumi_volcengine as volcengine
foo_user = volcengine.iam.User("fooUser",
user_name="acc-test-user",
description="acc test",
display_name="name")
foo_user_group = volcengine.iam.UserGroup("fooUserGroup",
user_group_name="acc-test-group",
description="acc-test",
display_name="acctest")
foo_user_group_attachment = volcengine.iam.UserGroupAttachment("fooUserGroupAttachment",
user_group_name=foo_user_group.user_group_name,
user_name=foo_user.user_name)
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const fooUser = new volcengine.iam.User("fooUser", {
userName: "acc-test-user",
description: "acc test",
displayName: "name",
});
const fooUserGroup = new volcengine.iam.UserGroup("fooUserGroup", {
userGroupName: "acc-test-group",
description: "acc-test",
displayName: "acctest",
});
const fooUserGroupAttachment = new volcengine.iam.UserGroupAttachment("fooUserGroupAttachment", {
userGroupName: fooUserGroup.userGroupName,
userName: fooUser.userName,
});
resources:
fooUser:
type: volcengine:iam:User
properties:
userName: acc-test-user
description: acc test
displayName: name
fooUserGroup:
type: volcengine:iam:UserGroup
properties:
userGroupName: acc-test-group
description: acc-test
displayName: acctest
fooUserGroupAttachment:
type: volcengine:iam:UserGroupAttachment
properties:
userGroupName: ${fooUserGroup.userGroupName}
userName: ${fooUser.userName}
Create UserGroupAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserGroupAttachment(name: string, args: UserGroupAttachmentArgs, opts?: CustomResourceOptions);
@overload
def UserGroupAttachment(resource_name: str,
args: UserGroupAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def UserGroupAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
user_group_name: Optional[str] = None,
user_name: Optional[str] = None)
func NewUserGroupAttachment(ctx *Context, name string, args UserGroupAttachmentArgs, opts ...ResourceOption) (*UserGroupAttachment, error)
public UserGroupAttachment(string name, UserGroupAttachmentArgs args, CustomResourceOptions? opts = null)
public UserGroupAttachment(String name, UserGroupAttachmentArgs args)
public UserGroupAttachment(String name, UserGroupAttachmentArgs args, CustomResourceOptions options)
type: volcengine:iam:UserGroupAttachment
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 UserGroupAttachmentArgs
- 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 UserGroupAttachmentArgs
- 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 UserGroupAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserGroupAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserGroupAttachmentArgs
- 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 userGroupAttachmentResource = new Volcengine.Iam.UserGroupAttachment("userGroupAttachmentResource", new()
{
UserGroupName = "string",
UserName = "string",
});
example, err := iam.NewUserGroupAttachment(ctx, "userGroupAttachmentResource", &iam.UserGroupAttachmentArgs{
UserGroupName: pulumi.String("string"),
UserName: pulumi.String("string"),
})
var userGroupAttachmentResource = new UserGroupAttachment("userGroupAttachmentResource", UserGroupAttachmentArgs.builder()
.userGroupName("string")
.userName("string")
.build());
user_group_attachment_resource = volcengine.iam.UserGroupAttachment("userGroupAttachmentResource",
user_group_name="string",
user_name="string")
const userGroupAttachmentResource = new volcengine.iam.UserGroupAttachment("userGroupAttachmentResource", {
userGroupName: "string",
userName: "string",
});
type: volcengine:iam:UserGroupAttachment
properties:
userGroupName: string
userName: string
UserGroupAttachment 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 UserGroupAttachment resource accepts the following input properties:
- User
Group stringName - The name of the user group.
- User
Name string - The name of the user.
- User
Group stringName - The name of the user group.
- User
Name string - The name of the user.
- user
Group StringName - The name of the user group.
- user
Name String - The name of the user.
- user
Group stringName - The name of the user group.
- user
Name string - The name of the user.
- user_
group_ strname - The name of the user group.
- user_
name str - The name of the user.
- user
Group StringName - The name of the user group.
- user
Name String - The name of the user.
Outputs
All input properties are implicitly available as output properties. Additionally, the UserGroupAttachment 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 UserGroupAttachment Resource
Get an existing UserGroupAttachment 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?: UserGroupAttachmentState, opts?: CustomResourceOptions): UserGroupAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
user_group_name: Optional[str] = None,
user_name: Optional[str] = None) -> UserGroupAttachment
func GetUserGroupAttachment(ctx *Context, name string, id IDInput, state *UserGroupAttachmentState, opts ...ResourceOption) (*UserGroupAttachment, error)
public static UserGroupAttachment Get(string name, Input<string> id, UserGroupAttachmentState? state, CustomResourceOptions? opts = null)
public static UserGroupAttachment get(String name, Output<String> id, UserGroupAttachmentState 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.
- User
Group stringName - The name of the user group.
- User
Name string - The name of the user.
- User
Group stringName - The name of the user group.
- User
Name string - The name of the user.
- user
Group StringName - The name of the user group.
- user
Name String - The name of the user.
- user
Group stringName - The name of the user group.
- user
Name string - The name of the user.
- user_
group_ strname - The name of the user group.
- user_
name str - The name of the user.
- user
Group StringName - The name of the user group.
- user
Name String - The name of the user.
Import
IamUserGroupAttachment can be imported using the id, e.g.
$ pulumi import volcengine:iam/userGroupAttachment:UserGroupAttachment default user_group_id:user_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.