blib/lib/Paws/STS/AssumeRole.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 22 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::STS::AssumeRole;
3 use Moose;
4 has DurationSeconds => (is => 'ro', isa => 'Int');
5 has ExternalId => (is => 'ro', isa => 'Str');
6 has Policy => (is => 'ro', isa => 'Str');
7 has PolicyArns => (is => 'ro', isa => 'ArrayRef[Paws::STS::PolicyDescriptorType]');
8 has RoleArn => (is => 'ro', isa => 'Str', required => 1);
9 has RoleSessionName => (is => 'ro', isa => 'Str', required => 1);
10 has SerialNumber => (is => 'ro', isa => 'Str');
11 has SourceIdentity => (is => 'ro', isa => 'Str');
12 has Tags => (is => 'ro', isa => 'ArrayRef[Paws::STS::Tag]');
13 has TokenCode => (is => 'ro', isa => 'Str');
14 has TransitiveTagKeys => (is => 'ro', isa => 'ArrayRef[Str|Undef]');
15  
16 use MooseX::ClassAttribute;
17  
18 class_has _api_call => (isa => 'Str', is => 'ro', default => 'AssumeRole');
19 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::STS::AssumeRoleResponse');
20 class_has _result_key => (isa => 'Str', is => 'ro', default => 'AssumeRoleResult');
21 1;
22  
23 ### main pod documentation begin ###
24  
25 =head1 NAME
26  
27 Paws::STS::AssumeRole - Arguments for method AssumeRole on L<Paws::STS>
28  
29 =head1 DESCRIPTION
30  
31 This class represents the parameters used for calling the method AssumeRole on the
32 L<AWS Security Token Service|Paws::STS> service. Use the attributes of this class
33 as arguments to method AssumeRole.
34  
35 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to AssumeRole.
36  
37 =head1 SYNOPSIS
38  
39 my $sts = Paws->service('STS');
40 # To assume a role
41 my $AssumeRoleResponse = $sts->AssumeRole(
42 'DurationSeconds' => 3600,
43 'ExternalId' => '123ABC',
44 'Policy' =>
45 '{"Version":"2012-10-17","Statement":[{"Sid":"Stmt1","Effect":"Allow","Action":"s3:*","Resource":"*"}]}',
46 'RoleArn' => 'arn:aws:iam::123456789012:role/demo',
47 'RoleSessionName' => 'Bob'
48 );
49  
50 # Results:
51 my $AssumedRoleUser = $AssumeRoleResponse->AssumedRoleUser;
52 my $Credentials = $AssumeRoleResponse->Credentials;
53 my $PackedPolicySize = $AssumeRoleResponse->PackedPolicySize;
54  
55 # Returns a L<Paws::STS::AssumeRoleResponse> object.
56  
57 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
58 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/sts/AssumeRole>
59  
60 =head1 ATTRIBUTES
61  
62  
63 =head2 DurationSeconds => Int
64  
65 The duration, in seconds, of the role session. The value specified can
66 can range from 900 seconds (15 minutes) up to the maximum session
67 duration that is set for the role. The maximum session duration setting
68 can have a value from 1 hour to 12 hours. If you specify a value higher
69 than this setting or the administrator setting (whichever is lower),
70 the operation fails. For example, if you specify a session duration of
71 12 hours, but your administrator set the maximum session duration to 6
72 hours, your operation fails. To learn how to view the maximum value for
73 your role, see View the Maximum Session Duration Setting for a Role
74 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
75 in the I<IAM User Guide>.
76  
77 By default, the value is set to C<3600> seconds.
78  
79 The C<DurationSeconds> parameter is separate from the duration of a
80 console session that you might request using the returned credentials.
81 The request to the federation endpoint for a console sign-in token
82 takes a C<SessionDuration> parameter that specifies the maximum length
83 of the console session. For more information, see Creating a URL that
84 Enables Federated Users to Access the AWS Management Console
85 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
86 in the I<IAM User Guide>.
87  
88  
89  
90 =head2 ExternalId => Str
91  
92 A unique identifier that might be required when you assume a role in
93 another account. If the administrator of the account to which the role
94 belongs provided you with an external ID, then provide that value in
95 the C<ExternalId> parameter. This value can be any string, such as a
96 passphrase or account number. A cross-account role is usually set up to
97 trust everyone in an account. Therefore, the administrator of the
98 trusting account might send an external ID to the administrator of the
99 trusted account. That way, only someone with the ID can assume the
100 role, rather than everyone in the account. For more information about
101 the external ID, see How to Use an External ID When Granting Access to
102 Your AWS Resources to a Third Party
103 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
104 in the I<IAM User Guide>.
105  
106 The regex used to validate this parameter is a string of characters
107 consisting of upper- and lower-case alphanumeric characters with no
108 spaces. You can also include underscores or any of the following
109 characters: =,.@:/-
110  
111  
112  
113 =head2 Policy => Str
114  
115 An IAM policy in JSON format that you want to use as an inline session
116 policy.
117  
118 This parameter is optional. Passing policies to this operation returns
119 new temporary credentials. The resulting session's permissions are the
120 intersection of the role's identity-based policy and the session
121 policies. You can use the role's temporary credentials in subsequent
122 AWS API calls to access resources in the account that owns the role.
123 You cannot use session policies to grant more permissions than those
124 allowed by the identity-based policy of the role that is being assumed.
125 For more information, see Session Policies
126 (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
127 in the I<IAM User Guide>.
128  
129 The plaintext that you use for both inline and managed session policies
130 can't exceed 2,048 characters. The JSON policy characters can be any
131 ASCII character from the space character to the end of the valid
132 character list (\u0020 through \u00FF). It can also include the tab
133 (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.
134  
135 An AWS conversion compresses the passed session policies and session
136 tags into a packed binary format that has a separate limit. Your
137 request can fail for this limit even if your plaintext meets the other
138 requirements. The C<PackedPolicySize> response element indicates by
139 percentage how close the policies and tags for your request are to the
140 upper size limit.
141  
142  
143  
144 =head2 PolicyArns => ArrayRef[L<Paws::STS::PolicyDescriptorType>]
145  
146 The Amazon Resource Names (ARNs) of the IAM managed policies that you
147 want to use as managed session policies. The policies must exist in the
148 same account as the role.
149  
150 This parameter is optional. You can provide up to 10 managed policy
151 ARNs. However, the plaintext that you use for both inline and managed
152 session policies can't exceed 2,048 characters. For more information
153 about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces
154 (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
155 in the AWS General Reference.
156  
157 An AWS conversion compresses the passed session policies and session
158 tags into a packed binary format that has a separate limit. Your
159 request can fail for this limit even if your plaintext meets the other
160 requirements. The C<PackedPolicySize> response element indicates by
161 percentage how close the policies and tags for your request are to the
162 upper size limit.
163  
164 Passing policies to this operation returns new temporary credentials.
165 The resulting session's permissions are the intersection of the role's
166 identity-based policy and the session policies. You can use the role's
167 temporary credentials in subsequent AWS API calls to access resources
168 in the account that owns the role. You cannot use session policies to
169 grant more permissions than those allowed by the identity-based policy
170 of the role that is being assumed. For more information, see Session
171 Policies
172 (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
173 in the I<IAM User Guide>.
174  
175  
176  
177 =head2 B<REQUIRED> RoleArn => Str
178  
179 The Amazon Resource Name (ARN) of the role to assume.
180  
181  
182  
183 =head2 B<REQUIRED> RoleSessionName => Str
184  
185 An identifier for the assumed role session.
186  
187 Use the role session name to uniquely identify a session when the same
188 role is assumed by different principals or for different reasons. In
189 cross-account scenarios, the role session name is visible to, and can
190 be logged by the account that owns the role. The role session name is
191 also used in the ARN of the assumed role principal. This means that
192 subsequent cross-account API requests that use the temporary security
193 credentials will expose the role session name to the external account
194 in their AWS CloudTrail logs.
195  
196 The regex used to validate this parameter is a string of characters
197 consisting of upper- and lower-case alphanumeric characters with no
198 spaces. You can also include underscores or any of the following
199 characters: =,.@-
200  
201  
202  
203 =head2 SerialNumber => Str
204  
205 The identification number of the MFA device that is associated with the
206 user who is making the C<AssumeRole> call. Specify this value if the
207 trust policy of the role being assumed includes a condition that
208 requires MFA authentication. The value is either the serial number for
209 a hardware device (such as C<GAHT12345678>) or an Amazon Resource Name
210 (ARN) for a virtual device (such as
211 C<arn:aws:iam::123456789012:mfa/user>).
212  
213 The regex used to validate this parameter is a string of characters
214 consisting of upper- and lower-case alphanumeric characters with no
215 spaces. You can also include underscores or any of the following
216 characters: =,.@-
217  
218  
219  
220 =head2 SourceIdentity => Str
221  
222 The source identity specified by the principal that is calling the
223 C<AssumeRole> operation.
224  
225 You can require users to specify a source identity when they assume a
226 role. You do this by using the C<sts:SourceIdentity> condition key in a
227 role trust policy. You can use source identity information in AWS
228 CloudTrail logs to determine who took actions with a role. You can use
229 the C<aws:SourceIdentity> condition key to further control access to
230 AWS resources based on the value of source identity. For more
231 information about using source identity, see Monitor and control
232 actions taken with assumed roles
233 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
234 in the I<IAM User Guide>.
235  
236 The regex used to validate this parameter is a string of characters
237 consisting of upper- and lower-case alphanumeric characters with no
238 spaces. You can also include underscores or any of the following
239 characters: =,.@-. You cannot use a value that begins with the text
240 C<aws:>. This prefix is reserved for AWS internal use.
241  
242  
243  
244 =head2 Tags => ArrayRef[L<Paws::STS::Tag>]
245  
246 A list of session tags that you want to pass. Each session tag consists
247 of a key name and an associated value. For more information about
248 session tags, see Tagging AWS STS Sessions
249 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
250 in the I<IAM User Guide>.
251  
252 This parameter is optional. You can pass up to 50 session tags. The
253 plaintext session tag keys canE<rsquo>t exceed 128 characters, and the
254 values canE<rsquo>t exceed 256 characters. For these and additional
255 limits, see IAM and STS Character Limits
256 (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
257 in the I<IAM User Guide>.
258  
259 An AWS conversion compresses the passed session policies and session
260 tags into a packed binary format that has a separate limit. Your
261 request can fail for this limit even if your plaintext meets the other
262 requirements. The C<PackedPolicySize> response element indicates by
263 percentage how close the policies and tags for your request are to the
264 upper size limit.
265  
266 You can pass a session tag with the same key as a tag that is already
267 attached to the role. When you do, session tags override a role tag
268 with the same key.
269  
270 Tag keyE<ndash>value pairs are not case sensitive, but case is
271 preserved. This means that you cannot have separate C<Department> and
272 C<department> tag keys. Assume that the role has the
273 C<Department>=C<Marketing> tag and you pass the
274 C<department>=C<engineering> session tag. C<Department> and
275 C<department> are not saved as separate tags, and the session tag
276 passed in the request takes precedence over the role tag.
277  
278 Additionally, if you used temporary credentials to perform this
279 operation, the new session inherits any transitive session tags from
280 the calling session. If you pass a session tag with the same key as an
281 inherited tag, the operation fails. To view the inherited tags for a
282 session, see the AWS CloudTrail logs. For more information, see Viewing
283 Session Tags in CloudTrail
284 (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs)
285 in the I<IAM User Guide>.
286  
287  
288  
289 =head2 TokenCode => Str
290  
291 The value provided by the MFA device, if the trust policy of the role
292 being assumed requires MFA. (In other words, if the policy includes a
293 condition that tests for MFA). If the role being assumed requires MFA
294 and if the C<TokenCode> value is missing or expired, the C<AssumeRole>
295 call returns an "access denied" error.
296  
297 The format for this parameter, as described by its regex pattern, is a
298 sequence of six numeric digits.
299  
300  
301  
302 =head2 TransitiveTagKeys => ArrayRef[Str|Undef]
303  
304 A list of keys for session tags that you want to set as transitive. If
305 you set a tag key as transitive, the corresponding key and value passes
306 to subsequent sessions in a role chain. For more information, see
307 Chaining Roles with Session Tags
308 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
309 in the I<IAM User Guide>.
310  
311 This parameter is optional. When you set session tags as transitive,
312 the session policy and session tags packed binary limit is not
313 affected.
314  
315 If you choose not to specify a transitive tag key, then no tags are
316 passed from this session to any subsequent sessions.
317  
318  
319  
320  
321 =head1 SEE ALSO
322  
323 This class forms part of L<Paws>, documenting arguments for method AssumeRole in L<Paws::STS>
324  
325 =head1 BUGS and CONTRIBUTIONS
326  
327 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
328  
329 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
330  
331 =cut
332