Host

class Host : KotlinCustomResource

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

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 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());
}
}

Import

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

$ pulumi import alicloud:bastionhost/host:Host example <instance_id>:<host_id>

Properties

Link copied to clipboard

Specify the new create a host of address types. Valid values: Public: the IP address of a Public network. Private: Private network address.

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

Specify a host of notes, supports up to 500 characters.

Link copied to clipboard
val hostId: Output<String>

The host ID.

Link copied to clipboard
val hostName: Output<String>

Specify the new create a host name of the supports up to 128 characters.

Link copied to clipboard

Specify the new create a host of the private network address, it is possible to use the domain name or IP ADDRESS. NOTE: This parameter is required if the active_address_type parameter is set to Private.

Link copied to clipboard

Specify the new create a host of the IP address of a public network, it is possible to use the domain name or IP ADDRESS.

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

Specify the new create a host where the Bastion host ID of.

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

The instance region id.

Link copied to clipboard
val osType: Output<String>

Specify the new create the host's operating system. Valid values: Linux,Windows.

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

Specify the new create a host of source. Valid values:

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

Specify the newly created ECS instance ID or dedicated cluster host ID. NOTE: This parameter is required if the source parameter is set to Ecs or Rds.

Link copied to clipboard
val urn: Output<String>