-
Notifications
You must be signed in to change notification settings - Fork 34
/
generator.yaml
344 lines (344 loc) · 11.7 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
ignore:
resource_names:
- AccessKey
- AccountAlias
#- Group
#- InstanceProfile
- LoginProfile
#- OpenIDConnectProvider
#- Policy
- PolicyVersion
#- Role
- SAMLProvider
- ServiceLinkedRole
- ServiceSpecificCredential
#- User
- VirtualMFADevice
field_paths:
- CreateInstanceProfileOutput.InstanceProfile.Roles
operations:
GetGroup:
# This is necessary because the GetGroupOutput shape has both a Group and a
# Users field and we want to grab the Group information from the output
# shape...
output_wrapper_field_path: Group
resources:
Group:
hooks:
sdk_read_one_post_set_output:
template_path: hooks/group/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/group/sdk_create_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/group/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/group/sdk_update_post_build_request.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/group/sdk_delete_pre_build_request.go.tpl
exceptions:
terminal_codes:
- InvalidInput
- MalformedPolicyDocument
renames:
operations:
CreateGroup:
input_fields:
GroupName: Name
GetGroup:
input_fields:
GroupName: Name
UpdateGroup:
input_fields:
GroupName: Name
DeleteGroup:
input_fields:
GroupName: Name
fields:
Path:
late_initialize: {}
# In order to support attaching zero or more policies to a role, we use
# custom update code path code that uses the Attach/DetachGroupPolicy API
# calls to manage the set of PolicyARNs attached to this Group.
Policies:
type: "[]*string"
references:
resource: Policy
path: Status.ACKResourceMetadata.ARN
# These are policy documents that are added to the Group using the
# Put/DeleteGroupPolicy APIs, as compared to the Attach/DetachGroupPolicy
# APIs that are for non-inline managed policies.
#
# The map key is the PolicyDocumentName and the map value is the JSON
# policy document.
InlinePolicies:
type: map[string]*string
tags:
ignore: true
InstanceProfile:
renames:
operations:
CreateInstanceProfile:
input_fields:
InstanceProfileName: Name
GetInstanceProfile:
input_fields:
InstanceProfileName: Name
DeleteInstanceProfile:
input_fields:
InstanceProfileName: Name
exceptions:
terminal_codes:
- InvalidInput
fields:
Path:
late_initialize: {}
is_immutable: true
# In order to support attaching a role to the instance profile, custom code
# is used to attach/detach the role to the instance profile object based on
# the name of the role. Note that an instance profile can only contain a
# single IAM role at a given time.
Role:
type: "*string"
references:
resource: Role
path: Spec.Name
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
sdk_create_post_set_output:
template_path: hooks/instance_profile/sdk_create_post_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/instance_profile/sdk_delete_pre_build_request.go.tpl
sdk_read_one_post_set_output:
template_path: hooks/instance_profile/sdk_read_one_post_set_output.go.tpl
# There is no `UpdateInstanceProfile` API operation. The only way to update an
# instance profile is to update the properties individually or to recreate
# the profile entirely.
update_operation:
custom_method_name: customUpdateInstanceProfile
Policy:
renames:
operations:
CreatePolicy:
input_fields:
PolicyName: Name
GetPolicy:
input_fields:
PolicyName: Name
DeletePolicy:
input_fields:
PolicyName: Name
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
sdk_read_one_post_set_output:
template_path: hooks/policy/sdk_read_one_post_set_output.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/policy/sdk_delete_pre_build_request.go.tpl
update_operation:
# There is no `UpdatePolicy` API operation. The only way to update a
# policy is to update the properties individually (only a few properties
# support this) or to delete the policy and recreate it entirely.
#
# This custom method will support updating the properties individually,
# but there is currently no support for the delete/create option.
custom_method_name: customUpdatePolicy
exceptions:
terminal_codes:
- InvalidInput
- MalformedPolicyDocument
fields:
# Left for historical purposes. It looks like late_initialize is was
# causing the controller to infinitely requeue (every 5 seconds) when the
# description was set to nil. Not it looks like this is not needed
# anymore.
# Note(a-hilaly): Very likely the API behavior has changed and the
# late_initialize is no longer needed.
#
Description:
# You might be wondering why description is late-initialized, since
# there isn't a default server-side value for description.
#
# The CreatePolicy API call accepts a Description field in the input
# and the documentation (and API model) say that a Description field is
# included in the returned response from CreatePolicy, however the
# Description returned from the CreatePolicy API call is always
# missing/nil which means the SetResource code sets the
# Spec.Description to nil. When the next time the GetPolicy API call is
# made in the next reconciliation loop, GetPolicy returns the
# description that was originally set in the CreatePolicy API call and
# a Delta difference is discovered erroneously (because the SetResource
# call after CreatePolicy incorrectly set the description to nil). So,
# we set the late initialize property of the Description field here to
# override the Spec.Description to the original value we set in the
# CreatePolicy *input* shape.
#late_initialize: {}
set:
- ignore: true
method: Create
Path:
late_initialize: {}
Tags:
compare:
is_ignored: true
Role:
hooks:
delta_pre_compare:
code: customPreCompare(delta, a, b)
sdk_read_one_post_set_output:
template_path: hooks/role/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/role/sdk_create_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/role/sdk_update_pre_build_request.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/role/sdk_delete_pre_build_request.go.tpl
exceptions:
terminal_codes:
- InvalidInput
- MalformedPolicyDocument
renames:
operations:
CreateRole:
input_fields:
RoleName: Name
GetRole:
input_fields:
RoleName: Name
UpdateRole:
input_fields:
RoleName: Name
DeleteRole:
input_fields:
RoleName: Name
fields:
MaxSessionDuration:
late_initialize: {}
PermissionsBoundary:
references:
resource: Policy
path: Status.ACKResourceMetadata.ARN
set:
# The input and output shapes are different...
- from: PermissionsBoundary.PermissionsBoundaryArn
# Left for historical purposes.
Description:
set:
- ignore: true
method: Create
# See above in Policy resource about why this is here.
# late_initialize: {}
Path:
late_initialize: {}
# In order to support attaching zero or more policies to a role, we use
# custom update code path code that uses the Attach/DetachRolePolicy API
# calls to manage the set of PolicyARNs attached to this Role.
Policies:
type: "[]*string"
references:
resource: Policy
path: Status.ACKResourceMetadata.ARN
# These are policy documents that are added to the Role using the
# Put/DeleteRolePolicy APIs, as compared to the Attach/DetachRolePolicy
# APIs that are for non-inline managed policies.
#
# The map key is the PolicyDocumentName and the map value is the JSON
# policy document.
InlinePolicies:
type: map[string]*string
AssumeRolePolicyDocument:
compare:
is_ignored: true
Tags:
compare:
is_ignored: true
OpenIDConnectProvider:
hooks:
delta_pre_compare:
code: customPreCompare(delta, a, b)
sdk_read_one_post_set_output:
template_path: hooks/open_id_connect_provider/sdk_read_one_post_set_output.go.tpl
exceptions:
terminal_codes:
- InvalidInput
- EntityAlreadyExists
renames:
operations:
CreateOpenIDConnectProvider:
input_fields:
ClientIDList: ClientIDs
ThumbprintList: Thumbprints
GetOpenIDConnectProvider:
output_fields:
ClientIDList: ClientIDs
ThumbprintList: Thumbprints
fields:
URL:
is_immutable: true
compare:
is_ignored: true
Tags:
compare:
is_ignored: true
update_operation:
custom_method_name: customUpdateOpenIDConnectProvider
User:
hooks:
delta_pre_compare:
code: compareTags(delta, a, b)
sdk_read_one_post_set_output:
template_path: hooks/user/sdk_read_one_post_set_output.go.tpl
sdk_create_post_set_output:
template_path: hooks/user/sdk_create_post_set_output.go.tpl
sdk_update_pre_build_request:
template_path: hooks/user/sdk_update_pre_build_request.go.tpl
sdk_update_post_build_request:
template_path: hooks/user/sdk_update_post_build_request.go.tpl
sdk_delete_pre_build_request:
template_path: hooks/user/sdk_delete_pre_build_request.go.tpl
exceptions:
terminal_codes:
- InvalidInput
renames:
operations:
CreateUser:
input_fields:
UserName: Name
GetUser:
input_fields:
UserName: Name
UpdateUser:
input_fields:
UserName: Name
DeleteUser:
input_fields:
UserName: Name
fields:
Path:
late_initialize: {}
PermissionsBoundary:
references:
resource: Policy
path: Status.ACKResourceMetadata.ARN
set:
# The input and output shapes are different...
- from: PermissionsBoundary.PermissionsBoundaryArn
# In order to support attaching zero or more policies to a user, we use
# custom update code path code that uses the Attach/DetachUserPolicy API
# calls to manage the set of PolicyARNs attached to this User.
Policies:
type: "[]*string"
references:
resource: Policy
path: Status.ACKResourceMetadata.ARN
# These are policy documents that are added to the User using the
# Put/DeleteUserPolicy APIs, as compared to the Attach/DetachUserPolicy
# APIs that are for non-inline managed policies.
#
# The map key is the PolicyDocumentName and the map value is the JSON
# policy document.
InlinePolicies:
type: map[string]*string
Tags:
compare:
is_ignored: true