alicloud logo
Alibaba Cloud v3.29.0, Jan 20 23

alicloud.bastionhost.UserAttachment

Provides a Bastion Host User Attachment resource to add user to one user group.

NOTE: Available in v1.134.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = new AliCloud.BastionHost.UserAttachment("example", new()
    {
        InstanceId = "bastionhost-cn-tl3xxxxxxx",
        UserGroupId = "10",
        UserId = "100",
    });

});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/bastionhost"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bastionhost.NewUserAttachment(ctx, "example", &bastionhost.UserAttachmentArgs{
			InstanceId:  pulumi.String("bastionhost-cn-tl3xxxxxxx"),
			UserGroupId: pulumi.String("10"),
			UserId:      pulumi.String("100"),
		})
		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.alicloud.bastionhost.UserAttachment;
import com.pulumi.alicloud.bastionhost.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 example = new UserAttachment("example", UserAttachmentArgs.builder()        
            .instanceId("bastionhost-cn-tl3xxxxxxx")
            .userGroupId("10")
            .userId("100")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.bastionhost.UserAttachment("example",
    instance_id="bastionhost-cn-tl3xxxxxxx",
    user_group_id="10",
    user_id="100")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = new alicloud.bastionhost.UserAttachment("example", {
    instanceId: "bastionhost-cn-tl3xxxxxxx",
    userGroupId: "10",
    userId: "100",
});
resources:
  example:
    type: alicloud:bastionhost:UserAttachment
    properties:
      instanceId: bastionhost-cn-tl3xxxxxxx
      userGroupId: '10'
      userId: '100'

Create UserAttachment Resource

new UserAttachment(name: string, args: UserAttachmentArgs, opts?: CustomResourceOptions);
@overload
def UserAttachment(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   instance_id: Optional[str] = None,
                   user_group_id: Optional[str] = None,
                   user_id: Optional[str] = None)
@overload
def UserAttachment(resource_name: str,
                   args: UserAttachmentArgs,
                   opts: Optional[ResourceOptions] = 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: alicloud:bastionhost:UserAttachment
properties: # The arguments to resource properties.
options: # 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.
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.

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

The UserAttachment resource accepts the following input properties:

InstanceId string

Specifies the user group to add the user's bastion host ID of.

UserGroupId string

Specifies the user group to which you want to add the user ID.

UserId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

InstanceId string

Specifies the user group to add the user's bastion host ID of.

UserGroupId string

Specifies the user group to which you want to add the user ID.

UserId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId String

Specifies the user group to add the user's bastion host ID of.

userGroupId String

Specifies the user group to which you want to add the user ID.

userId String

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId string

Specifies the user group to add the user's bastion host ID of.

userGroupId string

Specifies the user group to which you want to add the user ID.

userId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instance_id str

Specifies the user group to add the user's bastion host ID of.

user_group_id str

Specifies the user group to which you want to add the user ID.

user_id str

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId String

Specifies the user group to add the user's bastion host ID of.

userGroupId String

Specifies the user group to which you want to add the user ID.

userId String

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

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,
        instance_id: Optional[str] = None,
        user_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.
The following state arguments are supported:
InstanceId string

Specifies the user group to add the user's bastion host ID of.

UserGroupId string

Specifies the user group to which you want to add the user ID.

UserId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

InstanceId string

Specifies the user group to add the user's bastion host ID of.

UserGroupId string

Specifies the user group to which you want to add the user ID.

UserId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId String

Specifies the user group to add the user's bastion host ID of.

userGroupId String

Specifies the user group to which you want to add the user ID.

userId String

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId string

Specifies the user group to add the user's bastion host ID of.

userGroupId string

Specifies the user group to which you want to add the user ID.

userId string

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instance_id str

Specifies the user group to add the user's bastion host ID of.

user_group_id str

Specifies the user group to which you want to add the user ID.

user_id str

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

instanceId String

Specifies the user group to add the user's bastion host ID of.

userGroupId String

Specifies the user group to which you want to add the user ID.

userId String

Specify that you want to add to the policy attached to the user group ID. This includes response parameters in a Json-formatted string supports up to set up 100 USER ID.

Import

Bastion Host User Attachment can be imported using the id, e.g.

 $ pulumi import alicloud:bastionhost/userAttachment:UserAttachment example <instance_id>:<user_group_id>:<user_id>

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.