/
keypair.ts
174 lines (165 loc) · 6.78 KB
/
keypair.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";
/**
* > This content is derived from https://github.com/terraform-providers/terraform-provider-openstack/blob/master/website/docs/r/compute_keypair_v2.html.markdown.
*/
export 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.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: KeypairState, opts?: pulumi.CustomResourceOptions): Keypair {
return new Keypair(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'openstack:compute/keypair: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.
*/
public static isInstance(obj: any): obj is Keypair {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Keypair.__pulumiType;
}
/**
* The fingerprint of the public key.
*/
public /*out*/ readonly fingerprint!: pulumi.Output<string>;
/**
* A unique name for the keypair. Changing this creates a new
* keypair.
*/
public readonly name!: pulumi.Output<string>;
/**
* The generated private key when no public key is specified.
*/
public /*out*/ readonly privateKey!: pulumi.Output<string>;
/**
* A pregenerated OpenSSH-formatted public key.
* Changing this creates a new keypair. If a public key is not specified, then
* a public/private key pair will be automatically generated. If a pair is
* created, then destroying this resource means you will lose access to that
* keypair forever.
*/
public readonly publicKey!: pulumi.Output<string>;
/**
* The region in which to obtain the V2 Compute client.
* Keypairs are associated with accounts, but a Compute client is needed to
* create one. If omitted, the `region` argument of the provider is used.
* Changing this creates a new keypair.
*/
public readonly region!: pulumi.Output<string>;
/**
* Map of additional options.
*/
public readonly valueSpecs!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* 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)
constructor(name: string, argsOrState?: KeypairArgs | KeypairState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as KeypairState | undefined;
inputs["fingerprint"] = state ? state.fingerprint : undefined;
inputs["name"] = state ? state.name : undefined;
inputs["privateKey"] = state ? state.privateKey : undefined;
inputs["publicKey"] = state ? state.publicKey : undefined;
inputs["region"] = state ? state.region : undefined;
inputs["valueSpecs"] = state ? state.valueSpecs : undefined;
} else {
const args = argsOrState as KeypairArgs | undefined;
inputs["name"] = args ? args.name : undefined;
inputs["publicKey"] = args ? args.publicKey : undefined;
inputs["region"] = args ? args.region : undefined;
inputs["valueSpecs"] = args ? args.valueSpecs : undefined;
inputs["fingerprint"] = undefined /*out*/;
inputs["privateKey"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(Keypair.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering Keypair resources.
*/
export interface KeypairState {
/**
* The fingerprint of the public key.
*/
readonly fingerprint?: pulumi.Input<string>;
/**
* A unique name for the keypair. Changing this creates a new
* keypair.
*/
readonly name?: pulumi.Input<string>;
/**
* The generated private key when no public key is specified.
*/
readonly privateKey?: pulumi.Input<string>;
/**
* A pregenerated OpenSSH-formatted public key.
* Changing this creates a new keypair. If a public key is not specified, then
* a public/private key pair will be automatically generated. If a pair is
* created, then destroying this resource means you will lose access to that
* keypair forever.
*/
readonly publicKey?: pulumi.Input<string>;
/**
* The region in which to obtain the V2 Compute client.
* Keypairs are associated with accounts, but a Compute client is needed to
* create one. If omitted, the `region` argument of the provider is used.
* Changing this creates a new keypair.
*/
readonly region?: pulumi.Input<string>;
/**
* Map of additional options.
*/
readonly valueSpecs?: pulumi.Input<{[key: string]: any}>;
}
/**
* The set of arguments for constructing a Keypair resource.
*/
export interface KeypairArgs {
/**
* A unique name for the keypair. Changing this creates a new
* keypair.
*/
readonly name?: pulumi.Input<string>;
/**
* A pregenerated OpenSSH-formatted public key.
* Changing this creates a new keypair. If a public key is not specified, then
* a public/private key pair will be automatically generated. If a pair is
* created, then destroying this resource means you will lose access to that
* keypair forever.
*/
readonly publicKey?: pulumi.Input<string>;
/**
* The region in which to obtain the V2 Compute client.
* Keypairs are associated with accounts, but a Compute client is needed to
* create one. If omitted, the `region` argument of the provider is used.
* Changing this creates a new keypair.
*/
readonly region?: pulumi.Input<string>;
/**
* Map of additional options.
*/
readonly valueSpecs?: pulumi.Input<{[key: string]: any}>;
}