1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` generate an acm certifacte resource with complex computed types 1` ] = `
4
- "// generated from terraform resource schema
5
-
6
- /*
7
- {
8
- \\" version\\ " : 0 ,
9
- \\" block\\ " : {
10
- \\" attributes\\ " : {
11
- \\" arn\\ " : {
12
- \\" type\\ " : \\" string\\ " ,
13
- \\" computed\\ " : true
14
- },
15
- \\" certificate_authority_arn\\ " : {
16
- \\" type\\ " : \\" string\\ " ,
17
- \\" optional\\ " : true
18
- },
19
- \\" certificate_body\\ " : {
20
- \\" type\\ " : \\" string\\ " ,
21
- \\" optional\\ " : true
22
- },
23
- \\" certificate_chain\\ " : {
24
- \\" type\\ " : \\" string\\ " ,
25
- \\" optional\\ " : true
26
- },
27
- \\" domain_name\\ " : {
28
- \\" type\\ " : \\" string\\ " ,
29
- \\" optional\\ " : true ,
30
- \\" computed\\ " : true
31
- },
32
- \\" domain_validation_options\\ " : {
33
- \\" type\\ " : [
34
- \\" list\\ " ,
35
- [
36
- \\" object\\ " ,
37
- {
38
- \\" domain_name\\ " : \\" string\\ " ,
39
- \\" resource_record_name\\ " : \\" string\\ " ,
40
- \\" resource_record_type\\ " : \\" string\\ " ,
41
- \\" resource_record_value\\ " : \\" string\\ "
42
- }
43
- ]
44
- ],
45
- \\" computed\\ " : true
46
- },
47
- \\" id\\ " : {
48
- \\" type\\ " : \\" string\\ " ,
49
- \\" optional\\ " : true ,
50
- \\" computed\\ " : true
51
- },
52
- \\" private_key\\ " : {
53
- \\" type\\ " : \\" string\\ " ,
54
- \\" optional\\ " : true ,
55
- \\" sensitive\\ " : true
56
- },
57
- \\" subject_alternative_names\\ " : {
58
- \\" type\\ " : [
59
- \\" list\\ " ,
60
- \\" string\\ "
61
- ],
62
- \\" optional\\ " : true ,
63
- \\" computed\\ " : true
64
- },
65
- \\" tags\\ " : {
66
- \\" type\\ " : [
67
- \\" map\\ " ,
68
- \\" string\\ "
69
- ],
70
- \\" optional\\ " : true
71
- },
72
- \\" validation_emails\\ " : {
73
- \\" type\\ " : [
74
- \\" list\\ " ,
75
- \\" string\\ "
76
- ],
77
- \\" computed\\ " : true
78
- },
79
- \\" validation_method\\ " : {
80
- \\" type\\ " : \\" string\\ " ,
81
- \\" optional\\ " : true ,
82
- \\" computed\\ " : true
83
- }
84
- },
85
- \\" block_types\\ " : {
86
- \\" options\\ " : {
87
- \\" nesting_mode\\ " : \\" list\\ " ,
88
- \\" block\\ " : {
89
- \\" attributes\\ " : {
90
- \\" certificate_transparency_logging_preference\\ " : {
91
- \\" type\\ " : \\" string\\ " ,
92
- \\" optional\\ " : true
93
- }
94
- }
95
- },
96
- \\" max_items\\ " : 1
97
- }
98
- }
99
- }
100
- }
101
- */
4
+ "// https://www.terraform.io/docs/providers/aws/r/acm_certificate.html
5
+ // generated from terraform resource schema
6
+
102
7
import { Construct } from 'constructs';
103
8
import { TerraformResource } from 'cdktf';
9
+ import { TerraformMetaArguments } from 'cdktf';
10
+ import { ComplexComputedList } from \\ "cdktf\\ ";
104
11
105
12
// Configuration
106
13
107
- export interface AcmCertificateConfig {
14
+ export interface AcmCertificateConfig extends TerraformMetaArguments {
108
15
readonly certificateAuthorityArn ?: string ;
109
16
readonly certificateBody ?: string ;
110
17
readonly certificateChain ?: string ;
18
+ readonly domainName ?: string ;
111
19
readonly privateKey ?: string ;
20
+ readonly subjectAlternativeNames ?: string [];
112
21
readonly tags ?: { [key : string ]: string };
22
+ readonly validationMethod ?: string ;
113
23
/** options block */
114
24
readonly options ?: AcmCertificateOptions [];
115
25
}
116
- export interface AcmCertificateDomainValidationOptions {
117
- readonly domainName ?: string ;
118
- readonly resourceRecordName ?: string ;
119
- readonly resourceRecordType ?: string ;
120
- readonly resourceRecordValue ?: string ;
26
+ export class AcmCertificateDomainValidationOptions extends ComplexComputedList {
27
+
28
+ // domain_name - computed: true, optional: false, required: true
29
+ public get domainName () {
30
+ return this.getStringAttribute('domain_name ');
31
+ }
32
+
33
+ // resource_record_name - computed: true, optional: false, required: true
34
+ public get resourceRecordName () {
35
+ return this.getStringAttribute('resource_record_name ');
36
+ }
37
+
38
+ // resource_record_type - computed: true, optional: false, required: true
39
+ public get resourceRecordType () {
40
+ return this.getStringAttribute('resource_record_type ');
41
+ }
42
+
43
+ // resource_record_value - computed: true, optional: false, required: true
44
+ public get resourceRecordValue () {
45
+ return this.getStringAttribute('resource_record_value ');
46
+ }
121
47
}
122
48
export interface AcmCertificateOptions {
123
49
readonly certificateTransparencyLoggingPreference ?: string ;
@@ -133,82 +59,104 @@ export class AcmCertificate extends TerraformResource {
133
59
134
60
public constructor (scope : Construct , id : string , config : AcmCertificateConfig = {}) {
135
61
super(scope , id , {
136
- type : 'aws_acm_certificate ',
62
+ terraformResourceType : 'aws_acm_certificate ',
63
+ terraformGeneratorMetadata : {
64
+ providerName : 'aws '
65
+ },
66
+ provider : config .provider ,
67
+ dependsOn : config .dependsOn ,
68
+ count : config .count ,
69
+ lifecycle : config .lifecycle
137
70
});
138
71
this._certificateAuthorityArn = config.certificateAuthorityArn;
139
72
this._certificateBody = config.certificateBody;
140
73
this._certificateChain = config.certificateChain;
74
+ this._domainName = config.domainName;
141
75
this._privateKey = config.privateKey;
76
+ this._subjectAlternativeNames = config.subjectAlternativeNames;
142
77
this._tags = config.tags;
78
+ this._validationMethod = config.validationMethod;
143
79
this._options = config.options;
144
80
}
145
81
146
82
// ==========
147
83
// ATTRIBUTES
148
84
// ==========
149
85
150
- // arn
86
+ // arn - computed: true, optional: false, required: true
151
87
public get arn () {
152
88
return this.getStringAttribute('arn ');
153
89
}
154
90
155
- // certificate_authority_arn
91
+ // certificate_authority_arn - computed: false, optional: true, required: false
156
92
private _certificateAuthorityArn ?: string ;
157
93
public get certificateAuthorityArn () {
158
- return this._certificateAuthorityArn ?? this.getStringAttribute(' certificate_authority_arn ') ;
94
+ return this._certificateAuthorityArn;
159
95
}
160
- public set certificateAuthorityArn (value : string ) {
96
+ public set certificateAuthorityArn (value : string | undefined ) {
161
97
this._certificateAuthorityArn = value;
162
98
}
163
99
164
- // certificate_body
100
+ // certificate_body - computed: false, optional: true, required: false
165
101
private _certificateBody ?: string ;
166
102
public get certificateBody () {
167
- return this._certificateBody ?? this.getStringAttribute(' certificate_body ') ;
103
+ return this._certificateBody;
168
104
}
169
- public set certificateBody (value : string ) {
105
+ public set certificateBody (value : string | undefined ) {
170
106
this._certificateBody = value;
171
107
}
172
108
173
- // certificate_chain
109
+ // certificate_chain - computed: false, optional: true, required: false
174
110
private _certificateChain ?: string ;
175
111
public get certificateChain () {
176
- return this._certificateChain ?? this.getStringAttribute(' certificate_chain ') ;
112
+ return this._certificateChain;
177
113
}
178
- public set certificateChain (value : string ) {
114
+ public set certificateChain (value : string | undefined ) {
179
115
this._certificateChain = value;
180
116
}
181
117
182
- // domain_name
118
+ // domain_name - computed: true, optional: true, required: false
119
+ private _domainName ?: string ;
183
120
public get domainName () {
184
- return this.getStringAttribute('domain_name ');
121
+ return this._domainName ?? this.getStringAttribute('domain_name ');
122
+ }
123
+ public set domainName (value : string | undefined ) {
124
+ this._domainName = value;
185
125
}
186
126
187
- // domain_validation_options
188
- public get domainValidationOptions () {
189
- throw new Error(' computed attribute \\" $acm_certificate . domain_validation_options \\" has unsupported type \\" AcmCertificateDomainValidationOptions []\\"' );
127
+ // domain_validation_options - computed: true, optional: false, required: true
128
+ public domainValidationOptions (index : string ) {
129
+ return new AcmCertificateDomainValidationOptions( this , ' domain_validation_options ', index );
190
130
}
191
131
192
- // id
132
+ // id - computed: true, optional: true, required: false
133
+ private _id ?: string ;
193
134
public get id () {
194
- return this.getStringAttribute('id ');
135
+ return this._id ?? this.getStringAttribute('id ');
136
+ }
137
+ public set id (value : string | undefined ) {
138
+ this._id = value;
195
139
}
196
140
197
- // private_key
141
+ // private_key - computed: false, optional: true, required: false
198
142
private _privateKey ?: string ;
199
143
public get privateKey () {
200
- return this._privateKey ?? this.getStringAttribute(' private_key ') ;
144
+ return this._privateKey;
201
145
}
202
- public set privateKey (value : string ) {
146
+ public set privateKey (value : string | undefined ) {
203
147
this._privateKey = value;
204
148
}
205
149
206
- // subject_alternative_names
150
+ // subject_alternative_names - computed: true, optional: true, required: false
151
+ private _subjectAlternativeNames ?: string [];
207
152
public get subjectAlternativeNames () {
208
- return this.getListAttribute('subject_alternative_names ');
153
+ return this._subjectAlternativeNames ?? this.getListAttribute('subject_alternative_names ');
154
+ }
155
+ public set subjectAlternativeNames (value : string [] | undefined ) {
156
+ this._subjectAlternativeNames = value;
209
157
}
210
158
211
- // tags
159
+ // tags - computed: false, optional: true, required: false
212
160
private _tags ?: { [key : string ]: string };
213
161
public get tags () {
214
162
return this._tags;
@@ -217,17 +165,21 @@ export class AcmCertificate extends TerraformResource {
217
165
this._tags = value;
218
166
}
219
167
220
- // validation_emails
168
+ // validation_emails - computed: true, optional: false, required: true
221
169
public get validationEmails () {
222
170
return this.getListAttribute('validation_emails ');
223
171
}
224
172
225
- // validation_method
173
+ // validation_method - computed: true, optional: true, required: false
174
+ private _validationMethod ?: string ;
226
175
public get validationMethod () {
227
- return this.getStringAttribute('validation_method ');
176
+ return this._validationMethod ?? this.getStringAttribute('validation_method ');
177
+ }
178
+ public set validationMethod (value : string | undefined ) {
179
+ this._validationMethod = value;
228
180
}
229
181
230
- // options
182
+ // options - computed: false, optional: true, required: false
231
183
private _options ?: AcmCertificateOptions [];
232
184
public get options () {
233
185
return this._options;
@@ -240,13 +192,16 @@ export class AcmCertificate extends TerraformResource {
240
192
// SYNTHESIS
241
193
// =========
242
194
243
- protected synthesizeAttributes () {
195
+ protected synthesizeAttributes (): { [ name : string ]: any } {
244
196
return {
245
197
certificate_authority_arn: this ._certificateAuthorityArn ,
246
198
certificate_body: this ._certificateBody ,
247
199
certificate_chain: this ._certificateChain ,
200
+ domain_name: this ._domainName ,
248
201
private_key: this ._privateKey ,
202
+ subject_alternative_names: this ._subjectAlternativeNames ,
249
203
tags: this ._tags ,
204
+ validation_method: this ._validationMethod ,
250
205
options: this ._options ,
251
206
};
252
207
}
0 commit comments