aws-sdk-iam 1.0.0.rc1 → 1.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-iam.rb +1 -1
- data/lib/aws-sdk-iam/access_key.rb +150 -152
- data/lib/aws-sdk-iam/access_key_pair.rb +160 -162
- data/lib/aws-sdk-iam/account_password_policy.rb +208 -207
- data/lib/aws-sdk-iam/account_summary.rb +55 -57
- data/lib/aws-sdk-iam/assume_role_policy.rb +101 -101
- data/lib/aws-sdk-iam/client.rb +7849 -6742
- data/lib/aws-sdk-iam/client_api.rb +2896 -2784
- data/lib/aws-sdk-iam/current_user.rb +231 -230
- data/lib/aws-sdk-iam/errors.rb +4 -13
- data/lib/aws-sdk-iam/group.rb +422 -418
- data/lib/aws-sdk-iam/group_policy.rb +153 -153
- data/lib/aws-sdk-iam/instance_profile.rb +223 -223
- data/lib/aws-sdk-iam/login_profile.rb +171 -172
- data/lib/aws-sdk-iam/mfa_device.rb +163 -165
- data/lib/aws-sdk-iam/policy.rb +508 -502
- data/lib/aws-sdk-iam/policy_version.rb +149 -151
- data/lib/aws-sdk-iam/resource.rb +986 -969
- data/lib/aws-sdk-iam/role.rb +262 -264
- data/lib/aws-sdk-iam/role_policy.rb +153 -153
- data/lib/aws-sdk-iam/saml_provider.rb +120 -122
- data/lib/aws-sdk-iam/server_certificate.rb +144 -145
- data/lib/aws-sdk-iam/signing_certificate.rb +155 -157
- data/lib/aws-sdk-iam/types.rb +8333 -7476
- data/lib/aws-sdk-iam/user.rb +677 -672
- data/lib/aws-sdk-iam/user_policy.rb +153 -153
- data/lib/aws-sdk-iam/virtual_mfa_device.rb +117 -119
- data/lib/aws-sdk-iam/waiters.rb +76 -77
- metadata +2 -2
data/lib/aws-sdk-iam/errors.rb
CHANGED
@@ -1,23 +1,14 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
module
|
10
|
-
module Errors
|
8
|
+
module Aws::IAM
|
9
|
+
module Errors
|
11
10
|
|
12
|
-
|
11
|
+
extend Aws::Errors::DynamicErrors
|
13
12
|
|
14
|
-
# Raised when calling #load or #data on a resource class that can not be
|
15
|
-
# loaded. This can happen when:
|
16
|
-
#
|
17
|
-
# * A resource class has identifiers, but no data attributes.
|
18
|
-
# * Resource data is only available when making an API call that
|
19
|
-
# enumerates all resources of that type.
|
20
|
-
class ResourceNotLoadable < RuntimeError; end
|
21
|
-
end
|
22
13
|
end
|
23
14
|
end
|
data/lib/aws-sdk-iam/group.rb
CHANGED
@@ -1,459 +1,463 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::IAM
|
9
|
+
class Group
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :group_name :name
|
33
|
+
|
34
|
+
# The path to the group. For more information about paths, see [IAM
|
35
|
+
# Identifiers][1] in the *Using IAM* guide.
|
36
|
+
#
|
37
|
+
#
|
38
|
+
#
|
39
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
40
|
+
# @return [String]
|
41
|
+
def path
|
42
|
+
data.path
|
43
|
+
end
|
45
44
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
45
|
+
# The stable and unique string identifying the group. For more
|
46
|
+
# information about IDs, see [IAM Identifiers][1] in the *Using IAM*
|
47
|
+
# guide.
|
48
|
+
#
|
49
|
+
#
|
50
|
+
#
|
51
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
52
|
+
# @return [String]
|
53
|
+
def group_id
|
54
|
+
data.group_id
|
55
|
+
end
|
57
56
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
57
|
+
# The Amazon Resource Name (ARN) specifying the group. For more
|
58
|
+
# information about ARNs and how to use them in policies, see [IAM
|
59
|
+
# Identifiers][1] in the *Using IAM* guide.
|
60
|
+
#
|
61
|
+
#
|
62
|
+
#
|
63
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
64
|
+
# @return [String]
|
65
|
+
def arn
|
66
|
+
data.arn
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
69
|
+
# The date and time, in [ISO 8601 date-time format][1], when the group
|
70
|
+
# was created.
|
71
|
+
#
|
72
|
+
#
|
73
|
+
#
|
74
|
+
# [1]: http://www.iso.org/iso/iso8601
|
75
|
+
# @return [Time]
|
76
|
+
def create_date
|
77
|
+
data.create_date
|
78
|
+
end
|
80
79
|
|
81
|
-
|
80
|
+
# @!endgroup
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
# @return [Client]
|
83
|
+
def client
|
84
|
+
@client
|
85
|
+
end
|
87
86
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
87
|
+
# Loads, or reloads {#data} for the current {Group}.
|
88
|
+
# Returns `self` making it possible to chain methods.
|
89
|
+
#
|
90
|
+
# group.reload.data
|
91
|
+
#
|
92
|
+
# @return [self]
|
93
|
+
def load
|
94
|
+
resp = @client.get_group(group_name: @name)
|
95
|
+
@data = resp.group
|
96
|
+
self
|
97
|
+
end
|
98
|
+
alias :reload :load
|
99
|
+
|
100
|
+
# @return [Types::Group]
|
101
|
+
# Returns the data for this {Group}. Calls
|
102
|
+
# {Client#get_group} if {#data_loaded?} is `false`.
|
103
|
+
def data
|
104
|
+
load unless @data
|
105
|
+
@data
|
106
|
+
end
|
108
107
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
108
|
+
# @return [Boolean]
|
109
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
110
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
111
|
+
def data_loaded?
|
112
|
+
!!@data
|
113
|
+
end
|
115
114
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
115
|
+
# @!group Actions
|
116
|
+
|
117
|
+
# @example Request syntax with placeholder values
|
118
|
+
#
|
119
|
+
# group.add_user({
|
120
|
+
# user_name: "existingUserNameType", # required
|
121
|
+
# })
|
122
|
+
# @param [Hash] options ({})
|
123
|
+
# @option options [required, String] :user_name
|
124
|
+
# The name of the user to add.
|
125
|
+
#
|
126
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
127
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
128
|
+
# with no spaces. You can also include any of the following characters:
|
129
|
+
# =,.@-
|
130
|
+
#
|
131
|
+
#
|
132
|
+
#
|
133
|
+
# [1]: http://wikipedia.org/wiki/regex
|
134
|
+
# @return [EmptyStructure]
|
135
|
+
def add_user(options = {})
|
136
|
+
options = options.merge(group_name: @name)
|
137
|
+
resp = @client.add_user_to_group(options)
|
138
|
+
resp.data
|
139
|
+
end
|
140
140
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
141
|
+
# @example Request syntax with placeholder values
|
142
|
+
#
|
143
|
+
# group.attach_policy({
|
144
|
+
# policy_arn: "arnType", # required
|
145
|
+
# })
|
146
|
+
# @param [Hash] options ({})
|
147
|
+
# @option options [required, String] :policy_arn
|
148
|
+
# The Amazon Resource Name (ARN) of the IAM policy you want to attach.
|
149
|
+
#
|
150
|
+
# For more information about ARNs, see [Amazon Resource Names (ARNs) and
|
151
|
+
# AWS Service Namespaces][1] in the *AWS General Reference*.
|
152
|
+
#
|
153
|
+
#
|
154
|
+
#
|
155
|
+
# [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
156
|
+
# @return [EmptyStructure]
|
157
|
+
def attach_policy(options = {})
|
158
|
+
options = options.merge(group_name: @name)
|
159
|
+
resp = @client.attach_group_policy(options)
|
160
|
+
resp.data
|
161
|
+
end
|
162
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
|
-
|
163
|
+
# @example Request syntax with placeholder values
|
164
|
+
#
|
165
|
+
# group = group.create({
|
166
|
+
# path: "pathType",
|
167
|
+
# })
|
168
|
+
# @param [Hash] options ({})
|
169
|
+
# @option options [String] :path
|
170
|
+
# The path to the group. For more information about paths, see [IAM
|
171
|
+
# Identifiers][1] in the *IAM User Guide*.
|
172
|
+
#
|
173
|
+
# This parameter is optional. If it is not included, it defaults to a
|
174
|
+
# slash (/).
|
175
|
+
#
|
176
|
+
# This paramater allows (per its [regex pattern][2]) a string of
|
177
|
+
# characters consisting of either a forward slash (/) by itself or a
|
178
|
+
# string that must begin and end with forward slashes, containing any
|
179
|
+
# ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
|
180
|
+
# including most punctuation characters, digits, and upper and
|
181
|
+
# lowercased letters.
|
182
|
+
#
|
183
|
+
#
|
184
|
+
#
|
185
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
186
|
+
# [2]: http://wikipedia.org/wiki/regex
|
187
|
+
# @return [Group]
|
188
|
+
def create(options = {})
|
189
|
+
options = options.merge(group_name: @name)
|
190
|
+
resp = @client.create_group(options)
|
191
|
+
Group.new(
|
192
|
+
name: options[:group_name],
|
193
|
+
data: resp.data.group,
|
194
|
+
client: @client
|
195
|
+
)
|
196
|
+
end
|
197
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
|
-
|
198
|
+
# @example Request syntax with placeholder values
|
199
|
+
#
|
200
|
+
# grouppolicy = group.create_policy({
|
201
|
+
# policy_name: "policyNameType", # required
|
202
|
+
# policy_document: "policyDocumentType", # required
|
203
|
+
# })
|
204
|
+
# @param [Hash] options ({})
|
205
|
+
# @option options [required, String] :policy_name
|
206
|
+
# The name of the policy document.
|
207
|
+
#
|
208
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
209
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
210
|
+
# with no spaces. You can also include any of the following characters:
|
211
|
+
# =,.@-
|
212
|
+
#
|
213
|
+
#
|
214
|
+
#
|
215
|
+
# [1]: http://wikipedia.org/wiki/regex
|
216
|
+
# @option options [required, String] :policy_document
|
217
|
+
# The policy document.
|
218
|
+
#
|
219
|
+
# The [regex pattern][1] used to validate this parameter is a string of
|
220
|
+
# characters consisting of any printable ASCII character ranging from
|
221
|
+
# the space character (\\u0020) through end of the ASCII character range
|
222
|
+
# as well as the printable characters in the Basic Latin and Latin-1
|
223
|
+
# Supplement character set (through \\u00FF). It also includes the
|
224
|
+
# special characters tab (\\u0009), line feed (\\u000A), and carriage
|
225
|
+
# return (\\u000D).
|
226
|
+
#
|
227
|
+
#
|
228
|
+
#
|
229
|
+
# [1]: http://wikipedia.org/wiki/regex
|
230
|
+
# @return [GroupPolicy]
|
231
|
+
def create_policy(options = {})
|
232
|
+
options = options.merge(group_name: @name)
|
233
|
+
resp = @client.put_group_policy(options)
|
234
|
+
GroupPolicy.new(
|
235
|
+
group_name: @name,
|
236
|
+
name: options[:policy_name],
|
237
|
+
client: @client
|
238
|
+
)
|
239
|
+
end
|
237
240
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
241
|
+
# @example Request syntax with placeholder values
|
242
|
+
#
|
243
|
+
# group.delete()
|
244
|
+
# @param [Hash] options ({})
|
245
|
+
# @return [EmptyStructure]
|
246
|
+
def delete(options = {})
|
247
|
+
options = options.merge(group_name: @name)
|
248
|
+
resp = @client.delete_group(options)
|
249
|
+
resp.data
|
250
|
+
end
|
248
251
|
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
252
|
+
# @example Request syntax with placeholder values
|
253
|
+
#
|
254
|
+
# group.detach_policy({
|
255
|
+
# policy_arn: "arnType", # required
|
256
|
+
# })
|
257
|
+
# @param [Hash] options ({})
|
258
|
+
# @option options [required, String] :policy_arn
|
259
|
+
# The Amazon Resource Name (ARN) of the IAM policy you want to detach.
|
260
|
+
#
|
261
|
+
# For more information about ARNs, see [Amazon Resource Names (ARNs) and
|
262
|
+
# AWS Service Namespaces][1] in the *AWS General Reference*.
|
263
|
+
#
|
264
|
+
#
|
265
|
+
#
|
266
|
+
# [1]: http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
267
|
+
# @return [EmptyStructure]
|
268
|
+
def detach_policy(options = {})
|
269
|
+
options = options.merge(group_name: @name)
|
270
|
+
resp = @client.detach_group_policy(options)
|
271
|
+
resp.data
|
272
|
+
end
|
270
273
|
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
274
|
+
# @example Request syntax with placeholder values
|
275
|
+
#
|
276
|
+
# group.remove_user({
|
277
|
+
# user_name: "existingUserNameType", # required
|
278
|
+
# })
|
279
|
+
# @param [Hash] options ({})
|
280
|
+
# @option options [required, String] :user_name
|
281
|
+
# The name of the user to remove.
|
282
|
+
#
|
283
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
284
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
285
|
+
# with no spaces. You can also include any of the following characters:
|
286
|
+
# =,.@-
|
287
|
+
#
|
288
|
+
#
|
289
|
+
#
|
290
|
+
# [1]: http://wikipedia.org/wiki/regex
|
291
|
+
# @return [EmptyStructure]
|
292
|
+
def remove_user(options = {})
|
293
|
+
options = options.merge(group_name: @name)
|
294
|
+
resp = @client.remove_user_from_group(options)
|
295
|
+
resp.data
|
296
|
+
end
|
293
297
|
|
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
|
-
|
298
|
+
# @example Request syntax with placeholder values
|
299
|
+
#
|
300
|
+
# group = group.update({
|
301
|
+
# new_path: "pathType",
|
302
|
+
# new_group_name: "groupNameType",
|
303
|
+
# })
|
304
|
+
# @param [Hash] options ({})
|
305
|
+
# @option options [String] :new_path
|
306
|
+
# New path for the IAM group. Only include this if changing the group's
|
307
|
+
# path.
|
308
|
+
#
|
309
|
+
# This paramater allows (per its [regex pattern][1]) a string of
|
310
|
+
# characters consisting of either a forward slash (/) by itself or a
|
311
|
+
# string that must begin and end with forward slashes, containing any
|
312
|
+
# ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
|
313
|
+
# including most punctuation characters, digits, and upper and
|
314
|
+
# lowercased letters.
|
315
|
+
#
|
316
|
+
#
|
317
|
+
#
|
318
|
+
# [1]: http://wikipedia.org/wiki/regex
|
319
|
+
# @option options [String] :new_group_name
|
320
|
+
# New name for the IAM group. Only include this if changing the group's
|
321
|
+
# name.
|
322
|
+
#
|
323
|
+
# This parameter allows (per its [regex pattern][1]) a string of
|
324
|
+
# characters consisting of upper and lowercase alphanumeric characters
|
325
|
+
# with no spaces. You can also include any of the following characters:
|
326
|
+
# =,.@-
|
327
|
+
#
|
328
|
+
#
|
329
|
+
#
|
330
|
+
# [1]: http://wikipedia.org/wiki/regex
|
331
|
+
# @return [Group]
|
332
|
+
def update(options = {})
|
333
|
+
options = options.merge(group_name: @name)
|
334
|
+
resp = @client.update_group(options)
|
335
|
+
Group.new(
|
336
|
+
name: options[:new_group_name],
|
337
|
+
client: @client
|
338
|
+
)
|
339
|
+
end
|
335
340
|
|
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
|
-
end
|
372
|
-
y.yield(batch)
|
341
|
+
# @!group Associations
|
342
|
+
|
343
|
+
# @example Request syntax with placeholder values
|
344
|
+
#
|
345
|
+
# attached_policies = group.attached_policies({
|
346
|
+
# path_prefix: "policyPathType",
|
347
|
+
# })
|
348
|
+
# @param [Hash] options ({})
|
349
|
+
# @option options [String] :path_prefix
|
350
|
+
# The path prefix for filtering the results. This parameter is optional.
|
351
|
+
# If it is not included, it defaults to a slash (/), listing all
|
352
|
+
# policies.
|
353
|
+
#
|
354
|
+
# This paramater allows (per its [regex pattern][1]) a string of
|
355
|
+
# characters consisting of either a forward slash (/) by itself or a
|
356
|
+
# string that must begin and end with forward slashes, containing any
|
357
|
+
# ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
|
358
|
+
# including most punctuation characters, digits, and upper and
|
359
|
+
# lowercased letters.
|
360
|
+
#
|
361
|
+
#
|
362
|
+
#
|
363
|
+
# [1]: http://wikipedia.org/wiki/regex
|
364
|
+
# @return [Policy::Collection]
|
365
|
+
def attached_policies(options = {})
|
366
|
+
batches = Enumerator.new do |y|
|
367
|
+
options = options.merge(group_name: @name)
|
368
|
+
resp = @client.list_attached_group_policies(options)
|
369
|
+
resp.each_page do |page|
|
370
|
+
batch = []
|
371
|
+
page.data.attached_policies.each do |a|
|
372
|
+
batch << Policy.new(
|
373
|
+
arn: a.policy_arn,
|
374
|
+
client: @client
|
375
|
+
)
|
373
376
|
end
|
377
|
+
y.yield(batch)
|
374
378
|
end
|
375
|
-
Policy::Collection.new(batches)
|
376
379
|
end
|
380
|
+
Policy::Collection.new(batches)
|
381
|
+
end
|
377
382
|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
end
|
396
|
-
y.yield(batch)
|
383
|
+
# @example Request syntax with placeholder values
|
384
|
+
#
|
385
|
+
# group.policies()
|
386
|
+
# @param [Hash] options ({})
|
387
|
+
# @return [GroupPolicy::Collection]
|
388
|
+
def policies(options = {})
|
389
|
+
batches = Enumerator.new do |y|
|
390
|
+
options = options.merge(group_name: @name)
|
391
|
+
resp = @client.list_group_policies(options)
|
392
|
+
resp.each_page do |page|
|
393
|
+
batch = []
|
394
|
+
page.data.policy_names.each do |p|
|
395
|
+
batch << GroupPolicy.new(
|
396
|
+
group_name: @name,
|
397
|
+
name: p,
|
398
|
+
client: @client
|
399
|
+
)
|
397
400
|
end
|
401
|
+
y.yield(batch)
|
398
402
|
end
|
399
|
-
GroupPolicy::Collection.new(batches)
|
400
403
|
end
|
404
|
+
GroupPolicy::Collection.new(batches)
|
405
|
+
end
|
401
406
|
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
407
|
+
# @param [String] name
|
408
|
+
# @return [GroupPolicy]
|
409
|
+
def policy(name)
|
410
|
+
GroupPolicy.new(
|
411
|
+
group_name: @name,
|
412
|
+
name: name,
|
413
|
+
client: @client
|
414
|
+
)
|
415
|
+
end
|
411
416
|
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
end
|
430
|
-
y.yield(batch)
|
417
|
+
# @example Request syntax with placeholder values
|
418
|
+
#
|
419
|
+
# group.users()
|
420
|
+
# @param [Hash] options ({})
|
421
|
+
# @return [User::Collection]
|
422
|
+
def users(options = {})
|
423
|
+
batches = Enumerator.new do |y|
|
424
|
+
options = options.merge(group_name: @name)
|
425
|
+
resp = @client.get_group(options)
|
426
|
+
resp.each_page do |page|
|
427
|
+
batch = []
|
428
|
+
page.data.users.each do |u|
|
429
|
+
batch << User.new(
|
430
|
+
name: u.user_name,
|
431
|
+
data: u,
|
432
|
+
client: @client
|
433
|
+
)
|
431
434
|
end
|
435
|
+
y.yield(batch)
|
432
436
|
end
|
433
|
-
User::Collection.new(batches)
|
434
437
|
end
|
438
|
+
User::Collection.new(batches)
|
439
|
+
end
|
435
440
|
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
end
|
441
|
+
# @deprecated
|
442
|
+
# @api private
|
443
|
+
def identifiers
|
444
|
+
{ name: @name }
|
445
|
+
end
|
446
|
+
deprecated(:identifiers)
|
447
|
+
|
448
|
+
private
|
449
|
+
|
450
|
+
def extract_name(args, options)
|
451
|
+
value = args[0] || options.delete(:name)
|
452
|
+
case value
|
453
|
+
when String then value
|
454
|
+
when nil then raise ArgumentError, "missing required option :name"
|
455
|
+
else
|
456
|
+
msg = "expected :name to be a String, got #{value.class}"
|
457
|
+
raise ArgumentError, msg
|
454
458
|
end
|
455
|
-
|
456
|
-
class Collection < Aws::Resources::Collection; end
|
457
459
|
end
|
460
|
+
|
461
|
+
class Collection < Aws::Resources::Collection; end
|
458
462
|
end
|
459
463
|
end
|