/
index.ts
340 lines (305 loc) · 11.4 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
// https://www.terraform.io/docs/providers/aws/r/cloudformation_type
// generated from terraform resource schema
import { Construct } from 'constructs';
import * as cdktf from 'cdktf';
// Configuration
export interface CloudformationTypeConfig extends cdktf.TerraformMetaArguments {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#execution_role_arn CloudformationType#execution_role_arn}
*/
readonly executionRoleArn?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#id CloudformationType#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/cloudformation_type#schema_handler_package CloudformationType#schema_handler_package}
*/
readonly schemaHandlerPackage: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#type CloudformationType#type}
*/
readonly type?: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#type_name CloudformationType#type_name}
*/
readonly typeName: string;
/**
* logging_config block
*
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#logging_config CloudformationType#logging_config}
*/
readonly loggingConfig?: CloudformationTypeLoggingConfig;
}
export interface CloudformationTypeLoggingConfig {
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#log_group_name CloudformationType#log_group_name}
*/
readonly logGroupName: string;
/**
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type#log_role_arn CloudformationType#log_role_arn}
*/
readonly logRoleArn: string;
}
export function cloudformationTypeLoggingConfigToTerraform(struct?: CloudformationTypeLoggingConfigOutputReference | CloudformationTypeLoggingConfig): 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 {
log_group_name: cdktf.stringToTerraform(struct!.logGroupName),
log_role_arn: cdktf.stringToTerraform(struct!.logRoleArn),
}
}
export class CloudformationTypeLoggingConfigOutputReference 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(): CloudformationTypeLoggingConfig | undefined {
let hasAnyValues = this.isEmptyObject;
const internalValueResult: any = {};
if (this._logGroupName !== undefined) {
hasAnyValues = true;
internalValueResult.logGroupName = this._logGroupName;
}
if (this._logRoleArn !== undefined) {
hasAnyValues = true;
internalValueResult.logRoleArn = this._logRoleArn;
}
return hasAnyValues ? internalValueResult : undefined;
}
public set internalValue(value: CloudformationTypeLoggingConfig | undefined) {
if (value === undefined) {
this.isEmptyObject = false;
this._logGroupName = undefined;
this._logRoleArn = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._logGroupName = value.logGroupName;
this._logRoleArn = value.logRoleArn;
}
}
// log_group_name - computed: false, optional: false, required: true
private _logGroupName?: string;
public get logGroupName() {
return this.getStringAttribute('log_group_name');
}
public set logGroupName(value: string) {
this._logGroupName = value;
}
// Temporarily expose input value. Use with caution.
public get logGroupNameInput() {
return this._logGroupName;
}
// log_role_arn - computed: false, optional: false, required: true
private _logRoleArn?: string;
public get logRoleArn() {
return this.getStringAttribute('log_role_arn');
}
public set logRoleArn(value: string) {
this._logRoleArn = value;
}
// Temporarily expose input value. Use with caution.
public get logRoleArnInput() {
return this._logRoleArn;
}
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type aws_cloudformation_type}
*/
export class CloudformationType extends cdktf.TerraformResource {
// =================
// STATIC PROPERTIES
// =================
public static readonly tfResourceType = "aws_cloudformation_type";
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://www.terraform.io/docs/providers/aws/r/cloudformation_type aws_cloudformation_type} 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 CloudformationTypeConfig
*/
public constructor(scope: Construct, id: string, config: CloudformationTypeConfig) {
super(scope, id, {
terraformResourceType: 'aws_cloudformation_type',
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._executionRoleArn = config.executionRoleArn;
this._id = config.id;
this._schemaHandlerPackage = config.schemaHandlerPackage;
this._type = config.type;
this._typeName = config.typeName;
this._loggingConfig.internalValue = config.loggingConfig;
}
// ==========
// ATTRIBUTES
// ==========
// arn - computed: true, optional: false, required: false
public get arn() {
return this.getStringAttribute('arn');
}
// default_version_id - computed: true, optional: false, required: false
public get defaultVersionId() {
return this.getStringAttribute('default_version_id');
}
// deprecated_status - computed: true, optional: false, required: false
public get deprecatedStatus() {
return this.getStringAttribute('deprecated_status');
}
// description - computed: true, optional: false, required: false
public get description() {
return this.getStringAttribute('description');
}
// documentation_url - computed: true, optional: false, required: false
public get documentationUrl() {
return this.getStringAttribute('documentation_url');
}
// execution_role_arn - computed: false, optional: true, required: false
private _executionRoleArn?: string;
public get executionRoleArn() {
return this.getStringAttribute('execution_role_arn');
}
public set executionRoleArn(value: string) {
this._executionRoleArn = value;
}
public resetExecutionRoleArn() {
this._executionRoleArn = undefined;
}
// Temporarily expose input value. Use with caution.
public get executionRoleArnInput() {
return this._executionRoleArn;
}
// 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;
}
// is_default_version - computed: true, optional: false, required: false
public get isDefaultVersion() {
return this.getBooleanAttribute('is_default_version');
}
// provisioning_type - computed: true, optional: false, required: false
public get provisioningType() {
return this.getStringAttribute('provisioning_type');
}
// schema - computed: true, optional: false, required: false
public get schema() {
return this.getStringAttribute('schema');
}
// schema_handler_package - computed: false, optional: false, required: true
private _schemaHandlerPackage?: string;
public get schemaHandlerPackage() {
return this.getStringAttribute('schema_handler_package');
}
public set schemaHandlerPackage(value: string) {
this._schemaHandlerPackage = value;
}
// Temporarily expose input value. Use with caution.
public get schemaHandlerPackageInput() {
return this._schemaHandlerPackage;
}
// source_url - computed: true, optional: false, required: false
public get sourceUrl() {
return this.getStringAttribute('source_url');
}
// type - computed: true, optional: true, required: false
private _type?: string;
public get type() {
return this.getStringAttribute('type');
}
public set type(value: string) {
this._type = value;
}
public resetType() {
this._type = undefined;
}
// Temporarily expose input value. Use with caution.
public get typeInput() {
return this._type;
}
// type_arn - computed: true, optional: false, required: false
public get typeArn() {
return this.getStringAttribute('type_arn');
}
// type_name - computed: false, optional: false, required: true
private _typeName?: string;
public get typeName() {
return this.getStringAttribute('type_name');
}
public set typeName(value: string) {
this._typeName = value;
}
// Temporarily expose input value. Use with caution.
public get typeNameInput() {
return this._typeName;
}
// version_id - computed: true, optional: false, required: false
public get versionId() {
return this.getStringAttribute('version_id');
}
// visibility - computed: true, optional: false, required: false
public get visibility() {
return this.getStringAttribute('visibility');
}
// logging_config - computed: false, optional: true, required: false
private _loggingConfig = new CloudformationTypeLoggingConfigOutputReference(this, "logging_config");
public get loggingConfig() {
return this._loggingConfig;
}
public putLoggingConfig(value: CloudformationTypeLoggingConfig) {
this._loggingConfig.internalValue = value;
}
public resetLoggingConfig() {
this._loggingConfig.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
public get loggingConfigInput() {
return this._loggingConfig.internalValue;
}
// =========
// SYNTHESIS
// =========
protected synthesizeAttributes(): { [name: string]: any } {
return {
execution_role_arn: cdktf.stringToTerraform(this._executionRoleArn),
id: cdktf.stringToTerraform(this._id),
schema_handler_package: cdktf.stringToTerraform(this._schemaHandlerPackage),
type: cdktf.stringToTerraform(this._type),
type_name: cdktf.stringToTerraform(this._typeName),
logging_config: cloudformationTypeLoggingConfigToTerraform(this._loggingConfig.internalValue),
};
}
}