aws-sdk-iam 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/aws-sdk-iam.rb +69 -0
- data/lib/aws-sdk-iam/access_key.rb +179 -0
- data/lib/aws-sdk-iam/access_key_pair.rb +190 -0
- data/lib/aws-sdk-iam/account_password_policy.rb +216 -0
- data/lib/aws-sdk-iam/account_summary.rb +76 -0
- data/lib/aws-sdk-iam/assume_role_policy.rb +122 -0
- data/lib/aws-sdk-iam/client.rb +6894 -0
- data/lib/aws-sdk-iam/client_api.rb +2868 -0
- data/lib/aws-sdk-iam/current_user.rb +269 -0
- data/lib/aws-sdk-iam/customizations.rb +2 -0
- data/lib/aws-sdk-iam/customizations/resource.rb +19 -0
- data/lib/aws-sdk-iam/errors.rb +23 -0
- data/lib/aws-sdk-iam/group.rb +459 -0
- data/lib/aws-sdk-iam/group_policy.rb +178 -0
- data/lib/aws-sdk-iam/instance_profile.rb +264 -0
- data/lib/aws-sdk-iam/login_profile.rb +196 -0
- data/lib/aws-sdk-iam/mfa_device.rb +191 -0
- data/lib/aws-sdk-iam/policy.rb +554 -0
- data/lib/aws-sdk-iam/policy_version.rb +176 -0
- data/lib/aws-sdk-iam/resource.rb +1037 -0
- data/lib/aws-sdk-iam/role.rb +310 -0
- data/lib/aws-sdk-iam/role_policy.rb +178 -0
- data/lib/aws-sdk-iam/saml_provider.rb +144 -0
- data/lib/aws-sdk-iam/server_certificate.rb +167 -0
- data/lib/aws-sdk-iam/signing_certificate.rb +185 -0
- data/lib/aws-sdk-iam/types.rb +7486 -0
- data/lib/aws-sdk-iam/user.rb +744 -0
- data/lib/aws-sdk-iam/user_policy.rb +178 -0
- data/lib/aws-sdk-iam/virtual_mfa_device.rb +142 -0
- data/lib/aws-sdk-iam/waiters.rb +98 -0
- metadata +103 -0
@@ -0,0 +1,176 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module IAM
|
10
|
+
class PolicyVersion
|
11
|
+
|
12
|
+
extend Aws::Deprecations
|
13
|
+
|
14
|
+
# @overload def initialize(arn, version_id, options = {})
|
15
|
+
# @param [String] arn
|
16
|
+
# @param [String] version_id
|
17
|
+
# @option options [Client] :client
|
18
|
+
# @overload def initialize(options = {})
|
19
|
+
# @option options [required, String] :arn
|
20
|
+
# @option options [required, String] :version_id
|
21
|
+
# @option options [Client] :client
|
22
|
+
def initialize(*args)
|
23
|
+
options = Hash === args.last ? args.pop.dup : {}
|
24
|
+
@arn = extract_arn(args, options)
|
25
|
+
@version_id = extract_version_id(args, options)
|
26
|
+
@data = options.delete(:data)
|
27
|
+
@client = options.delete(:client) || Client.new(options)
|
28
|
+
end
|
29
|
+
|
30
|
+
# @!group Read-Only Attributes
|
31
|
+
|
32
|
+
# @return [String]
|
33
|
+
def arn
|
34
|
+
@arn
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [String]
|
38
|
+
def version_id
|
39
|
+
@version_id
|
40
|
+
end
|
41
|
+
|
42
|
+
# The policy document.
|
43
|
+
#
|
44
|
+
# The policy document is returned in the response to the
|
45
|
+
# GetPolicyVersion and GetAccountAuthorizationDetails operations. It is
|
46
|
+
# not returned in the response to the CreatePolicyVersion or
|
47
|
+
# ListPolicyVersions operations.
|
48
|
+
# @return [String]
|
49
|
+
def document
|
50
|
+
data.document
|
51
|
+
end
|
52
|
+
|
53
|
+
# Specifies whether the policy version is set as the policy's default
|
54
|
+
# version.
|
55
|
+
# @return [Boolean]
|
56
|
+
def is_default_version
|
57
|
+
data.is_default_version
|
58
|
+
end
|
59
|
+
|
60
|
+
# The date and time, in [ISO 8601 date-time format][1], when the policy
|
61
|
+
# version was created.
|
62
|
+
#
|
63
|
+
#
|
64
|
+
#
|
65
|
+
# [1]: http://www.iso.org/iso/iso8601
|
66
|
+
# @return [Time]
|
67
|
+
def create_date
|
68
|
+
data.create_date
|
69
|
+
end
|
70
|
+
|
71
|
+
# @!endgroup
|
72
|
+
|
73
|
+
# @return [Client]
|
74
|
+
def client
|
75
|
+
@client
|
76
|
+
end
|
77
|
+
|
78
|
+
# Loads, or reloads {#data} for the current {PolicyVersion}.
|
79
|
+
# Returns `self` making it possible to chain methods.
|
80
|
+
#
|
81
|
+
# policy_version.reload.data
|
82
|
+
#
|
83
|
+
# @return [self]
|
84
|
+
def load
|
85
|
+
resp = @client.get_policy_version(
|
86
|
+
policy_arn: @arn,
|
87
|
+
version_id: @version_id
|
88
|
+
)
|
89
|
+
@data = resp.policyversion
|
90
|
+
self
|
91
|
+
end
|
92
|
+
alias :reload :load
|
93
|
+
|
94
|
+
# @return [Types::PolicyVersion]
|
95
|
+
# Returns the data for this {PolicyVersion}. Calls
|
96
|
+
# {Client#get_policy_version} if {#data_loaded?} is `false`.
|
97
|
+
def data
|
98
|
+
load unless @data
|
99
|
+
@data
|
100
|
+
end
|
101
|
+
|
102
|
+
# @return [Boolean]
|
103
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
104
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
105
|
+
def data_loaded?
|
106
|
+
!!@data
|
107
|
+
end
|
108
|
+
|
109
|
+
# @!group Actions
|
110
|
+
|
111
|
+
# @example Request syntax with placeholder values
|
112
|
+
#
|
113
|
+
# policy_version.delete()
|
114
|
+
# @param [Hash] options ({})
|
115
|
+
# @return [EmptyStructure]
|
116
|
+
def delete(options = {})
|
117
|
+
options = options.merge(
|
118
|
+
policy_arn: @arn,
|
119
|
+
version_id: @version_id
|
120
|
+
)
|
121
|
+
resp = @client.delete_policy_version(options)
|
122
|
+
resp.data
|
123
|
+
end
|
124
|
+
|
125
|
+
# @example Request syntax with placeholder values
|
126
|
+
#
|
127
|
+
# policy_version.set_as_default()
|
128
|
+
# @param [Hash] options ({})
|
129
|
+
# @return [EmptyStructure]
|
130
|
+
def set_as_default(options = {})
|
131
|
+
options = options.merge(
|
132
|
+
policy_arn: @arn,
|
133
|
+
version_id: @version_id
|
134
|
+
)
|
135
|
+
resp = @client.set_default_policy_version(options)
|
136
|
+
resp.data
|
137
|
+
end
|
138
|
+
|
139
|
+
# @deprecated
|
140
|
+
# @api private
|
141
|
+
def identifiers
|
142
|
+
{
|
143
|
+
arn: @arn,
|
144
|
+
version_id: @version_id
|
145
|
+
}
|
146
|
+
end
|
147
|
+
deprecated(:identifiers)
|
148
|
+
|
149
|
+
private
|
150
|
+
|
151
|
+
def extract_arn(args, options)
|
152
|
+
value = args[0] || options.delete(:arn)
|
153
|
+
case value
|
154
|
+
when String then value
|
155
|
+
when nil then raise ArgumentError, "missing required option :arn"
|
156
|
+
else
|
157
|
+
msg = "expected :arn to be a String, got #{value.class}"
|
158
|
+
raise ArgumentError, msg
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
def extract_version_id(args, options)
|
163
|
+
value = args[1] || options.delete(:version_id)
|
164
|
+
case value
|
165
|
+
when String then value
|
166
|
+
when nil then raise ArgumentError, "missing required option :version_id"
|
167
|
+
else
|
168
|
+
msg = "expected :version_id to be a String, got #{value.class}"
|
169
|
+
raise ArgumentError, msg
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
class Collection < Aws::Resources::Collection; end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
@@ -0,0 +1,1037 @@
|
|
1
|
+
# WARNING ABOUT GENERATED CODE
|
2
|
+
#
|
3
|
+
# This file is generated. See the contributing for info on making contributions:
|
4
|
+
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
|
+
#
|
6
|
+
# WARNING ABOUT GENERATED CODE
|
7
|
+
|
8
|
+
module Aws
|
9
|
+
module IAM
|
10
|
+
class Resource
|
11
|
+
|
12
|
+
# @param options ({})
|
13
|
+
# @option options [Client] :client
|
14
|
+
def initialize(options = {})
|
15
|
+
@client = options[:client] || Client.new(options)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Client]
|
19
|
+
def client
|
20
|
+
@client
|
21
|
+
end
|
22
|
+
|
23
|
+
# @!group Actions
|
24
|
+
|
25
|
+
# @example Request syntax with placeholder values
|
26
|
+
#
|
27
|
+
# iam.change_password({
|
28
|
+
# old_password: "passwordType", # required
|
29
|
+
# new_password: "passwordType", # required
|
30
|
+
# })
|
31
|
+
# @param [Hash] options ({})
|
32
|
+
# @option options [required, String] :old_password
|
33
|
+
# The IAM user's current password.
|
34
|
+
# @option options [required, String] :new_password
|
35
|
+
# The new password. The new password must conform to the AWS account's
|
36
|
+
# password policy, if one exists.
|
37
|
+
#
|
38
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
39
|
+
# consisting of almost any printable ASCII character from the space
|
40
|
+
# (\\u0020) through the end of the ASCII character range (\\u00FF). You
|
41
|
+
# can also include the tab (\\u0009), line feed (\\u000A), and carriage
|
42
|
+
# return (\\u000D) characters. Although any of these characters are
|
43
|
+
# valid in a password, note that many tools, such as the AWS Management
|
44
|
+
# Console, might restrict the ability to enter certain characters
|
45
|
+
# because they have special meaning within that tool.
|
46
|
+
#
|
47
|
+
#
|
48
|
+
#
|
49
|
+
# [1]: http://wikipedia.org/wiki/regex
|
50
|
+
# @return [EmptyStructure]
|
51
|
+
def change_password(options = {})
|
52
|
+
resp = @client.change_password(options)
|
53
|
+
resp.data
|
54
|
+
end
|
55
|
+
|
56
|
+
# @example Request syntax with placeholder values
|
57
|
+
#
|
58
|
+
# iam.create_account_alias({
|
59
|
+
# account_alias: "accountAliasType", # required
|
60
|
+
# })
|
61
|
+
# @param [Hash] options ({})
|
62
|
+
# @option options [required, String] :account_alias
|
63
|
+
# The account alias to create.
|
64
|
+
#
|
65
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
66
|
+
# consisting of lowercase letters, digits, and dashes. You cannot start
|
67
|
+
# or finish with a dash, nor can you have two dashes in a row.
|
68
|
+
#
|
69
|
+
#
|
70
|
+
#
|
71
|
+
# [1]: http://wikipedia.org/wiki/regex
|
72
|
+
# @return [EmptyStructure]
|
73
|
+
def create_account_alias(options = {})
|
74
|
+
resp = @client.create_account_alias(options)
|
75
|
+
resp.data
|
76
|
+
end
|
77
|
+
|
78
|
+
# @example Request syntax with placeholder values
|
79
|
+
#
|
80
|
+
# accountpasswordpolicy = iam.create_account_password_policy({
|
81
|
+
# minimum_password_length: 1,
|
82
|
+
# require_symbols: false,
|
83
|
+
# require_numbers: false,
|
84
|
+
# require_uppercase_characters: false,
|
85
|
+
# require_lowercase_characters: false,
|
86
|
+
# allow_users_to_change_password: false,
|
87
|
+
# max_password_age: 1,
|
88
|
+
# password_reuse_prevention: 1,
|
89
|
+
# hard_expiry: false,
|
90
|
+
# })
|
91
|
+
# @param [Hash] options ({})
|
92
|
+
# @option options [Integer] :minimum_password_length
|
93
|
+
# The minimum number of characters allowed in an IAM user password.
|
94
|
+
#
|
95
|
+
# Default value: 6
|
96
|
+
# @option options [Boolean] :require_symbols
|
97
|
+
# Specifies whether IAM user passwords must contain at least one of the
|
98
|
+
# following non-alphanumeric characters:
|
99
|
+
#
|
100
|
+
# ! @ # $ % ^ &amp; * ( ) \_ + - = \[ \] \\\{ \\} \| '
|
101
|
+
#
|
102
|
+
# Default value: false
|
103
|
+
# @option options [Boolean] :require_numbers
|
104
|
+
# Specifies whether IAM user passwords must contain at least one numeric
|
105
|
+
# character (0 to 9).
|
106
|
+
#
|
107
|
+
# Default value: false
|
108
|
+
# @option options [Boolean] :require_uppercase_characters
|
109
|
+
# Specifies whether IAM user passwords must contain at least one
|
110
|
+
# uppercase character from the ISO basic Latin alphabet (A to Z).
|
111
|
+
#
|
112
|
+
# Default value: false
|
113
|
+
# @option options [Boolean] :require_lowercase_characters
|
114
|
+
# Specifies whether IAM user passwords must contain at least one
|
115
|
+
# lowercase character from the ISO basic Latin alphabet (a to z).
|
116
|
+
#
|
117
|
+
# Default value: false
|
118
|
+
# @option options [Boolean] :allow_users_to_change_password
|
119
|
+
# Allows all IAM users in your account to use the AWS Management Console
|
120
|
+
# to change their own passwords. For more information, see [Letting IAM
|
121
|
+
# Users Change Their Own Passwords][1] in the *IAM User Guide*.
|
122
|
+
#
|
123
|
+
# Default value: false
|
124
|
+
#
|
125
|
+
#
|
126
|
+
#
|
127
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/HowToPwdIAMUser.html
|
128
|
+
# @option options [Integer] :max_password_age
|
129
|
+
# The number of days that an IAM user password is valid. The default
|
130
|
+
# value of 0 means IAM user passwords never expire.
|
131
|
+
#
|
132
|
+
# Default value: 0
|
133
|
+
# @option options [Integer] :password_reuse_prevention
|
134
|
+
# Specifies the number of previous passwords that IAM users are
|
135
|
+
# prevented from reusing. The default value of 0 means IAM users are not
|
136
|
+
# prevented from reusing previous passwords.
|
137
|
+
#
|
138
|
+
# Default value: 0
|
139
|
+
# @option options [Boolean] :hard_expiry
|
140
|
+
# Prevents IAM users from setting a new password after their password
|
141
|
+
# has expired.
|
142
|
+
#
|
143
|
+
# Default value: false
|
144
|
+
# @return [AccountPasswordPolicy]
|
145
|
+
def create_account_password_policy(options = {})
|
146
|
+
resp = @client.update_account_password_policy(options)
|
147
|
+
AccountPasswordPolicy.new(client: @client)
|
148
|
+
end
|
149
|
+
|
150
|
+
# @example Request syntax with placeholder values
|
151
|
+
#
|
152
|
+
# group = iam.create_group({
|
153
|
+
# path: "pathType",
|
154
|
+
# group_name: "groupNameType", # required
|
155
|
+
# })
|
156
|
+
# @param [Hash] options ({})
|
157
|
+
# @option options [String] :path
|
158
|
+
# The path to the group. For more information about paths, see [IAM
|
159
|
+
# Identifiers][1] in the *IAM User Guide*.
|
160
|
+
#
|
161
|
+
# This parameter is optional. If it is not included, it defaults to a
|
162
|
+
# slash (/).
|
163
|
+
#
|
164
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
165
|
+
# consisting of either a forward slash (/) by itself or a string that
|
166
|
+
# must begin and end with forward slashes, containing any ASCII
|
167
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
168
|
+
# including most punctuation characters, digits, and upper and
|
169
|
+
# lowercased letters.
|
170
|
+
#
|
171
|
+
#
|
172
|
+
#
|
173
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
174
|
+
# [2]: http://wikipedia.org/wiki/regex
|
175
|
+
# @option options [required, String] :group_name
|
176
|
+
# The name of the group to create. Do not include the path in this
|
177
|
+
# value.
|
178
|
+
#
|
179
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
180
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
181
|
+
# spaces. You can also include any of the following characters: =,.@-.
|
182
|
+
# The group name must be unique within the account. Group names are not
|
183
|
+
# distinguished by case. For example, you cannot create groups named
|
184
|
+
# both "ADMINS" and "admins".
|
185
|
+
#
|
186
|
+
#
|
187
|
+
#
|
188
|
+
# [1]: http://wikipedia.org/wiki/regex
|
189
|
+
# @return [Group]
|
190
|
+
def create_group(options = {})
|
191
|
+
resp = @client.create_group(options)
|
192
|
+
Group.new(
|
193
|
+
name: options[:group_name],
|
194
|
+
data: resp.data.group,
|
195
|
+
client: @client
|
196
|
+
)
|
197
|
+
end
|
198
|
+
|
199
|
+
# @example Request syntax with placeholder values
|
200
|
+
#
|
201
|
+
# instanceprofile = iam.create_instance_profile({
|
202
|
+
# instance_profile_name: "instanceProfileNameType", # required
|
203
|
+
# path: "pathType",
|
204
|
+
# })
|
205
|
+
# @param [Hash] options ({})
|
206
|
+
# @option options [required, String] :instance_profile_name
|
207
|
+
# The name of the instance profile to create.
|
208
|
+
#
|
209
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
210
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
211
|
+
# spaces. You can also include any of the following characters: =,.@-
|
212
|
+
#
|
213
|
+
#
|
214
|
+
#
|
215
|
+
# [1]: http://wikipedia.org/wiki/regex
|
216
|
+
# @option options [String] :path
|
217
|
+
# The path to the instance profile. For more information about paths,
|
218
|
+
# see [IAM Identifiers][1] in the *IAM User Guide*.
|
219
|
+
#
|
220
|
+
# This parameter is optional. If it is not included, it defaults to a
|
221
|
+
# slash (/).
|
222
|
+
#
|
223
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
224
|
+
# consisting of either a forward slash (/) by itself or a string that
|
225
|
+
# must begin and end with forward slashes, containing any ASCII
|
226
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
227
|
+
# including most punctuation characters, digits, and upper and
|
228
|
+
# lowercased letters.
|
229
|
+
#
|
230
|
+
#
|
231
|
+
#
|
232
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
233
|
+
# [2]: http://wikipedia.org/wiki/regex
|
234
|
+
# @return [InstanceProfile]
|
235
|
+
def create_instance_profile(options = {})
|
236
|
+
resp = @client.create_instance_profile(options)
|
237
|
+
InstanceProfile.new(
|
238
|
+
name: options[:instance_profile_name],
|
239
|
+
data: resp.data.instance_profile,
|
240
|
+
client: @client
|
241
|
+
)
|
242
|
+
end
|
243
|
+
|
244
|
+
# @example Request syntax with placeholder values
|
245
|
+
#
|
246
|
+
# policy = iam.create_policy({
|
247
|
+
# policy_name: "policyNameType", # required
|
248
|
+
# path: "policyPathType",
|
249
|
+
# policy_document: "policyDocumentType", # required
|
250
|
+
# description: "policyDescriptionType",
|
251
|
+
# })
|
252
|
+
# @param [Hash] options ({})
|
253
|
+
# @option options [required, String] :policy_name
|
254
|
+
# The friendly name of the policy.
|
255
|
+
#
|
256
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
257
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
258
|
+
# spaces. You can also include any of the following characters: =,.@-
|
259
|
+
#
|
260
|
+
#
|
261
|
+
#
|
262
|
+
# [1]: http://wikipedia.org/wiki/regex
|
263
|
+
# @option options [String] :path
|
264
|
+
# The path for the policy.
|
265
|
+
#
|
266
|
+
# For more information about paths, see [IAM Identifiers][1] in the *IAM
|
267
|
+
# User Guide*.
|
268
|
+
#
|
269
|
+
# This parameter is optional. If it is not included, it defaults to a
|
270
|
+
# slash (/).
|
271
|
+
#
|
272
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
273
|
+
# consisting of either a forward slash (/) by itself or a string that
|
274
|
+
# must begin and end with forward slashes, containing any ASCII
|
275
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
276
|
+
# including most punctuation characters, digits, and upper and
|
277
|
+
# lowercased letters.
|
278
|
+
#
|
279
|
+
#
|
280
|
+
#
|
281
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
282
|
+
# [2]: http://wikipedia.org/wiki/regex
|
283
|
+
# @option options [required, String] :policy_document
|
284
|
+
# The JSON policy document that you want to use as the content for the
|
285
|
+
# new policy.
|
286
|
+
#
|
287
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
288
|
+
# consisting of any printable ASCII character ranging from the space
|
289
|
+
# character (\\u0020) through end of the ASCII character range
|
290
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
291
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
292
|
+
#
|
293
|
+
#
|
294
|
+
#
|
295
|
+
# [1]: http://wikipedia.org/wiki/regex
|
296
|
+
# @option options [String] :description
|
297
|
+
# A friendly description of the policy.
|
298
|
+
#
|
299
|
+
# Typically used to store information about the permissions defined in
|
300
|
+
# the policy. For example, "Grants access to production DynamoDB
|
301
|
+
# tables."
|
302
|
+
#
|
303
|
+
# The policy description is immutable. After a value is assigned, it
|
304
|
+
# cannot be changed.
|
305
|
+
# @return [Policy]
|
306
|
+
def create_policy(options = {})
|
307
|
+
resp = @client.create_policy(options)
|
308
|
+
Policy.new(
|
309
|
+
arn: resp.data.policy.arn,
|
310
|
+
client: @client
|
311
|
+
)
|
312
|
+
end
|
313
|
+
|
314
|
+
# @example Request syntax with placeholder values
|
315
|
+
#
|
316
|
+
# role = iam.create_role({
|
317
|
+
# path: "pathType",
|
318
|
+
# role_name: "roleNameType", # required
|
319
|
+
# assume_role_policy_document: "policyDocumentType", # required
|
320
|
+
# })
|
321
|
+
# @param [Hash] options ({})
|
322
|
+
# @option options [String] :path
|
323
|
+
# The path to the role. For more information about paths, see [IAM
|
324
|
+
# Identifiers][1] in the *IAM User Guide*.
|
325
|
+
#
|
326
|
+
# This parameter is optional. If it is not included, it defaults to a
|
327
|
+
# slash (/).
|
328
|
+
#
|
329
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
330
|
+
# consisting of either a forward slash (/) by itself or a string that
|
331
|
+
# must begin and end with forward slashes, containing any ASCII
|
332
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
333
|
+
# including most punctuation characters, digits, and upper and
|
334
|
+
# lowercased letters.
|
335
|
+
#
|
336
|
+
#
|
337
|
+
#
|
338
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
339
|
+
# [2]: http://wikipedia.org/wiki/regex
|
340
|
+
# @option options [required, String] :role_name
|
341
|
+
# The name of the role to create.
|
342
|
+
#
|
343
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
344
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
345
|
+
# spaces. You can also include any of the following characters: =,.@-.
|
346
|
+
# Role names are not distinguished by case. For example, you cannot
|
347
|
+
# create roles named both "PRODROLE" and "prodrole".
|
348
|
+
#
|
349
|
+
#
|
350
|
+
#
|
351
|
+
# [1]: http://wikipedia.org/wiki/regex
|
352
|
+
# @option options [required, String] :assume_role_policy_document
|
353
|
+
# The trust relationship policy document that grants an entity
|
354
|
+
# permission to assume the role.
|
355
|
+
#
|
356
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
357
|
+
# consisting of any printable ASCII character ranging from the space
|
358
|
+
# character (\\u0020) through end of the ASCII character range
|
359
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
360
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
361
|
+
#
|
362
|
+
#
|
363
|
+
#
|
364
|
+
# [1]: http://wikipedia.org/wiki/regex
|
365
|
+
# @return [Role]
|
366
|
+
def create_role(options = {})
|
367
|
+
resp = @client.create_role(options)
|
368
|
+
Role.new(
|
369
|
+
name: options[:role_name],
|
370
|
+
data: resp.data.role,
|
371
|
+
client: @client
|
372
|
+
)
|
373
|
+
end
|
374
|
+
|
375
|
+
# @example Request syntax with placeholder values
|
376
|
+
#
|
377
|
+
# samlprovider = iam.create_saml_provider({
|
378
|
+
# saml_metadata_document: "SAMLMetadataDocumentType", # required
|
379
|
+
# name: "SAMLProviderNameType", # required
|
380
|
+
# })
|
381
|
+
# @param [Hash] options ({})
|
382
|
+
# @option options [required, String] :saml_metadata_document
|
383
|
+
# An XML document generated by an identity provider (IdP) that supports
|
384
|
+
# SAML 2.0. The document includes the issuer's name, expiration
|
385
|
+
# information, and keys that can be used to validate the SAML
|
386
|
+
# authentication response (assertions) that are received from the IdP.
|
387
|
+
# You must generate the metadata document using the identity management
|
388
|
+
# software that is used as your organization's IdP.
|
389
|
+
#
|
390
|
+
# For more information, see [About SAML 2.0-based Federation][1] in the
|
391
|
+
# *IAM User Guide*
|
392
|
+
#
|
393
|
+
#
|
394
|
+
#
|
395
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html
|
396
|
+
# @option options [required, String] :name
|
397
|
+
# The name of the provider to create.
|
398
|
+
#
|
399
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
400
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
401
|
+
# spaces. You can also include any of the following characters: =,.@-
|
402
|
+
#
|
403
|
+
#
|
404
|
+
#
|
405
|
+
# [1]: http://wikipedia.org/wiki/regex
|
406
|
+
# @return [SamlProvider]
|
407
|
+
def create_saml_provider(options = {})
|
408
|
+
resp = @client.create_saml_provider(options)
|
409
|
+
SamlProvider.new(
|
410
|
+
arn: resp.data.saml_provider_arn,
|
411
|
+
client: @client
|
412
|
+
)
|
413
|
+
end
|
414
|
+
|
415
|
+
# @example Request syntax with placeholder values
|
416
|
+
#
|
417
|
+
# servercertificate = iam.create_server_certificate({
|
418
|
+
# path: "pathType",
|
419
|
+
# server_certificate_name: "serverCertificateNameType", # required
|
420
|
+
# certificate_body: "certificateBodyType", # required
|
421
|
+
# private_key: "privateKeyType", # required
|
422
|
+
# certificate_chain: "certificateChainType",
|
423
|
+
# })
|
424
|
+
# @param [Hash] options ({})
|
425
|
+
# @option options [String] :path
|
426
|
+
# The path for the server certificate. For more information about paths,
|
427
|
+
# see [IAM Identifiers][1] in the *IAM User Guide*.
|
428
|
+
#
|
429
|
+
# This parameter is optional. If it is not included, it defaults to a
|
430
|
+
# slash (/). The [regex pattern][2] for this parameter is a string of
|
431
|
+
# characters consisting of either a forward slash (/) by itself or a
|
432
|
+
# string that must begin and end with forward slashes, containing any
|
433
|
+
# ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
|
434
|
+
# including most punctuation characters, digits, and upper and
|
435
|
+
# lowercased letters.
|
436
|
+
#
|
437
|
+
# <note markdown="1"> If you are uploading a server certificate specifically for use with
|
438
|
+
# Amazon CloudFront distributions, you must specify a path using the
|
439
|
+
# `--path` option. The path must begin with `/cloudfront` and must
|
440
|
+
# include a trailing slash (for example, `/cloudfront/test/`).
|
441
|
+
#
|
442
|
+
# </note>
|
443
|
+
#
|
444
|
+
#
|
445
|
+
#
|
446
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
447
|
+
# [2]: http://wikipedia.org/wiki/regex
|
448
|
+
# @option options [required, String] :server_certificate_name
|
449
|
+
# The name for the server certificate. Do not include the path in this
|
450
|
+
# value. The name of the certificate cannot contain any spaces.
|
451
|
+
#
|
452
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
453
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
454
|
+
# spaces. You can also include any of the following characters: =,.@-
|
455
|
+
#
|
456
|
+
#
|
457
|
+
#
|
458
|
+
# [1]: http://wikipedia.org/wiki/regex
|
459
|
+
# @option options [required, String] :certificate_body
|
460
|
+
# The contents of the public key certificate in PEM-encoded format.
|
461
|
+
#
|
462
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
463
|
+
# consisting of any printable ASCII character ranging from the space
|
464
|
+
# character (\\u0020) through end of the ASCII character range
|
465
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
466
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
467
|
+
#
|
468
|
+
#
|
469
|
+
#
|
470
|
+
# [1]: http://wikipedia.org/wiki/regex
|
471
|
+
# @option options [required, String] :private_key
|
472
|
+
# The contents of the private key in PEM-encoded format.
|
473
|
+
#
|
474
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
475
|
+
# consisting of any printable ASCII character ranging from the space
|
476
|
+
# character (\\u0020) through end of the ASCII character range
|
477
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
478
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
479
|
+
#
|
480
|
+
#
|
481
|
+
#
|
482
|
+
# [1]: http://wikipedia.org/wiki/regex
|
483
|
+
# @option options [String] :certificate_chain
|
484
|
+
# The contents of the certificate chain. This is typically a
|
485
|
+
# concatenation of the PEM-encoded public key certificates of the chain.
|
486
|
+
#
|
487
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
488
|
+
# consisting of any printable ASCII character ranging from the space
|
489
|
+
# character (\\u0020) through end of the ASCII character range
|
490
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
491
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
492
|
+
#
|
493
|
+
#
|
494
|
+
#
|
495
|
+
# [1]: http://wikipedia.org/wiki/regex
|
496
|
+
# @return [ServerCertificate]
|
497
|
+
def create_server_certificate(options = {})
|
498
|
+
resp = @client.upload_server_certificate(options)
|
499
|
+
ServerCertificate.new(
|
500
|
+
name: options[:server_certificate_name],
|
501
|
+
client: @client
|
502
|
+
)
|
503
|
+
end
|
504
|
+
|
505
|
+
# @example Request syntax with placeholder values
|
506
|
+
#
|
507
|
+
# signingcertificate = iam.create_signing_certificate({
|
508
|
+
# user_name: "existingUserNameType",
|
509
|
+
# certificate_body: "certificateBodyType", # required
|
510
|
+
# })
|
511
|
+
# @param [Hash] options ({})
|
512
|
+
# @option options [String] :user_name
|
513
|
+
# The name of the user the signing certificate is for.
|
514
|
+
#
|
515
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
516
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
517
|
+
# spaces. You can also include any of the following characters: =,.@-
|
518
|
+
#
|
519
|
+
#
|
520
|
+
#
|
521
|
+
# [1]: http://wikipedia.org/wiki/regex
|
522
|
+
# @option options [required, String] :certificate_body
|
523
|
+
# The contents of the signing certificate.
|
524
|
+
#
|
525
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
526
|
+
# consisting of any printable ASCII character ranging from the space
|
527
|
+
# character (\\u0020) through end of the ASCII character range
|
528
|
+
# (\\u00FF). It also includes the special characters tab (\\u0009), line
|
529
|
+
# feed (\\u000A), and carriage return (\\u000D).
|
530
|
+
#
|
531
|
+
#
|
532
|
+
#
|
533
|
+
# [1]: http://wikipedia.org/wiki/regex
|
534
|
+
# @return [SigningCertificate]
|
535
|
+
def create_signing_certificate(options = {})
|
536
|
+
resp = @client.upload_signing_certificate(options)
|
537
|
+
SigningCertificate.new(
|
538
|
+
id: resp.data.certificate.certificate_id,
|
539
|
+
data: resp.data.certificate,
|
540
|
+
client: @client
|
541
|
+
)
|
542
|
+
end
|
543
|
+
|
544
|
+
# @example Request syntax with placeholder values
|
545
|
+
#
|
546
|
+
# user = iam.create_user({
|
547
|
+
# path: "pathType",
|
548
|
+
# user_name: "userNameType", # required
|
549
|
+
# })
|
550
|
+
# @param [Hash] options ({})
|
551
|
+
# @option options [String] :path
|
552
|
+
# The path for the user name. For more information about paths, see [IAM
|
553
|
+
# Identifiers][1] in the *IAM User Guide*.
|
554
|
+
#
|
555
|
+
# This parameter is optional. If it is not included, it defaults to a
|
556
|
+
# slash (/).
|
557
|
+
#
|
558
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
559
|
+
# consisting of either a forward slash (/) by itself or a string that
|
560
|
+
# must begin and end with forward slashes, containing any ASCII
|
561
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
562
|
+
# including most punctuation characters, digits, and upper and
|
563
|
+
# lowercased letters.
|
564
|
+
#
|
565
|
+
#
|
566
|
+
#
|
567
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
568
|
+
# [2]: http://wikipedia.org/wiki/regex
|
569
|
+
# @option options [required, String] :user_name
|
570
|
+
# The name of the user to create.
|
571
|
+
#
|
572
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
573
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
574
|
+
# spaces. You can also include any of the following characters: =,.@-.
|
575
|
+
# User names are not distinguished by case. For example, you cannot
|
576
|
+
# create users named both "TESTUSER" and "testuser".
|
577
|
+
#
|
578
|
+
#
|
579
|
+
#
|
580
|
+
# [1]: http://wikipedia.org/wiki/regex
|
581
|
+
# @return [User]
|
582
|
+
def create_user(options = {})
|
583
|
+
resp = @client.create_user(options)
|
584
|
+
User.new(
|
585
|
+
name: options[:user_name],
|
586
|
+
data: resp.data.user,
|
587
|
+
client: @client
|
588
|
+
)
|
589
|
+
end
|
590
|
+
|
591
|
+
# @example Request syntax with placeholder values
|
592
|
+
#
|
593
|
+
# virtualmfadevice = iam.create_virtual_mfa_device({
|
594
|
+
# path: "pathType",
|
595
|
+
# virtual_mfa_device_name: "virtualMFADeviceName", # required
|
596
|
+
# })
|
597
|
+
# @param [Hash] options ({})
|
598
|
+
# @option options [String] :path
|
599
|
+
# The path for the virtual MFA device. For more information about paths,
|
600
|
+
# see [IAM Identifiers][1] in the *IAM User Guide*.
|
601
|
+
#
|
602
|
+
# This parameter is optional. If it is not included, it defaults to a
|
603
|
+
# slash (/).
|
604
|
+
#
|
605
|
+
# The [regex pattern][2] for this parameter is a string of characters
|
606
|
+
# consisting of either a forward slash (/) by itself or a string that
|
607
|
+
# must begin and end with forward slashes, containing any ASCII
|
608
|
+
# character from the ! (\\u0021) thru the DEL character (\\u007F),
|
609
|
+
# including most punctuation characters, digits, and upper and
|
610
|
+
# lowercased letters.
|
611
|
+
#
|
612
|
+
#
|
613
|
+
#
|
614
|
+
# [1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html
|
615
|
+
# [2]: http://wikipedia.org/wiki/regex
|
616
|
+
# @option options [required, String] :virtual_mfa_device_name
|
617
|
+
# The name of the virtual MFA device. Use with path to uniquely identify
|
618
|
+
# a virtual MFA device.
|
619
|
+
#
|
620
|
+
# The [regex pattern][1] for this parameter is a string of characters
|
621
|
+
# consisting of upper and lowercase alphanumeric characters with no
|
622
|
+
# spaces. You can also include any of the following characters: =,.@-
|
623
|
+
#
|
624
|
+
#
|
625
|
+
#
|
626
|
+
# [1]: http://wikipedia.org/wiki/regex
|
627
|
+
# @return [VirtualMfaDevice]
|
628
|
+
def create_virtual_mfa_device(options = {})
|
629
|
+
resp = @client.create_virtual_mfa_device(options)
|
630
|
+
VirtualMfaDevice.new(
|
631
|
+
serial_number: resp.data.virtual_mfa_device.serial_number,
|
632
|
+
data: resp.data.virtual_mfa_device,
|
633
|
+
client: @client
|
634
|
+
)
|
635
|
+
end
|
636
|
+
|
637
|
+
# @!group Associations
|
638
|
+
|
639
|
+
# @return [AccountPasswordPolicy]
|
640
|
+
def account_password_policy
|
641
|
+
AccountPasswordPolicy.new(client: @client)
|
642
|
+
end
|
643
|
+
|
644
|
+
# @return [AccountSummary]
|
645
|
+
def account_summary
|
646
|
+
AccountSummary.new(client: @client)
|
647
|
+
end
|
648
|
+
|
649
|
+
# @return [CurrentUser]
|
650
|
+
def current_user
|
651
|
+
CurrentUser.new(client: @client)
|
652
|
+
end
|
653
|
+
|
654
|
+
# @param [String] name
|
655
|
+
# @return [Group]
|
656
|
+
def group(name)
|
657
|
+
Group.new(
|
658
|
+
name: name,
|
659
|
+
client: @client
|
660
|
+
)
|
661
|
+
end
|
662
|
+
|
663
|
+
# @example Request syntax with placeholder values
|
664
|
+
#
|
665
|
+
# groups = iam.groups({
|
666
|
+
# path_prefix: "pathPrefixType",
|
667
|
+
# })
|
668
|
+
# @param [Hash] options ({})
|
669
|
+
# @option options [String] :path_prefix
|
670
|
+
# The path prefix for filtering the results. For example, the prefix
|
671
|
+
# `/division_abc/subdivision_xyz/` gets all groups whose path starts
|
672
|
+
# with `/division_abc/subdivision_xyz/`.
|
673
|
+
#
|
674
|
+
# This parameter is optional. If it is not included, it defaults to a
|
675
|
+
# slash (/), listing all groups. The [regex pattern][1] for this
|
676
|
+
# parameter is a string of characters consisting of either a forward
|
677
|
+
# slash (/) by itself or a string that must begin and end with forward
|
678
|
+
# slashes, containing any ASCII character from the ! (\\u0021) thru the
|
679
|
+
# DEL character (\\u007F), including most punctuation characters,
|
680
|
+
# digits, and upper and lowercased letters.
|
681
|
+
#
|
682
|
+
#
|
683
|
+
#
|
684
|
+
# [1]: http://wikipedia.org/wiki/regex
|
685
|
+
# @return [Group::Collection]
|
686
|
+
def groups(options = {})
|
687
|
+
batches = Enumerator.new do |y|
|
688
|
+
resp = @client.list_groups(options)
|
689
|
+
resp.each_page do |page|
|
690
|
+
batch = []
|
691
|
+
page.data.groups.each do |g|
|
692
|
+
batch << Group.new(
|
693
|
+
name: g.group_name,
|
694
|
+
data: g,
|
695
|
+
client: @client
|
696
|
+
)
|
697
|
+
end
|
698
|
+
y.yield(batch)
|
699
|
+
end
|
700
|
+
end
|
701
|
+
Group::Collection.new(batches)
|
702
|
+
end
|
703
|
+
|
704
|
+
# @param [String] name
|
705
|
+
# @return [InstanceProfile]
|
706
|
+
def instance_profile(name)
|
707
|
+
InstanceProfile.new(
|
708
|
+
name: name,
|
709
|
+
client: @client
|
710
|
+
)
|
711
|
+
end
|
712
|
+
|
713
|
+
# @example Request syntax with placeholder values
|
714
|
+
#
|
715
|
+
# instanceprofiles = iam.instance_profiles({
|
716
|
+
# path_prefix: "pathPrefixType",
|
717
|
+
# })
|
718
|
+
# @param [Hash] options ({})
|
719
|
+
# @option options [String] :path_prefix
|
720
|
+
# The path prefix for filtering the results. For example, the prefix
|
721
|
+
# `/application_abc/component_xyz/` gets all instance profiles whose
|
722
|
+
# path starts with `/application_abc/component_xyz/`.
|
723
|
+
#
|
724
|
+
# This parameter is optional. If it is not included, it defaults to a
|
725
|
+
# slash (/), listing all instance profiles. The [regex pattern][1] for
|
726
|
+
# this parameter is a string of characters consisting of either a
|
727
|
+
# forward slash (/) by itself or a string that must begin and end with
|
728
|
+
# forward slashes, containing any ASCII character from the ! (\\u0021)
|
729
|
+
# thru the DEL character (\\u007F), including most punctuation
|
730
|
+
# characters, digits, and upper and lowercased letters.
|
731
|
+
#
|
732
|
+
#
|
733
|
+
#
|
734
|
+
# [1]: http://wikipedia.org/wiki/regex
|
735
|
+
# @return [InstanceProfile::Collection]
|
736
|
+
def instance_profiles(options = {})
|
737
|
+
batches = Enumerator.new do |y|
|
738
|
+
resp = @client.list_instance_profiles(options)
|
739
|
+
resp.each_page do |page|
|
740
|
+
batch = []
|
741
|
+
page.data.instance_profiles.each do |i|
|
742
|
+
batch << InstanceProfile.new(
|
743
|
+
name: i.instance_profile_name,
|
744
|
+
data: i,
|
745
|
+
client: @client
|
746
|
+
)
|
747
|
+
end
|
748
|
+
y.yield(batch)
|
749
|
+
end
|
750
|
+
end
|
751
|
+
InstanceProfile::Collection.new(batches)
|
752
|
+
end
|
753
|
+
|
754
|
+
# @example Request syntax with placeholder values
|
755
|
+
#
|
756
|
+
# policies = iam.policies({
|
757
|
+
# scope: "All", # accepts All, AWS, Local
|
758
|
+
# only_attached: false,
|
759
|
+
# path_prefix: "policyPathType",
|
760
|
+
# })
|
761
|
+
# @param [Hash] options ({})
|
762
|
+
# @option options [String] :scope
|
763
|
+
# The scope to use for filtering the results.
|
764
|
+
#
|
765
|
+
# To list only AWS managed policies, set `Scope` to `AWS`. To list only
|
766
|
+
# the customer managed policies in your AWS account, set `Scope` to
|
767
|
+
# `Local`.
|
768
|
+
#
|
769
|
+
# This parameter is optional. If it is not included, or if it is set to
|
770
|
+
# `All`, all policies are returned.
|
771
|
+
# @option options [Boolean] :only_attached
|
772
|
+
# A flag to filter the results to only the attached policies.
|
773
|
+
#
|
774
|
+
# When `OnlyAttached` is `true`, the returned list contains only the
|
775
|
+
# policies that are attached to an IAM user, group, or role. When
|
776
|
+
# `OnlyAttached` is `false`, or when the parameter is not included, all
|
777
|
+
# policies are returned.
|
778
|
+
# @option options [String] :path_prefix
|
779
|
+
# The path prefix for filtering the results. This parameter is optional.
|
780
|
+
# If it is not included, it defaults to a slash (/), listing all
|
781
|
+
# policies. The [regex pattern][1] for this parameter is a string of
|
782
|
+
# characters consisting of either a forward slash (/) by itself or a
|
783
|
+
# string that must begin and end with forward slashes, containing any
|
784
|
+
# ASCII character from the ! (\\u0021) thru the DEL character (\\u007F),
|
785
|
+
# including most punctuation characters, digits, and upper and
|
786
|
+
# lowercased letters.
|
787
|
+
#
|
788
|
+
#
|
789
|
+
#
|
790
|
+
# [1]: http://wikipedia.org/wiki/regex
|
791
|
+
# @return [Policy::Collection]
|
792
|
+
def policies(options = {})
|
793
|
+
batches = Enumerator.new do |y|
|
794
|
+
resp = @client.list_policies(options)
|
795
|
+
resp.each_page do |page|
|
796
|
+
batch = []
|
797
|
+
page.data.policies.each do |p|
|
798
|
+
batch << Policy.new(
|
799
|
+
arn: p.arn,
|
800
|
+
data: p,
|
801
|
+
client: @client
|
802
|
+
)
|
803
|
+
end
|
804
|
+
y.yield(batch)
|
805
|
+
end
|
806
|
+
end
|
807
|
+
Policy::Collection.new(batches)
|
808
|
+
end
|
809
|
+
|
810
|
+
# @param [String] arn
|
811
|
+
# @return [Policy]
|
812
|
+
def policy(arn)
|
813
|
+
Policy.new(
|
814
|
+
arn: arn,
|
815
|
+
client: @client
|
816
|
+
)
|
817
|
+
end
|
818
|
+
|
819
|
+
# @param [String] name
|
820
|
+
# @return [Role]
|
821
|
+
def role(name)
|
822
|
+
Role.new(
|
823
|
+
name: name,
|
824
|
+
client: @client
|
825
|
+
)
|
826
|
+
end
|
827
|
+
|
828
|
+
# @example Request syntax with placeholder values
|
829
|
+
#
|
830
|
+
# roles = iam.roles({
|
831
|
+
# path_prefix: "pathPrefixType",
|
832
|
+
# })
|
833
|
+
# @param [Hash] options ({})
|
834
|
+
# @option options [String] :path_prefix
|
835
|
+
# The path prefix for filtering the results. For example, the prefix
|
836
|
+
# `/application_abc/component_xyz/` gets all roles whose path starts
|
837
|
+
# with `/application_abc/component_xyz/`.
|
838
|
+
#
|
839
|
+
# This parameter is optional. If it is not included, it defaults to a
|
840
|
+
# slash (/), listing all roles. The [regex pattern][1] for this
|
841
|
+
# parameter is a string of characters consisting of either a forward
|
842
|
+
# slash (/) by itself or a string that must begin and end with forward
|
843
|
+
# slashes, containing any ASCII character from the ! (\\u0021) thru the
|
844
|
+
# DEL character (\\u007F), including most punctuation characters,
|
845
|
+
# digits, and upper and lowercased letters.
|
846
|
+
#
|
847
|
+
#
|
848
|
+
#
|
849
|
+
# [1]: http://wikipedia.org/wiki/regex
|
850
|
+
# @return [Role::Collection]
|
851
|
+
def roles(options = {})
|
852
|
+
batches = Enumerator.new do |y|
|
853
|
+
resp = @client.list_roles(options)
|
854
|
+
resp.each_page do |page|
|
855
|
+
batch = []
|
856
|
+
page.data.roles.each do |r|
|
857
|
+
batch << Role.new(
|
858
|
+
name: r.role_name,
|
859
|
+
data: r,
|
860
|
+
client: @client
|
861
|
+
)
|
862
|
+
end
|
863
|
+
y.yield(batch)
|
864
|
+
end
|
865
|
+
end
|
866
|
+
Role::Collection.new(batches)
|
867
|
+
end
|
868
|
+
|
869
|
+
# @param [String] arn
|
870
|
+
# @return [SamlProvider]
|
871
|
+
def saml_provider(arn)
|
872
|
+
SamlProvider.new(
|
873
|
+
arn: arn,
|
874
|
+
client: @client
|
875
|
+
)
|
876
|
+
end
|
877
|
+
|
878
|
+
# @example Request syntax with placeholder values
|
879
|
+
#
|
880
|
+
# samlproviders = iam.saml_providers()
|
881
|
+
# @param [Hash] options ({})
|
882
|
+
# @return [SamlProvider::Collection]
|
883
|
+
def saml_providers(options = {})
|
884
|
+
batches = Enumerator.new do |y|
|
885
|
+
batch = []
|
886
|
+
resp = @client.list_saml_providers(options)
|
887
|
+
resp.data.saml_provider_list.each do |s|
|
888
|
+
batch << SamlProvider.new(
|
889
|
+
arn: s.arn,
|
890
|
+
client: @client
|
891
|
+
)
|
892
|
+
end
|
893
|
+
y.yield(batch)
|
894
|
+
end
|
895
|
+
SamlProvider::Collection.new(batches)
|
896
|
+
end
|
897
|
+
|
898
|
+
# @param [String] name
|
899
|
+
# @return [ServerCertificate]
|
900
|
+
def server_certificate(name)
|
901
|
+
ServerCertificate.new(
|
902
|
+
name: name,
|
903
|
+
client: @client
|
904
|
+
)
|
905
|
+
end
|
906
|
+
|
907
|
+
# @example Request syntax with placeholder values
|
908
|
+
#
|
909
|
+
# servercertificates = iam.server_certificates({
|
910
|
+
# path_prefix: "pathPrefixType",
|
911
|
+
# })
|
912
|
+
# @param [Hash] options ({})
|
913
|
+
# @option options [String] :path_prefix
|
914
|
+
# The path prefix for filtering the results. For example:
|
915
|
+
# `/company/servercerts` would get all server certificates for which the
|
916
|
+
# path starts with `/company/servercerts`.
|
917
|
+
#
|
918
|
+
# This parameter is optional. If it is not included, it defaults to a
|
919
|
+
# slash (/), listing all server certificates. The [regex pattern][1] for
|
920
|
+
# this parameter is a string of characters consisting of either a
|
921
|
+
# forward slash (/) by itself or a string that must begin and end with
|
922
|
+
# forward slashes, containing any ASCII character from the ! (\\u0021)
|
923
|
+
# thru the DEL character (\\u007F), including most punctuation
|
924
|
+
# characters, digits, and upper and lowercased letters.
|
925
|
+
#
|
926
|
+
#
|
927
|
+
#
|
928
|
+
# [1]: http://wikipedia.org/wiki/regex
|
929
|
+
# @return [ServerCertificate::Collection]
|
930
|
+
def server_certificates(options = {})
|
931
|
+
batches = Enumerator.new do |y|
|
932
|
+
resp = @client.list_server_certificates(options)
|
933
|
+
resp.each_page do |page|
|
934
|
+
batch = []
|
935
|
+
page.data.server_certificate_metadata_list.each do |s|
|
936
|
+
batch << ServerCertificate.new(
|
937
|
+
name: s.server_certificate_name,
|
938
|
+
client: @client
|
939
|
+
)
|
940
|
+
end
|
941
|
+
y.yield(batch)
|
942
|
+
end
|
943
|
+
end
|
944
|
+
ServerCertificate::Collection.new(batches)
|
945
|
+
end
|
946
|
+
|
947
|
+
# @param [String] name
|
948
|
+
# @return [User]
|
949
|
+
def user(name)
|
950
|
+
User.new(
|
951
|
+
name: name,
|
952
|
+
client: @client
|
953
|
+
)
|
954
|
+
end
|
955
|
+
|
956
|
+
# @example Request syntax with placeholder values
|
957
|
+
#
|
958
|
+
# users = iam.users({
|
959
|
+
# path_prefix: "pathPrefixType",
|
960
|
+
# })
|
961
|
+
# @param [Hash] options ({})
|
962
|
+
# @option options [String] :path_prefix
|
963
|
+
# The path prefix for filtering the results. For example:
|
964
|
+
# `/division_abc/subdivision_xyz/`, which would get all user names whose
|
965
|
+
# path starts with `/division_abc/subdivision_xyz/`.
|
966
|
+
#
|
967
|
+
# This parameter is optional. If it is not included, it defaults to a
|
968
|
+
# slash (/), listing all user names. The [regex pattern][1] for this
|
969
|
+
# parameter is a string of characters consisting of either a forward
|
970
|
+
# slash (/) by itself or a string that must begin and end with forward
|
971
|
+
# slashes, containing any ASCII character from the ! (\\u0021) thru the
|
972
|
+
# DEL character (\\u007F), including most punctuation characters,
|
973
|
+
# digits, and upper and lowercased letters.
|
974
|
+
#
|
975
|
+
#
|
976
|
+
#
|
977
|
+
# [1]: http://wikipedia.org/wiki/regex
|
978
|
+
# @return [User::Collection]
|
979
|
+
def users(options = {})
|
980
|
+
batches = Enumerator.new do |y|
|
981
|
+
resp = @client.list_users(options)
|
982
|
+
resp.each_page do |page|
|
983
|
+
batch = []
|
984
|
+
page.data.users.each do |u|
|
985
|
+
batch << User.new(
|
986
|
+
name: u.user_name,
|
987
|
+
data: u,
|
988
|
+
client: @client
|
989
|
+
)
|
990
|
+
end
|
991
|
+
y.yield(batch)
|
992
|
+
end
|
993
|
+
end
|
994
|
+
User::Collection.new(batches)
|
995
|
+
end
|
996
|
+
|
997
|
+
# @param [String] serial_number
|
998
|
+
# @return [VirtualMfaDevice]
|
999
|
+
def virtual_mfa_device(serial_number)
|
1000
|
+
VirtualMfaDevice.new(
|
1001
|
+
serial_number: serial_number,
|
1002
|
+
client: @client
|
1003
|
+
)
|
1004
|
+
end
|
1005
|
+
|
1006
|
+
# @example Request syntax with placeholder values
|
1007
|
+
#
|
1008
|
+
# virtualmfadevices = iam.virtual_mfa_devices({
|
1009
|
+
# assignment_status: "Assigned", # accepts Assigned, Unassigned, Any
|
1010
|
+
# })
|
1011
|
+
# @param [Hash] options ({})
|
1012
|
+
# @option options [String] :assignment_status
|
1013
|
+
# The status (`Unassigned` or `Assigned`) of the devices to list. If you
|
1014
|
+
# do not specify an `AssignmentStatus`, the action defaults to `Any`
|
1015
|
+
# which lists both assigned and unassigned virtual MFA devices.
|
1016
|
+
# @return [VirtualMfaDevice::Collection]
|
1017
|
+
def virtual_mfa_devices(options = {})
|
1018
|
+
batches = Enumerator.new do |y|
|
1019
|
+
resp = @client.list_virtual_mfa_devices(options)
|
1020
|
+
resp.each_page do |page|
|
1021
|
+
batch = []
|
1022
|
+
page.data.virtual_mfa_devices.each do |v|
|
1023
|
+
batch << VirtualMfaDevice.new(
|
1024
|
+
serial_number: v.serial_number,
|
1025
|
+
data: v,
|
1026
|
+
client: @client
|
1027
|
+
)
|
1028
|
+
end
|
1029
|
+
y.yield(batch)
|
1030
|
+
end
|
1031
|
+
end
|
1032
|
+
VirtualMfaDevice::Collection.new(batches)
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
end
|
1036
|
+
end
|
1037
|
+
end
|