UserArgs

data class UserArgs(val comment: Output<String>? = null, val displayName: Output<String>? = null, val email: Output<String>? = null, val instanceId: Output<String>? = null, val mobile: Output<String>? = null, val mobileCountryCode: Output<String>? = null, val password: Output<String>? = null, val source: Output<String>? = null, val sourceUserId: Output<String>? = null, val status: Output<String>? = null, val userName: Output<String>? = null) : ConvertibleToJava<UserArgs>

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

NOTE: Available since v1.133.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.User;
import com.pulumi.alicloud.bastionhost.UserArgs;
import com.pulumi.alicloud.ram.User;
import com.pulumi.alicloud.ram.UserArgs;
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 localUser = new User("localUser", UserArgs.builder()
.instanceId(defaultInstance.id())
.mobileCountryCode("CN")
.mobile("13312345678")
.password("YourPassword-123")
.source("Local")
.userName(String.format("%s_local_user", name))
.build());
var user = new User("user", UserArgs.builder()
.displayName(String.format("%s_bastionhost_user", name))
.mobile("86-18688888888")
.email("hello.uuu@aaa.com")
.comments("yoyoyo")
.force(true)
.build());
final var defaultAccount = AlicloudFunctions.getAccount();
var ramUser = new User("ramUser", UserArgs.builder()
.instanceId(defaultInstance.id())
.source("Ram")
.sourceUserId(defaultAccount.applyValue(getAccountResult -> getAccountResult.id()))
.userName(user.name())
.build());
}
}

Import

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

$ pulumi import alicloud:bastionhost/user:User example <instance_id>:<user_id>

Constructors

Link copied to clipboard
fun UserArgs(comment: Output<String>? = null, displayName: Output<String>? = null, email: Output<String>? = null, instanceId: Output<String>? = null, mobile: Output<String>? = null, mobileCountryCode: Output<String>? = null, password: Output<String>? = null, source: Output<String>? = null, sourceUserId: Output<String>? = null, status: Output<String>? = null, userName: Output<String>? = null)

Functions

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

Properties

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

Specify the New of the User That Created the Remark Information. Supports up to 500 Characters.

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

Specify the New Created the User's Display Name. Supports up to 128 Characters.

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

Specify the New User's Mailbox.

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

You Want to Query the User the Bastion Host ID of.

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

Specify the New of the User That Created a Different Mobile Phone Number from Your.

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

Specify the New Create User Mobile Phone Number of the International Domain Name. The Default Value Is the CN. Valid Values:

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

Specify the New User's Password. Supports up to 128 Characters. Description of the New User as the Source of the Local User That Is, Source Value for Local, this Parameter Is Required.

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

Specify the New of the User That Created the Source. Valid Values:

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

Specify the Newly Created User Is Uniquely Identified. Indicates That the Parameter Is a Bastion Host Corresponding to the User with the Ram User's Unique Identifier. The Newly Created User Source Grant Permission to a RAM User (That Is, Source Used as a Ram), this Parameter Is Required. You Can Call Access Control of Listusers Interface from the Return Data Userid to Obtain the Parameters.

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

The status of the resource. Valid values: Frozen, Normal.

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

Specify the New User Name. This Parameter Is Only by Letters, Lowercase Letters, Numbers, and Underscores (_), Supports up to 128 Characters.