-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathgenerator.yaml
380 lines (379 loc) · 13.5 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
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
resources:
CacheCluster:
fields:
CacheSubnetGroupName:
references:
resource: CacheSubnetGroup
path: Spec.CacheSubnetGroupName
CacheParameterGroupName:
references:
resource: CacheParameterGroup
path: Spec.CacheParameterGroupName
is_immutable: true
ReplicationGroupID:
references:
resource: ReplicationGroup
path: Spec.ReplicationGroupID
is_immutable: true
SnapshotName:
references:
resource: Snapshot
path: Spec.SnapshotName
is_immutable: true
NotificationTopicARN:
references:
service_name: sns
resource: Topic
path: Status.ACKResourceMetadata.ARN
AuthToken:
is_secret: true
PreferredAvailabilityZone:
late_initialize: {}
PreferredAvailabilityZones:
compare:
is_ignored: true
print:
add_age_column: true
add_synced_column: true
order_by: index
additional_columns:
- name: VERSION
json_path: .spec.engineVersion
type: string
index: 10
- name: STATUS
json_path: .status.cacheClusterStatus
type: string
index: 20
- name: ENDPOINT
json_path: .status.configurationEndpoint.address
type: string
index: 30
priority: 1
exceptions:
errors:
404:
code: CacheClusterNotFound
terminal_codes:
- ReplicationGroupNotFoundFault
- InvalidReplicationGroupStateFault
- CacheClusterAlreadyExistsFault
- InsufficientCacheClusterCapacityFault
- CacheSecurityGroupNotFoundFault
- CacheSubnetGroupNotFoundFault
- ClusterQuotaForCustomerExceededFault
- NodeQuotaForClusterExceededFault
- NodeQuotaForCustomerExceededFault
- CacheParameterGroupNotFoundFault
- InvalidVPCNetworkStateFault
- TagQuotaPerResource
- InvalidParameterValue
- InvalidParameterCombination
hooks:
sdk_create_post_set_output:
template_path: hooks/cache_cluster/sdk_create_post_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/cache_cluster/sdk_delete_pre_build_request.go.tpl
sdk_read_many_post_set_output:
template_path: hooks/cache_cluster/sdk_read_many_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/cache_cluster/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/cache_cluster/sdk_update_post_build_request.go.tpl
sdk_update_post_set_output:
template_path: hooks/cache_cluster/sdk_update_post_set_output.go.tpl
delta_post_compare:
code: "modifyDelta(delta, a, b)"
CacheSubnetGroup:
exceptions:
errors:
404:
code: CacheSubnetGroupNotFoundFault
terminal_codes:
- CacheSubnetGroupQuotaExceeded
- CacheSubnetQuotaExceededFault
- SubnetInUse
- InvalidSubnet
- InvalidParameter
- InvalidParameterValue
- InvalidParameterCombination
fields:
SubnetIDs:
references:
service_name: ec2
resource: Subnet
path: Status.SubnetID
Events:
is_read_only: true
from:
operation: DescribeEvents
path: Events
hooks:
sdk_read_many_post_set_output:
template_path: hooks/cache_subnet_group/sdk_read_many_post_set_output.go.tpl
ReplicationGroup:
exceptions:
terminal_codes:
- InvalidParameter
- InvalidParameterValue
- InvalidParameterCombination
- InsufficientCacheClusterCapacity
- ClusterQuotaForCustomerExceeded
- NodeQuotaForClusterExceeded
- NodeQuotaForCustomerExceeded
- InvalidVPCNetworkStateFault
- TagQuotaPerResourceExceeded
- NodeGroupsPerReplicationGroupQuotaExceeded
- InvalidCacheSecurityGroupState
- InvalidKMSKeyFault
fields:
AllowedScaleUpModifications:
is_read_only: true
from:
operation: ListAllowedNodeTypeModifications
path: ScaleUpModifications
AllowedScaleDownModifications:
is_read_only: true
from:
operation: ListAllowedNodeTypeModifications
path: ScaleDownModifications
AutomaticFailoverEnabled:
compare:
is_ignored: true
CacheParameterGroupName:
references:
resource: CacheParameterGroup
path: Spec.CacheParameterGroupName
CacheSubnetGroupName:
references:
resource: CacheSubnetGroup
path: Spec.CacheSubnetGroupName
SecurityGroupIDs:
references:
resource: SecurityGroup
service_name: ec2
path: Status.ID
Events:
is_read_only: true
from:
operation: DescribeEvents
path: Events
AuthToken:
is_secret: true
LogDeliveryConfigurations:
is_read_only: true # creates an additional status field of the same name
from:
operation: CreateReplicationGroup
path: ReplicationGroup.LogDeliveryConfigurations
compare: # removes the spec field from automatic delta comparison
is_ignored: true
MultiAZEnabled:
compare:
is_ignored: true
PrimaryClusterId: # note: "PrimaryClusterID" will not function properly
compare:
is_ignored: true
hooks:
sdk_read_many_post_set_output:
template_path: hooks/replication_group/sdk_read_many_post_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/replication_group/sdk_delete_pre_build_request.go.tpl
sdk_delete_post_request:
template_path: hooks/replication_group/sdk_delete_post_request.go.tpl
sdk_update_pre_build_request:
template_path: hooks/replication_group/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/replication_group/sdk_update_post_build_request.go.tpl
delta_post_compare:
code: "modifyDelta(delta, a, b)"
sdk_file_end:
template_path: hooks/replication_group/sdk_file_end.go.tpl
sdk_file_end_set_output_post_populate:
code: "rm.customSetOutput(ctx, *obj, ko) // custom set output from obj"
renames:
operations:
CreateReplicationGroup:
input_fields:
ReplicationGroupDescription: Description
ModifyReplicationGroup:
input_fields:
ReplicationGroupDescription: Description
Snapshot:
update_conditions_custom_method_name: CustomUpdateConditions
exceptions:
terminal_codes:
- InvalidParameter
- InvalidParameterValue
- InvalidParameterCombination
- SnapshotAlreadyExistsFault
- SnapshotQuotaExceededFault
- SnapshotFeatureNotSupportedFault
fields:
SourceSnapshotName:
from:
operation: CopySnapshot
path: SourceSnapshotName
update_operation:
custom_method_name: customUpdateSnapshot
CacheParameterGroup:
exceptions:
terminal_codes:
- CacheParameterGroupAlreadyExists
- CacheParameterGroupQuotaExceeded
- InvalidCacheParameterGroupState
- InvalidGlobalReplicationGroupState
- InvalidParameterCombination
- InvalidParameterValue
fields:
ParameterNameValues:
from:
operation: ModifyCacheParameterGroup
path: ParameterNameValues
Parameters:
is_read_only: true
from:
operation: DescribeCacheParameters
path: Parameters
Events:
is_read_only: true
from:
operation: DescribeEvents
path: Events
update_operation:
custom_method_name: customUpdateCacheParameterGroup
User:
exceptions:
errors:
404:
code: UserNotFound
terminal_codes:
- UserAlreadyExists
- UserQuotaExceeded
- DuplicateUserName
- InvalidParameterValue
- InvalidParameterCombination
- InvalidUserState
- DefaultUserAssociatedToUserGroup
fields:
LastRequestedAccessString:
is_read_only: true
from:
operation: CreateUser
path: AccessString
ExpandedAccessString:
is_read_only: true
from:
operation: CreateUser
path: AccessString
Passwords:
is_secret: true
compare:
is_ignored: true
hooks:
sdk_read_many_post_set_output:
code: "rm.setSyncedCondition(resp.Users[0].Status, &resource{ko})"
sdk_create_post_set_output:
code: "rm.setSyncedCondition(resp.Status, &resource{ko})"
sdk_update_post_build_request:
code: "rm.populateUpdatePayload(input, desired, delta)"
sdk_update_post_set_output:
code: "rm.setSyncedCondition(resp.Status, &resource{ko})"
delta_post_compare:
code: "filterDelta(delta, a, b)"
UserGroup:
exceptions:
terminal_codes:
- DuplicateUserNameFault
- UserGroupAlreadyExistsFault
- InvalidParameterCombination
- InvalidParameterValueException
- DefaultUserRequired
- UserGroupQuotaExceededFault
- TagQuotaPerResourceExceeded
update_operation:
custom_method_name: customUpdateUserGroup
operations:
DescribeCacheSubnetGroups:
set_output_custom_method_name: CustomDescribeCacheSubnetGroupsSetOutput
DescribeReplicationGroups:
set_output_custom_method_name: CustomDescribeReplicationGroupsSetOutput
CreateReplicationGroup:
set_output_custom_method_name: CustomCreateReplicationGroupSetOutput
ModifyReplicationGroup:
custom_implementation: CustomModifyReplicationGroup
set_output_custom_method_name: CustomModifyReplicationGroupSetOutput
override_values:
ApplyImmediately: aws.Bool(true)
CreateSnapshot:
custom_implementation: CustomCreateSnapshot
set_output_custom_method_name: CustomCreateSnapshotSetOutput
DescribeSnapshots:
set_output_custom_method_name: CustomDescribeSnapshotSetOutput
CreateCacheParameterGroup:
set_output_custom_method_name: CustomCreateCacheParameterGroupSetOutput
DescribeCacheParameterGroups:
set_output_custom_method_name: CustomDescribeCacheParameterGroupsSetOutput
CreateUser:
set_output_custom_method_name: CustomCreateUserSetOutput
ModifyUser:
custom_implementation: CustomModifyUser
set_output_custom_method_name: CustomModifyUserSetOutput
CreateUserGroup:
set_output_custom_method_name: CustomCreateUserGroupSetOutput
DescribeUserGroups:
set_output_custom_method_name: CustomDescribeUserGroupsSetOutput
CreateCacheCluster:
set_output_custom_method_name: customCreateCacheClusterSetOutput
ModifyCacheCluster:
set_output_custom_method_name: customModifyCacheClusterSetOutput
override_values:
ApplyImmediately: aws.Bool(true)
ignore:
resource_names:
- ServerlessCache
- ServerlessCacheSnapshot
- GlobalReplicationGroup
- CacheSecurityGroup
field_paths:
- DescribeSnapshotsInput.CacheClusterId
- DescribeSnapshotsInput.ReplicationGroupId
- DescribeSnapshotsInput.SnapshotSource
- DescribeUsersInput.Engine
- ModifyUserInput.AccessString
- ModifyUserInput.NoPasswordRequired
- ModifyUserInput.Passwords
- ModifyReplicationGroupInput.SecurityGroupIds
- ModifyReplicationGroupInput.EngineVersion
- CreateReplicationGroupInput.GlobalReplicationGroupId
- CreateReplicationGroupInput.AutoMinorVersionUpgrade
- CreateReplicationGroupInput.NumCacheClusters
- CacheCluster.LogDeliveryConfigurations
- PendingModifiedValues.LogDeliveryConfigurations
- CreateUserInput.AuthenticationMode
- ModifyUserInput.AuthenticationMode
- CreateCacheSubnetGroupOutput.CacheSubnetGroup.SupportedNetworkTypes
- CreateCacheSubnetGroupOutput.CacheSubnetGroup.Subnets.SupportedNetworkTypes
- ModifyCacheSubnetGroupOutput.CacheSubnetGroup.Subnets.SupportedNetworkTypes
- CreateUserGroupOutput.ServerlessCaches
- CreateReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.TransitEncryptionEnabled
- ModifyReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.TransitEncryptionEnabled
# - CreateReplicationGroupOutput.ReplicationGroup.TransitEncryptionEnabled
# - ModifyReplicationGroupInput.TransitEncryptionEnabled
# - CreateReplicationGroupInput.TransitEncryptionEnabled
- CreateReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.TransitEncryptionMode
- CreateReplicationGroupOutput.ReplicationGroup.TransitEncryptionMode
- CreateReplicationGroupInput.TransitEncryptionMode
- ModifyReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.TransitEncryptionMode
- CreateReplicationGroupOutput.ReplicationGroup.ClusterMode
- CreateReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.ClusterMode
- CreateReplicationGroupInput.ClusterMode
- ModifyReplicationGroupOutput.ReplicationGroup.ClusterMode
- ModifyReplicationGroupOutput.ReplicationGroup.PendingModifiedValues.ClusterMode
- CreateReplicationGroupInput.IpDiscovery
- CreateReplicationGroupOutput.ReplicationGroup.IpDiscovery
- Subnet.SupportedNetworkTypes
- CreateReplicationGroupInput.ServerlessCacheSnapshotName
- CreateReplicationGroupOutput.ReplicationGroup.NetworkType
- CreateReplicationGroupInput.NetworkType
# - ModifyReplicationGroupOutput.ReplicationGroup.ipDiscovery
# - ModifyReplicationGroupInput.ipDiscovery