/
index.ts
629 lines (589 loc) · 21.9 KB
/
index.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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
// https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api
// generated from terraform resource schema
import { Construct } from 'constructs';
import * as cdktf from 'cdktf';
// Configuration
export interface Apigatewayv2ApiConfig extends cdktf.TerraformMetaArguments {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#api_key_selection_expression Apigatewayv2Api#api_key_selection_expression}
*/
readonly apiKeySelectionExpression?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#body Apigatewayv2Api#body}
*/
readonly body?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#credentials_arn Apigatewayv2Api#credentials_arn}
*/
readonly credentialsArn?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#description Apigatewayv2Api#description}
*/
readonly description?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#disable_execute_api_endpoint Apigatewayv2Api#disable_execute_api_endpoint}
*/
readonly disableExecuteApiEndpoint?: boolean | cdktf.IResolvable;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#fail_on_warnings Apigatewayv2Api#fail_on_warnings}
*/
readonly failOnWarnings?: boolean | cdktf.IResolvable;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#id Apigatewayv2Api#id}
*
* Please be aware that the id field is automatically added to all resources in Terraform providers using a Terraform provider SDK version below 2.
* If you experience problems setting this value it might not be settable. Please take a look at the provider documentation to ensure it should be settable.
*/
readonly id?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#name Apigatewayv2Api#name}
*/
readonly name: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#protocol_type Apigatewayv2Api#protocol_type}
*/
readonly protocolType: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#route_key Apigatewayv2Api#route_key}
*/
readonly routeKey?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#route_selection_expression Apigatewayv2Api#route_selection_expression}
*/
readonly routeSelectionExpression?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#tags Apigatewayv2Api#tags}
*/
readonly tags?: { [key: string]: string };
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#tags_all Apigatewayv2Api#tags_all}
*/
readonly tagsAll?: { [key: string]: string };
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#target Apigatewayv2Api#target}
*/
readonly target?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#version Apigatewayv2Api#version}
*/
readonly version?: string;
/**
* cors_configuration block
*
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#cors_configuration Apigatewayv2Api#cors_configuration}
*/
readonly corsConfiguration?: Apigatewayv2ApiCorsConfiguration;
}
export interface Apigatewayv2ApiCorsConfiguration {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#allow_credentials Apigatewayv2Api#allow_credentials}
*/
readonly allowCredentials?: boolean | cdktf.IResolvable;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#allow_headers Apigatewayv2Api#allow_headers}
*/
readonly allowHeaders?: string[];
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#allow_methods Apigatewayv2Api#allow_methods}
*/
readonly allowMethods?: string[];
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#allow_origins Apigatewayv2Api#allow_origins}
*/
readonly allowOrigins?: string[];
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#expose_headers Apigatewayv2Api#expose_headers}
*/
readonly exposeHeaders?: string[];
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api#max_age Apigatewayv2Api#max_age}
*/
readonly maxAge?: number;
}
export function apigatewayv2ApiCorsConfigurationToTerraform(struct?: Apigatewayv2ApiCorsConfigurationOutputReference | Apigatewayv2ApiCorsConfiguration): any {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; }
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
allow_credentials: cdktf.booleanToTerraform(struct!.allowCredentials),
allow_headers: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowHeaders),
allow_methods: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowMethods),
allow_origins: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.allowOrigins),
expose_headers: cdktf.listMapper(cdktf.stringToTerraform, false)(struct!.exposeHeaders),
max_age: cdktf.numberToTerraform(struct!.maxAge),
}
}
export class Apigatewayv2ApiCorsConfigurationOutputReference extends cdktf.ComplexObject {
private isEmptyObject = false;
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
public constructor(terraformResource: cdktf.IInterpolatingParent, terraformAttribute: string) {
super(terraformResource, terraformAttribute, false, 0);
}
public get internalValue(): Apigatewayv2ApiCorsConfiguration | undefined {
let hasAnyValues = this.isEmptyObject;
const internalValueResult: any = {};
if (this._allowCredentials !== undefined) {
hasAnyValues = true;
internalValueResult.allowCredentials = this._allowCredentials;
}
if (this._allowHeaders !== undefined) {
hasAnyValues = true;
internalValueResult.allowHeaders = this._allowHeaders;
}
if (this._allowMethods !== undefined) {
hasAnyValues = true;
internalValueResult.allowMethods = this._allowMethods;
}
if (this._allowOrigins !== undefined) {
hasAnyValues = true;
internalValueResult.allowOrigins = this._allowOrigins;
}
if (this._exposeHeaders !== undefined) {
hasAnyValues = true;
internalValueResult.exposeHeaders = this._exposeHeaders;
}
if (this._maxAge !== undefined) {
hasAnyValues = true;
internalValueResult.maxAge = this._maxAge;
}
return hasAnyValues ? internalValueResult : undefined;
}
public set internalValue(value: Apigatewayv2ApiCorsConfiguration | undefined) {
if (value === undefined) {
this.isEmptyObject = false;
this._allowCredentials = undefined;
this._allowHeaders = undefined;
this._allowMethods = undefined;
this._allowOrigins = undefined;
this._exposeHeaders = undefined;
this._maxAge = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._allowCredentials = value.allowCredentials;
this._allowHeaders = value.allowHeaders;
this._allowMethods = value.allowMethods;
this._allowOrigins = value.allowOrigins;
this._exposeHeaders = value.exposeHeaders;
this._maxAge = value.maxAge;
}
}
// allow_credentials - computed: false, optional: true, required: false
private _allowCredentials?: boolean | cdktf.IResolvable;
public get allowCredentials() {
return this.getBooleanAttribute('allow_credentials');
}
public set allowCredentials(value: boolean | cdktf.IResolvable) {
this._allowCredentials = value;
}
public resetAllowCredentials() {
this._allowCredentials = undefined;
}
// Temporarily expose input value. Use with caution.
public get allowCredentialsInput() {
return this._allowCredentials;
}
// allow_headers - computed: false, optional: true, required: false
private _allowHeaders?: string[];
public get allowHeaders() {
return cdktf.Fn.tolist(this.getListAttribute('allow_headers'));
}
public set allowHeaders(value: string[]) {
this._allowHeaders = value;
}
public resetAllowHeaders() {
this._allowHeaders = undefined;
}
// Temporarily expose input value. Use with caution.
public get allowHeadersInput() {
return this._allowHeaders;
}
// allow_methods - computed: false, optional: true, required: false
private _allowMethods?: string[];
public get allowMethods() {
return cdktf.Fn.tolist(this.getListAttribute('allow_methods'));
}
public set allowMethods(value: string[]) {
this._allowMethods = value;
}
public resetAllowMethods() {
this._allowMethods = undefined;
}
// Temporarily expose input value. Use with caution.
public get allowMethodsInput() {
return this._allowMethods;
}
// allow_origins - computed: false, optional: true, required: false
private _allowOrigins?: string[];
public get allowOrigins() {
return cdktf.Fn.tolist(this.getListAttribute('allow_origins'));
}
public set allowOrigins(value: string[]) {
this._allowOrigins = value;
}
public resetAllowOrigins() {
this._allowOrigins = undefined;
}
// Temporarily expose input value. Use with caution.
public get allowOriginsInput() {
return this._allowOrigins;
}
// expose_headers - computed: false, optional: true, required: false
private _exposeHeaders?: string[];
public get exposeHeaders() {
return cdktf.Fn.tolist(this.getListAttribute('expose_headers'));
}
public set exposeHeaders(value: string[]) {
this._exposeHeaders = value;
}
public resetExposeHeaders() {
this._exposeHeaders = undefined;
}
// Temporarily expose input value. Use with caution.
public get exposeHeadersInput() {
return this._exposeHeaders;
}
// max_age - computed: false, optional: true, required: false
private _maxAge?: number;
public get maxAge() {
return this.getNumberAttribute('max_age');
}
public set maxAge(value: number) {
this._maxAge = value;
}
public resetMaxAge() {
this._maxAge = undefined;
}
// Temporarily expose input value. Use with caution.
public get maxAgeInput() {
return this._maxAge;
}
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api aws_apigatewayv2_api}
*/
export class Apigatewayv2Api extends cdktf.TerraformResource {
// =================
// STATIC PROPERTIES
// =================
public static readonly tfResourceType = "aws_apigatewayv2_api";
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://www.terraform.io/docs/providers/aws/r/apigatewayv2_api aws_apigatewayv2_api} Resource
*
* @param scope The scope in which to define this construct
* @param id The scoped construct ID. Must be unique amongst siblings in the same scope
* @param options Apigatewayv2ApiConfig
*/
public constructor(scope: Construct, id: string, config: Apigatewayv2ApiConfig) {
super(scope, id, {
terraformResourceType: 'aws_apigatewayv2_api',
terraformGeneratorMetadata: {
providerName: 'aws',
providerVersion: '4.39.0',
providerVersionConstraint: '~> 4.0'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
this._apiKeySelectionExpression = config.apiKeySelectionExpression;
this._body = config.body;
this._credentialsArn = config.credentialsArn;
this._description = config.description;
this._disableExecuteApiEndpoint = config.disableExecuteApiEndpoint;
this._failOnWarnings = config.failOnWarnings;
this._id = config.id;
this._name = config.name;
this._protocolType = config.protocolType;
this._routeKey = config.routeKey;
this._routeSelectionExpression = config.routeSelectionExpression;
this._tags = config.tags;
this._tagsAll = config.tagsAll;
this._target = config.target;
this._version = config.version;
this._corsConfiguration.internalValue = config.corsConfiguration;
}
// ==========
// ATTRIBUTES
// ==========
// api_endpoint - computed: true, optional: false, required: false
public get apiEndpoint() {
return this.getStringAttribute('api_endpoint');
}
// api_key_selection_expression - computed: false, optional: true, required: false
private _apiKeySelectionExpression?: string;
public get apiKeySelectionExpression() {
return this.getStringAttribute('api_key_selection_expression');
}
public set apiKeySelectionExpression(value: string) {
this._apiKeySelectionExpression = value;
}
public resetApiKeySelectionExpression() {
this._apiKeySelectionExpression = undefined;
}
// Temporarily expose input value. Use with caution.
public get apiKeySelectionExpressionInput() {
return this._apiKeySelectionExpression;
}
// arn - computed: true, optional: false, required: false
public get arn() {
return this.getStringAttribute('arn');
}
// body - computed: false, optional: true, required: false
private _body?: string;
public get body() {
return this.getStringAttribute('body');
}
public set body(value: string) {
this._body = value;
}
public resetBody() {
this._body = undefined;
}
// Temporarily expose input value. Use with caution.
public get bodyInput() {
return this._body;
}
// credentials_arn - computed: false, optional: true, required: false
private _credentialsArn?: string;
public get credentialsArn() {
return this.getStringAttribute('credentials_arn');
}
public set credentialsArn(value: string) {
this._credentialsArn = value;
}
public resetCredentialsArn() {
this._credentialsArn = undefined;
}
// Temporarily expose input value. Use with caution.
public get credentialsArnInput() {
return this._credentialsArn;
}
// description - computed: false, optional: true, required: false
private _description?: string;
public get description() {
return this.getStringAttribute('description');
}
public set description(value: string) {
this._description = value;
}
public resetDescription() {
this._description = undefined;
}
// Temporarily expose input value. Use with caution.
public get descriptionInput() {
return this._description;
}
// disable_execute_api_endpoint - computed: false, optional: true, required: false
private _disableExecuteApiEndpoint?: boolean | cdktf.IResolvable;
public get disableExecuteApiEndpoint() {
return this.getBooleanAttribute('disable_execute_api_endpoint');
}
public set disableExecuteApiEndpoint(value: boolean | cdktf.IResolvable) {
this._disableExecuteApiEndpoint = value;
}
public resetDisableExecuteApiEndpoint() {
this._disableExecuteApiEndpoint = undefined;
}
// Temporarily expose input value. Use with caution.
public get disableExecuteApiEndpointInput() {
return this._disableExecuteApiEndpoint;
}
// execution_arn - computed: true, optional: false, required: false
public get executionArn() {
return this.getStringAttribute('execution_arn');
}
// fail_on_warnings - computed: false, optional: true, required: false
private _failOnWarnings?: boolean | cdktf.IResolvable;
public get failOnWarnings() {
return this.getBooleanAttribute('fail_on_warnings');
}
public set failOnWarnings(value: boolean | cdktf.IResolvable) {
this._failOnWarnings = value;
}
public resetFailOnWarnings() {
this._failOnWarnings = undefined;
}
// Temporarily expose input value. Use with caution.
public get failOnWarningsInput() {
return this._failOnWarnings;
}
// id - computed: true, optional: true, required: false
private _id?: string;
public get id() {
return this.getStringAttribute('id');
}
public set id(value: string) {
this._id = value;
}
public resetId() {
this._id = undefined;
}
// Temporarily expose input value. Use with caution.
public get idInput() {
return this._id;
}
// name - computed: false, optional: false, required: true
private _name?: string;
public get name() {
return this.getStringAttribute('name');
}
public set name(value: string) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
public get nameInput() {
return this._name;
}
// protocol_type - computed: false, optional: false, required: true
private _protocolType?: string;
public get protocolType() {
return this.getStringAttribute('protocol_type');
}
public set protocolType(value: string) {
this._protocolType = value;
}
// Temporarily expose input value. Use with caution.
public get protocolTypeInput() {
return this._protocolType;
}
// route_key - computed: false, optional: true, required: false
private _routeKey?: string;
public get routeKey() {
return this.getStringAttribute('route_key');
}
public set routeKey(value: string) {
this._routeKey = value;
}
public resetRouteKey() {
this._routeKey = undefined;
}
// Temporarily expose input value. Use with caution.
public get routeKeyInput() {
return this._routeKey;
}
// route_selection_expression - computed: false, optional: true, required: false
private _routeSelectionExpression?: string;
public get routeSelectionExpression() {
return this.getStringAttribute('route_selection_expression');
}
public set routeSelectionExpression(value: string) {
this._routeSelectionExpression = value;
}
public resetRouteSelectionExpression() {
this._routeSelectionExpression = undefined;
}
// Temporarily expose input value. Use with caution.
public get routeSelectionExpressionInput() {
return this._routeSelectionExpression;
}
// tags - computed: false, optional: true, required: false
private _tags?: { [key: string]: string };
public get tags() {
return this.getStringMapAttribute('tags');
}
public set tags(value: { [key: string]: string }) {
this._tags = value;
}
public resetTags() {
this._tags = undefined;
}
// Temporarily expose input value. Use with caution.
public get tagsInput() {
return this._tags;
}
// tags_all - computed: true, optional: true, required: false
private _tagsAll?: { [key: string]: string };
public get tagsAll() {
return this.getStringMapAttribute('tags_all');
}
public set tagsAll(value: { [key: string]: string }) {
this._tagsAll = value;
}
public resetTagsAll() {
this._tagsAll = undefined;
}
// Temporarily expose input value. Use with caution.
public get tagsAllInput() {
return this._tagsAll;
}
// target - computed: false, optional: true, required: false
private _target?: string;
public get target() {
return this.getStringAttribute('target');
}
public set target(value: string) {
this._target = value;
}
public resetTarget() {
this._target = undefined;
}
// Temporarily expose input value. Use with caution.
public get targetInput() {
return this._target;
}
// version - computed: false, optional: true, required: false
private _version?: string;
public get version() {
return this.getStringAttribute('version');
}
public set version(value: string) {
this._version = value;
}
public resetVersion() {
this._version = undefined;
}
// Temporarily expose input value. Use with caution.
public get versionInput() {
return this._version;
}
// cors_configuration - computed: false, optional: true, required: false
private _corsConfiguration = new Apigatewayv2ApiCorsConfigurationOutputReference(this, "cors_configuration");
public get corsConfiguration() {
return this._corsConfiguration;
}
public putCorsConfiguration(value: Apigatewayv2ApiCorsConfiguration) {
this._corsConfiguration.internalValue = value;
}
public resetCorsConfiguration() {
this._corsConfiguration.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
public get corsConfigurationInput() {
return this._corsConfiguration.internalValue;
}
// =========
// SYNTHESIS
// =========
protected synthesizeAttributes(): { [name: string]: any } {
return {
api_key_selection_expression: cdktf.stringToTerraform(this._apiKeySelectionExpression),
body: cdktf.stringToTerraform(this._body),
credentials_arn: cdktf.stringToTerraform(this._credentialsArn),
description: cdktf.stringToTerraform(this._description),
disable_execute_api_endpoint: cdktf.booleanToTerraform(this._disableExecuteApiEndpoint),
fail_on_warnings: cdktf.booleanToTerraform(this._failOnWarnings),
id: cdktf.stringToTerraform(this._id),
name: cdktf.stringToTerraform(this._name),
protocol_type: cdktf.stringToTerraform(this._protocolType),
route_key: cdktf.stringToTerraform(this._routeKey),
route_selection_expression: cdktf.stringToTerraform(this._routeSelectionExpression),
tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
target: cdktf.stringToTerraform(this._target),
version: cdktf.stringToTerraform(this._version),
cors_configuration: apigatewayv2ApiCorsConfigurationToTerraform(this._corsConfiguration.internalValue),
};
}
}