KeyPairArgs

data class KeyPairArgs(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<KeyPairArgs>

DEPRECATED: This resource has been renamed to alicloud.ecs.EcsKeyPair from version 1.121.0. Provides a key pair resource.

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.KeyPair;
import com.pulumi.alicloud.ecs.KeyPairArgs;
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 basic = new KeyPair("basic", KeyPairArgs.builder()
.keyName("terraform-test-key-pair")
.build());
var prefix = new KeyPair("prefix", KeyPairArgs.builder()
.keyNamePrefix("terraform-test-key-pair-prefix")
.build());
var publickey = new KeyPair("publickey", KeyPairArgs.builder()
.keyName("my_public_key")
.publicKey("ssh-rsa AAAAB3Nza12345678qwertyuudsfsg")
.build());
}
}

Import

Key pair can be imported using the name, e.g.

$ pulumi import alicloud:ecs/keyPair:KeyPair example my_public_key

Constructors

Link copied to clipboard
fun KeyPairArgs(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(): KeyPairArgs

Properties

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

The name of file to save your new key pair's private key. Strongly suggest you to specified it when you creating key pair, otherwise, you wouldn't get its private key ever.

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

The key pair's name. It is the only in one Alicloud account.

Link copied to clipboard
val keyNamePrefix: Output<String>? = null
Link copied to clipboard
val keyPairName: Output<String>? = null
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