EcsKeyPairArgs

data class EcsKeyPairArgs(val keyFile: Output<String>? = null, val keyName: Output<String>? = null, val keyNamePrefix: Output<String>? = null, val keyPairName: Output<String>? = null, val publicKey: Output<String>? = null, val resourceGroupId: Output<String>? = null, val tags: Output<Map<String, Any>>? = null) : ConvertibleToJava<EcsKeyPairArgs>

Provides a ECS Key Pair resource. For information about ECS Key Pair and how to use it, see What is Key Pair.

NOTE: Available in v1.121.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.ecs.EcsKeyPair;
import com.pulumi.alicloud.ecs.EcsKeyPairArgs;
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 EcsKeyPair("example", EcsKeyPairArgs.builder()
.keyPairName("key_pair_name")
.build());
var prefix = new EcsKeyPair("prefix", EcsKeyPairArgs.builder()
.keyNamePrefix("terraform-test-key-pair-prefix")
.build());
var publickey = new EcsKeyPair("publickey", EcsKeyPairArgs.builder()
.keyPairName("my_public_key")
.publicKey("ssh-rsa AAAAB3Nza12345678qwertyuudsfsg")
.build());
}
}

Import

ECS Key Pair can be imported using the id, e.g.

$ pulumi import alicloud:ecs/ecsKeyPair:EcsKeyPair example <key_name>

Constructors

Link copied to clipboard
fun EcsKeyPairArgs(keyFile: Output<String>? = null, keyName: Output<String>? = null, keyNamePrefix: Output<String>? = null, keyPairName: Output<String>? = null, publicKey: Output<String>? = null, resourceGroupId: Output<String>? = null, tags: Output<Map<String, Any>>? = null)

Functions

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

Properties

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

The key file.

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

Field key_name has been deprecated from provider version 1.121.0. New field key_pair_name instead.

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

The key pair's name. It is the only in one Alicloud account, the key pair's name. must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.

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

You can import an existing public key and using Alicloud key pair to manage it. If this parameter is specified, resource_group_id is the key pair belongs.

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

The Id of resource group which the key pair belongs.

Link copied to clipboard
val tags: Output<Map<String, Any>>? = null