HostAccountUserGroupAttachmentArgs

data class HostAccountUserGroupAttachmentArgs(val hostAccountIds: Output<List<String>>? = null, val hostId: Output<String>? = null, val instanceId: Output<String>? = null, val userGroupId: Output<String>? = null) : ConvertibleToJava<HostAccountUserGroupAttachmentArgs>

Provides a Bastion Host Host Account Attachment resource to add list host accounts into one user group.

NOTE: Available in v1.135.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.bastionhost.Host;
import com.pulumi.alicloud.bastionhost.HostArgs;
import com.pulumi.alicloud.bastionhost.HostAccount;
import com.pulumi.alicloud.bastionhost.HostAccountArgs;
import com.pulumi.alicloud.bastionhost.UserGroup;
import com.pulumi.alicloud.bastionhost.UserGroupArgs;
import com.pulumi.alicloud.bastionhost.HostAccountUserGroupAttachment;
import com.pulumi.alicloud.bastionhost.HostAccountUserGroupAttachmentArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 defaultHost = new Host("defaultHost", HostArgs.builder()
.instanceId("bastionhost-cn-tl32bh0no30")
.hostName(var_.name())
.activeAddressType("Private")
.hostPrivateAddress("172.16.0.10")
.osType("Linux")
.source("Local")
.build());
for (var i = 0; i < 3; i++) {
new HostAccount("defaultHostAccount-" + i, HostAccountArgs.builder()
.instanceId(defaultHost.instanceId())
.hostAccountName(String.format("example_value-%s", range.value()))
.hostId(defaultHost.hostId())
.protocolName("SSH")
.password("YourPassword12345")
.build());
}
var defaultUserGroup = new UserGroup("defaultUserGroup", UserGroupArgs.builder()
.instanceId("bastionhost-cn-tl32bh0no30")
.userGroupName(var_.name())
.build());
var defaultHostAccountUserGroupAttachment = new HostAccountUserGroupAttachment("defaultHostAccountUserGroupAttachment", HostAccountUserGroupAttachmentArgs.builder()
.instanceId(defaultHost.instanceId())
.userGroupId(defaultUserGroup.userGroupId())
.hostId(defaultHost.hostId())
.hostAccountIds(defaultHostAccount.stream().map(element -> element.hostAccountId()).collect(toList()))
.build());
}
}

Import

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

$ pulumi import alicloud:bastionhost/hostAccountUserGroupAttachment:HostAccountUserGroupAttachment example <instance_id>:<user_group_id>:<host_id>

Constructors

Link copied to clipboard
fun HostAccountUserGroupAttachmentArgs(hostAccountIds: Output<List<String>>? = null, hostId: Output<String>? = null, instanceId: Output<String>? = null, userGroupId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): HostAccountUserGroupAttachmentArgs

Properties

Link copied to clipboard
val hostAccountIds: Output<List<String>>? = null

A list IDs of the host account.

Link copied to clipboard
val hostId: Output<String>? = null

The ID of the host.

Link copied to clipboard
val instanceId: Output<String>? = null

The ID of the Bastionhost instance where you want to authorize the user group to manage the specified hosts and host accounts.

Link copied to clipboard
val userGroupId: Output<String>? = null

The ID of the user group that you want to authorize to manage the specified hosts and host accounts.