-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgenerator.yaml
285 lines (284 loc) · 12.6 KB
/
generator.yaml
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
ignore:
resource_names:
#- CachePolicy
- CloudFrontOriginAccessIdentity
- ContinuousDeploymentPolicy
#- Distribution
- FieldLevelEncryptionConfig
- FieldLevelEncryptionProfile
# Function
- Invalidation
- KeyGroup
- MonitoringSubscription
# - OriginAccessControl
# - OriginRequestPolicy
- PublicKey
- RealtimeLogConfig
#- ResponseHeadersPolicy
- StreamingDistribution
field_paths:
# NOTE(jaypipes): This is an idempotency token and handled automatically by
# the controller; we don't want it as a field on the resource.
- CreateDistributionInput.DistributionConfig.CallerReference
# CloudFront's API is XML-based and they have this silly nested list struct
# things with an "items" and "quantity" field and errors like
# "InconsistentQuantities" when the number of items doesn't match the value
# of the "quantities" field. Let's ignore the quantities field since we can
# always calculate it by doing a len(items)...
- CreateDistributionInput.DistributionConfig.Origins.Quantity
- CreateDistributionInput.DistributionConfig.Origins.Items.Origin.CustomHeaders.Quantity
- CreateDistributionInput.DistributionConfig.Origins.Items.Origin.CustomOriginConfig.OriginSslProtocols.Quantity
- CreateDistributionInput.DistributionConfig.OriginGroups.Quantity
- CreateDistributionInput.DistributionConfig.OriginGroups.Items.OriginGroup.FailoverCriteria.StatusCodes.Quantity
- CreateDistributionInput.DistributionConfig.OriginGroups.Items.OriginGroup.Members.Quantity
- CreateDistributionInput.DistributionConfig.Aliases.Quantity
# NOTE(jaypipes): "GeoRestriction" is singular here. Not a typo...
- CreateDistributionInput.DistributionConfig.Restrictions.GeoRestriction.Quantity
- CreateDistributionInput.DistributionConfig.CustomErrorResponses.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.TrustedKeyGroups.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.TrustedSigners.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.LambdaFunctionAssociations.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.AllowedMethods.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.AllowedMethods.CachedMethods.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.FunctionAssociations.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.ForwardedValues.Cookies.WhitelistedNames.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.ForwardedValues.Headers.Quantity
- CreateDistributionInput.DistributionConfig.CacheBehaviors.Items.ForwardedValues.QueryStringCacheKeys.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.TrustedKeyGroups.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.TrustedSigners.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.LambdaFunctionAssociations.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.AllowedMethods.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.AllowedMethods.CachedMethods.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.FunctionAssociations.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.ForwardedValues.Cookies.WhitelistedNames.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.ForwardedValues.Headers.Quantity
- CreateDistributionInput.DistributionConfig.DefaultCacheBehavior.ForwardedValues.QueryStringCacheKeys.Quantity
- CreateDistributionOutput.Distribution.ActiveTrustedKeyGroups.Quantity
- CreateDistributionOutput.Distribution.ActiveTrustedSigners.Quantity
# OriginRequestPolicy fields
- CreateOriginRequestPolicyOutput.OriginRequestPolicy.OriginRequestPolicyConfig.QueryStringsConfig.QueryStrings.Quantity
# ResponseHeadersPolicy fields
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.CorsConfig.AccessControlAllowHeaders.Quantity
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.CorsConfig.AccessControlAllowMethods.Quantity
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.CorsConfig.AccessControlAllowOrigins.Quantity
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.CorsConfig.AccessControlExposeHeaders.Quantity
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.CustomHeadersConfig.Quantity
- CreateResponseHeadersPolicyOutput.ResponseHeadersPolicy.ResponseHeadersPolicyConfig.RemoveHeadersConfig.Quantity
operations:
# CloudFront has both List and Get operations. Prefer the Get operations...
CreateCachePolicy:
output_wrapper_field_path: CachePolicy
GetCachePolicy:
resource_name: CachePolicy
operation_type: READ_ONE
output_wrapper_field_path: CachePolicy
CreateDistribution:
output_wrapper_field_path: Distribution
GetDistribution:
resource_name: Distribution
operation_type: READ_ONE
output_wrapper_field_path: Distribution
DescribeFunction:
resource_name: Function
operation_type: READ_ONE
CreateOriginAccessControl:
output_wrapper_field_path: OriginAccessControl
GetOriginAccessControl:
resource_name: OriginAccessControl
operation_type: READ_ONE
output_wrapper_field_path: OriginAccessControl
CreateOriginRequestPolicy:
output_wrapper_field_path: OriginRequestPolicy
GetOriginRequestPolicy:
resource_name: OriginRequestPolicy
operation_type: READ_ONE
output_wrapper_field_path: OriginRequestPolicy
CreateResponseHeadersPolicy:
output_wrapper_field_path: ResponseHeadersPolicy
GetResponseHeadersPolicy:
resource_name: ResponseHeadersPolicy
operation_type: READ_ONE
output_wrapper_field_path: ResponseHeadersPolicy
resources:
CachePolicy:
exceptions:
terminal_codes:
- IllegalUpdate
- InconsistentQuantities
- InvalidArgument
- InvalidIfMatchVersion
- PreconditionFailed
- TooManyCookiesInCachePolicy
- TooManyHeadersInCachePolicy
- TooManyQueryStringsInCachePolicy
tags:
ignore: true
hooks:
sdk_read_one_post_set_output:
template_path: hooks/cache_policy/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/cache_policy/sdk_create_post_set_output.go.tpl
sdk_create_post_build_request:
template_path: hooks/cache_policy/sdk_create_post_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/cache_policy/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/cache_policy/sdk_update_post_set_output.go.tpl
sdk_delete_post_build_request:
template_path: hooks/cache_policy/sdk_delete_post_build_request.go.tpl
fields:
ETag:
is_read_only: true
from:
operation: CreateCachePolicy
path: ETag
Distribution:
exceptions:
terminal_codes:
# NOTE(jaypipes): Yes, believe it or not, this isn't a typo. This is
# the actual error code...
- IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior
- IllegalOriginAccessConfiguration
- InconsistentQuantities
- InvalidArgument
- InvalidIfMatchVersion
- InvalidDefaultRootObject
- InvalidDomainNameForOriginAccessControl
- InvalidErrorCode
- InvalidForwardCookies
- InvalidFunctionAssociation
- InvalidGeoRestrictionParameter
- InvalidHeadersForS3Origin
- InvalidLambdaFunctionAssociation
- InvalidLocationCode
- InvalidMinimumProtocolVersion
- InvalidOrigin
- InvalidOriginAccessControl
- InvalidOriginAccessIdentity
- InvalidOriginKeepaliveTimeout
- InvalidOriginReadTimeout
- InvalidProtocolSettings
- InvalidQueryStringParameters
- InvalidRelativePath
- InvalidRequiredProtocol
- InvalidResponseCode
- InvalidTTLOrder
- InvalidViewerCertificate
- InvalidWebACLId
- MissingBody
- TooManyCacheBehaviours
- TooManyCertificates
- TooManyCookieNamesInWhiteList
- TooManyDistributionCNAMEs
- TooManyOriginCustomHeaders
- TooManyOriginGroupsPerDistribution
- TooManyOrigins
- TooManyQueryStringParameters
- TooManyTrustedSigners
tags:
ignore: true
hooks:
sdk_read_one_post_set_output:
template_path: hooks/distribution/sdk_read_one_post_set_output.go.tpl
sdk_create_post_build_request:
template_path: hooks/distribution/sdk_create_post_build_request.go.tpl
sdk_create_post_set_output:
template_path: hooks/distribution/sdk_create_post_set_output.go.tpl
sdk_update_post_build_request:
template_path: hooks/distribution/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/distribution/sdk_update_post_set_output.go.tpl
sdk_delete_post_build_request:
template_path: hooks/distribution/sdk_delete_post_build_request.go.tpl
fields:
ETag:
is_read_only: true
from:
operation: CreateDistribution
path: ETag
CallerReference:
type: string
is_read_only: true
DistributionConfig.ViewerCertificate.ACMCertificateARN:
references:
service_name: acm
resource: Certificate
path: Status.ACKResourceMetadata.ARN
Function:
tags:
ignore: true
fields:
ETag:
set:
- method: Update
to: IfMatch
- method: Delete
to: IfMatch
hooks:
sdk_read_one_post_set_output:
template_path: hooks/function/sdk_read_one_post_set_output.go.tpl
OriginAccessControl:
tags:
ignore: true
fields:
ETag:
is_read_only: true
type: string
Location:
is_read_only: true
type: string
hooks:
sdk_read_one_post_set_output:
template_path: hooks/origin_access_control/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/origin_access_control/sdk_create_post_set_output.go.tpl
sdk_update_post_build_request:
template_path: hooks/origin_access_control/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/origin_access_control/sdk_update_post_set_output.go.tpl
sdk_delete_post_build_request:
template_path: hooks/origin_access_control/sdk_delete_post_build_request.go.tpl
OriginRequestPolicy:
tags:
ignore: true
fields:
ETag:
is_read_only: true
type: string
Location:
is_read_only: true
type: string
hooks:
sdk_read_one_post_set_output:
template_path: hooks/origin_request_policy/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/origin_request_policy/sdk_create_post_set_output.go.tpl
sdk_create_post_build_request:
template_path: hooks/origin_request_policy/sdk_create_post_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/origin_request_policy/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/origin_request_policy/sdk_update_post_set_output.go.tpl
sdk_delete_post_build_request:
template_path: hooks/origin_request_policy/sdk_delete_post_build_request.go.tpl
ResponseHeadersPolicy:
tags:
ignore: true
fields:
ETag:
is_read_only: true
type: string
hooks:
sdk_read_one_post_set_output:
template_path: hooks/response_headers_policy/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/response_headers_policy/sdk_create_post_set_output.go.tpl
sdk_create_post_build_request:
template_path: hooks/response_headers_policy/sdk_create_post_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/response_headers_policy/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/response_headers_policy/sdk_update_post_set_output.go.tpl
sdk_delete_post_build_request:
template_path: hooks/response_headers_policy/sdk_delete_post_build_request.go.tpl