-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssh-key.ts
67 lines (56 loc) · 2.02 KB
/
ssh-key.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
import { CustomResource, CustomResourceOptions, ID, Input, Inputs, Output } from '@pulumi/pulumi';
import { AsInputs, AsOutputs } from '@pulumi-utils/sdk';
export interface SshKeyState {
content: string;
title?: string;
}
export type SshKeyArgs = AsInputs<SshKeyState>;
export interface SshKeyProps {
url: string;
html_url: string;
ssh_key_id: number;
content: string;
title: string | null;
}
export class SshKey extends CustomResource implements AsOutputs<SshKeyProps> {
static __pulumiType = 'buddy:ssh-key:SshKey';
static get(name: string, id: Input<ID>, state?: Partial<SshKeyState>, opts?: CustomResourceOptions) {
return new SshKey(name, state as any, { ...opts, id });
}
static isInstance(obj: any): obj is SshKey {
if (null == obj) {
return false;
}
return obj['__pulumiType'] === SshKey.__pulumiType;
}
readonly url!: Output<string>;
readonly html_url!: Output<string>;
readonly ssh_key_id!: Output<number>;
readonly content!: Output<string>;
readonly title!: Output<string | null>;
constructor(name: string, argsOrState: SshKeyArgs | SshKeyState, opts?: CustomResourceOptions) {
const inputs: Inputs = {};
if (!opts) {
opts = {};
}
if (opts.id) {
const state = argsOrState as SshKeyState | undefined;
inputs['content'] = state?.content;
inputs['title'] = state?.title;
} else {
const args = argsOrState as SshKeyArgs | undefined;
if (!args || !args.content) {
throw new Error('Missing required property "content"');
}
inputs['content'] = args?.content;
inputs['title'] = args?.title;
}
if (!opts.version) {
opts.version = require('./package').version;
}
inputs['url'] = undefined;
inputs['html_url'] = undefined;
inputs['ssh_key_id'] = undefined;
super(SshKey.__pulumiType, name, inputs, opts);
}
}