UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

141 lines (140 loc) 5.56 kB
import * as pulumi from "@pulumi/pulumi"; /** * !> **WARNING:** It has been deprecated, use `huaweicloud.Dew.Keypair` instead. * * Manages a keypair resource within HuaweiCloud. * * ## Example Usage * ### Create a new keypair and export private key to current folder * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test_keypair = new huaweicloud.Ecs.Keypair("test-keypair", { * keyFile: "private_key.pem", * }); * ``` * ### Import an exist keypair * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const test_keypair = new huaweicloud.Ecs.Keypair("test-keypair", { * publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAlJq5Pu+eizhou7nFFDxXofr2ySF8k/yuA9OnJdVF9Fbf85Z59CWNZBvcAT... root@terra-dev", * }); * ``` * * ## Import * * Keypairs can be imported using the `name`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Ecs/keypair:Keypair my-keypair test-keypair * ``` */ export declare class Keypair extends pulumi.CustomResource { /** * Get an existing Keypair resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: KeypairState, opts?: pulumi.CustomResourceOptions): Keypair; /** * Returns true if the given object is an instance of Keypair. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Keypair; /** * Specifies the path of the created private key. * The private key file (**.pem**) is created only after the resource is created. * By default, the private key file will be created in the same folder as the current script file. * If you need to create it in another folder, please specify the path for `keyFile`. * Changing this creates a new keypair. */ readonly keyFile: pulumi.Output<string>; /** * Specifies a unique name for the keypair. Changing this creates a new keypair. */ readonly name: pulumi.Output<string>; /** * Specifies the imported OpenSSH-formatted public key. Changing this creates * a new keypair. * This parameter and `keyFile` are alternative. */ readonly publicKey: pulumi.Output<string>; /** * Specifies the region in which to create the keypair resource. If omitted, the * provider-level region will be used. Changing this creates a new keypair. */ readonly region: pulumi.Output<string>; /** * Create a Keypair resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: KeypairArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Keypair resources. */ export interface KeypairState { /** * Specifies the path of the created private key. * The private key file (**.pem**) is created only after the resource is created. * By default, the private key file will be created in the same folder as the current script file. * If you need to create it in another folder, please specify the path for `keyFile`. * Changing this creates a new keypair. */ keyFile?: pulumi.Input<string>; /** * Specifies a unique name for the keypair. Changing this creates a new keypair. */ name?: pulumi.Input<string>; /** * Specifies the imported OpenSSH-formatted public key. Changing this creates * a new keypair. * This parameter and `keyFile` are alternative. */ publicKey?: pulumi.Input<string>; /** * Specifies the region in which to create the keypair resource. If omitted, the * provider-level region will be used. Changing this creates a new keypair. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a Keypair resource. */ export interface KeypairArgs { /** * Specifies the path of the created private key. * The private key file (**.pem**) is created only after the resource is created. * By default, the private key file will be created in the same folder as the current script file. * If you need to create it in another folder, please specify the path for `keyFile`. * Changing this creates a new keypair. */ keyFile?: pulumi.Input<string>; /** * Specifies a unique name for the keypair. Changing this creates a new keypair. */ name?: pulumi.Input<string>; /** * Specifies the imported OpenSSH-formatted public key. Changing this creates * a new keypair. * This parameter and `keyFile` are alternative. */ publicKey?: pulumi.Input<string>; /** * Specifies the region in which to create the keypair resource. If omitted, the * provider-level region will be used. Changing this creates a new keypair. */ region?: pulumi.Input<string>; }