/
gateway.ts
281 lines (272 loc) · 14.3 KB
/
gateway.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
// *** 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";
/**
* Manages an AWS Storage Gateway file, tape, or volume gateway in the provider region.
*
* > NOTE: The Storage Gateway API requires the gateway to be connected to properly return information after activation. If you are receiving `The specified gateway is not connected` errors during resource creation (gateway activation), ensure your gateway instance meets the [Storage Gateway requirements](https://docs.aws.amazon.com/storagegateway/latest/userguide/Requirements.html).
*
* ## Example Usage
*
* ### File Gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "FILE_S3",
* });
* ```
*
* ### Tape Gateway
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "VTL",
* mediaChangerType: "AWS-Gateway-VTL",
* tapeDriveType: "IBM-ULT3580-TD5",
* });
* ```
*
* ### Volume Gateway (Cached)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "CACHED",
* });
* ```
*
* ### Volume Gateway (Stored)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.storagegateway.Gateway("example", {
* gatewayIpAddress: "1.2.3.4",
* gatewayName: "example",
* gatewayTimezone: "GMT",
* gatewayType: "STORED",
* });
* ```
*
* > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/storagegateway_gateway.html.markdown.
*/
export class Gateway extends pulumi.CustomResource {
/**
* Get an existing Gateway 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?: GatewayState, opts?: pulumi.CustomResourceOptions): Gateway {
return new Gateway(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'aws:storagegateway/gateway:Gateway';
/**
* Returns true if the given object is an instance of Gateway. 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 Gateway {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Gateway.__pulumiType;
}
/**
* Gateway activation key during resource creation. Conflicts with `gatewayIpAddress`. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
public readonly activationKey!: pulumi.Output<string>;
/**
* Amazon Resource Name (ARN) of the gateway.
*/
public /*out*/ readonly arn!: pulumi.Output<string>;
/**
* Identifier of the gateway.
*/
public /*out*/ readonly gatewayId!: pulumi.Output<string>;
/**
* Gateway IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. Gateway must be accessible on port 80 from where this provider is running. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
public readonly gatewayIpAddress!: pulumi.Output<string>;
/**
* Name of the gateway.
*/
public readonly gatewayName!: pulumi.Output<string>;
/**
* Time zone for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, `GMT-4:00` indicates the time is 4 hours behind GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.
*/
public readonly gatewayTimezone!: pulumi.Output<string>;
/**
* Type of the gateway. The default value is `STORED`. Valid values: `CACHED`, `FILE_S3`, `STORED`, `VTL`.
*/
public readonly gatewayType!: pulumi.Output<string | undefined>;
public readonly mediumChangerType!: pulumi.Output<string | undefined>;
/**
* Nested argument with Active Directory domain join information for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `ActiveDirectory` authentication SMB file shares. More details below.
*/
public readonly smbActiveDirectorySettings!: pulumi.Output<{ domainName: string, password: string, username: string } | undefined>;
/**
* Guest password for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `GuestAccess` authentication SMB file shares. This provider can only detect drift of the existence of a guest password, not its actual value from the gateway. This provider can however update the password with changing the argument.
*/
public readonly smbGuestPassword!: pulumi.Output<string | undefined>;
/**
* Type of tape drive to use for tape gateway. This provider cannot detect drift of this argument. Valid values: `IBM-ULT3580-TD5`.
*/
public readonly tapeDriveType!: pulumi.Output<string | undefined>;
/**
* Create a Gateway 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: GatewayArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: GatewayArgs | GatewayState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as GatewayState | undefined;
inputs["activationKey"] = state ? state.activationKey : undefined;
inputs["arn"] = state ? state.arn : undefined;
inputs["gatewayId"] = state ? state.gatewayId : undefined;
inputs["gatewayIpAddress"] = state ? state.gatewayIpAddress : undefined;
inputs["gatewayName"] = state ? state.gatewayName : undefined;
inputs["gatewayTimezone"] = state ? state.gatewayTimezone : undefined;
inputs["gatewayType"] = state ? state.gatewayType : undefined;
inputs["mediumChangerType"] = state ? state.mediumChangerType : undefined;
inputs["smbActiveDirectorySettings"] = state ? state.smbActiveDirectorySettings : undefined;
inputs["smbGuestPassword"] = state ? state.smbGuestPassword : undefined;
inputs["tapeDriveType"] = state ? state.tapeDriveType : undefined;
} else {
const args = argsOrState as GatewayArgs | undefined;
if (!args || args.gatewayName === undefined) {
throw new Error("Missing required property 'gatewayName'");
}
if (!args || args.gatewayTimezone === undefined) {
throw new Error("Missing required property 'gatewayTimezone'");
}
inputs["activationKey"] = args ? args.activationKey : undefined;
inputs["gatewayIpAddress"] = args ? args.gatewayIpAddress : undefined;
inputs["gatewayName"] = args ? args.gatewayName : undefined;
inputs["gatewayTimezone"] = args ? args.gatewayTimezone : undefined;
inputs["gatewayType"] = args ? args.gatewayType : undefined;
inputs["mediumChangerType"] = args ? args.mediumChangerType : undefined;
inputs["smbActiveDirectorySettings"] = args ? args.smbActiveDirectorySettings : undefined;
inputs["smbGuestPassword"] = args ? args.smbGuestPassword : undefined;
inputs["tapeDriveType"] = args ? args.tapeDriveType : undefined;
inputs["arn"] = undefined /*out*/;
inputs["gatewayId"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(Gateway.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering Gateway resources.
*/
export interface GatewayState {
/**
* Gateway activation key during resource creation. Conflicts with `gatewayIpAddress`. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
readonly activationKey?: pulumi.Input<string>;
/**
* Amazon Resource Name (ARN) of the gateway.
*/
readonly arn?: pulumi.Input<string>;
/**
* Identifier of the gateway.
*/
readonly gatewayId?: pulumi.Input<string>;
/**
* Gateway IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. Gateway must be accessible on port 80 from where this provider is running. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
readonly gatewayIpAddress?: pulumi.Input<string>;
/**
* Name of the gateway.
*/
readonly gatewayName?: pulumi.Input<string>;
/**
* Time zone for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, `GMT-4:00` indicates the time is 4 hours behind GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.
*/
readonly gatewayTimezone?: pulumi.Input<string>;
/**
* Type of the gateway. The default value is `STORED`. Valid values: `CACHED`, `FILE_S3`, `STORED`, `VTL`.
*/
readonly gatewayType?: pulumi.Input<string>;
readonly mediumChangerType?: pulumi.Input<string>;
/**
* Nested argument with Active Directory domain join information for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `ActiveDirectory` authentication SMB file shares. More details below.
*/
readonly smbActiveDirectorySettings?: pulumi.Input<{ domainName: pulumi.Input<string>, password: pulumi.Input<string>, username: pulumi.Input<string> }>;
/**
* Guest password for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `GuestAccess` authentication SMB file shares. This provider can only detect drift of the existence of a guest password, not its actual value from the gateway. This provider can however update the password with changing the argument.
*/
readonly smbGuestPassword?: pulumi.Input<string>;
/**
* Type of tape drive to use for tape gateway. This provider cannot detect drift of this argument. Valid values: `IBM-ULT3580-TD5`.
*/
readonly tapeDriveType?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Gateway resource.
*/
export interface GatewayArgs {
/**
* Gateway activation key during resource creation. Conflicts with `gatewayIpAddress`. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
readonly activationKey?: pulumi.Input<string>;
/**
* Gateway IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. Gateway must be accessible on port 80 from where this provider is running. Additional information is available in the [Storage Gateway User Guide](https://docs.aws.amazon.com/storagegateway/latest/userguide/get-activation-key.html).
*/
readonly gatewayIpAddress?: pulumi.Input<string>;
/**
* Name of the gateway.
*/
readonly gatewayName: pulumi.Input<string>;
/**
* Time zone for the gateway. The time zone is of the format "GMT", "GMT-hr:mm", or "GMT+hr:mm". For example, `GMT-4:00` indicates the time is 4 hours behind GMT. The time zone is used, for example, for scheduling snapshots and your gateway's maintenance schedule.
*/
readonly gatewayTimezone: pulumi.Input<string>;
/**
* Type of the gateway. The default value is `STORED`. Valid values: `CACHED`, `FILE_S3`, `STORED`, `VTL`.
*/
readonly gatewayType?: pulumi.Input<string>;
readonly mediumChangerType?: pulumi.Input<string>;
/**
* Nested argument with Active Directory domain join information for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `ActiveDirectory` authentication SMB file shares. More details below.
*/
readonly smbActiveDirectorySettings?: pulumi.Input<{ domainName: pulumi.Input<string>, password: pulumi.Input<string>, username: pulumi.Input<string> }>;
/**
* Guest password for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `GuestAccess` authentication SMB file shares. This provider can only detect drift of the existence of a guest password, not its actual value from the gateway. This provider can however update the password with changing the argument.
*/
readonly smbGuestPassword?: pulumi.Input<string>;
/**
* Type of tape drive to use for tape gateway. This provider cannot detect drift of this argument. Valid values: `IBM-ULT3580-TD5`.
*/
readonly tapeDriveType?: pulumi.Input<string>;
}