HostAccount

class HostAccount : KotlinCustomResource

Provides a Bastion Host Host Account resource. For information about Bastion Host Host Account and how to use it, see What is Host Account.

NOTE: Available since 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.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.bastionhost.Instance;
import com.pulumi.alicloud.bastionhost.InstanceArgs;
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 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) {
final var config = ctx.config();
final var name = config.get("name").orElse("tf_example");
final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
.availableResourceCreation("VSwitch")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("10.4.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vswitchName(name)
.cidrBlock("10.4.0.0/24")
.vpcId(defaultNetwork.id())
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
.build());
var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
.vpcId(defaultNetwork.id())
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.description(name)
.licenseCode("bhah_ent_50_asset")
.planCode("cloudbastion")
.storage("5")
.bandwidth("5")
.period("1")
.vswitchId(defaultSwitch.id())
.securityGroupIds(defaultSecurityGroup.id())
.build());
var defaultHost = new Host("defaultHost", HostArgs.builder()
.instanceId(defaultInstance.id())
.hostName(name)
.activeAddressType("Private")
.hostPrivateAddress("172.16.0.10")
.osType("Linux")
.source("Local")
.build());
var defaultHostAccount = new HostAccount("defaultHostAccount", HostAccountArgs.builder()
.hostAccountName(name)
.hostId(defaultHost.hostId())
.instanceId(defaultHost.instanceId())
.protocolName("SSH")
.password("YourPassword12345")
.build());
}
}

Import

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

$ pulumi import alicloud:bastionhost/hostAccount:HostAccount example <instance_id>:<host_account_id>

Properties

Link copied to clipboard
val hostAccountId: Output<String>

Hosting account ID.

Link copied to clipboard
val hostAccountName: Output<String>

The name of the host account. The name can be up to 128 characters in length.

Link copied to clipboard
val hostId: Output<String>

The ID of the host for which you want to create an account.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

The ID of the Bastionhost instance where you want to create an account for the host.

Link copied to clipboard
val passPhrase: Output<String>?

The passphrase of the private key for the host account. NOTE: It is valid when the attribute protocol_name is SSH.

Link copied to clipboard
val password: Output<String>?

The password of the host account.

Link copied to clipboard
val privateKey: Output<String>?

The private key of the host account. The value is a Base64-encoded string. NOTE: It is valid when the attribute protocol_name is SSH

Link copied to clipboard
val protocolName: Output<String>

The protocol used by the host account. Valid values: SSH,RDP

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>