EcsKeyPair

class EcsKeyPair : KotlinCustomResource

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>

Properties

Link copied to clipboard
val fingerPrint: Output<String>

The finger print of the key pair.

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

The key file.

Link copied to clipboard
val keyName: Output<String>

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

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>?

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 pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>?

The Id of resource group which the key pair belongs.

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