aws-sdk-core 3.31.0 → 3.168.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +1573 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -1
- data/lib/aws-defaults/default_configuration.rb +153 -0
- data/lib/aws-defaults/defaults_mode_config_resolver.rb +107 -0
- data/lib/aws-defaults.rb +3 -0
- data/lib/aws-sdk-core/arn.rb +105 -0
- data/lib/aws-sdk-core/arn_parser.rb +40 -0
- data/lib/aws-sdk-core/assume_role_credentials.rb +23 -7
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +108 -0
- data/lib/aws-sdk-core/async_client_stubs.rb +82 -0
- data/lib/aws-sdk-core/binary/decode_handler.rb +11 -1
- data/lib/aws-sdk-core/binary/encode_handler.rb +45 -0
- data/lib/aws-sdk-core/binary/event_builder.rb +124 -0
- data/lib/aws-sdk-core/binary/event_parser.rb +50 -18
- data/lib/aws-sdk-core/binary/event_stream_decoder.rb +7 -2
- data/lib/aws-sdk-core/binary/event_stream_encoder.rb +55 -0
- data/lib/aws-sdk-core/binary.rb +5 -0
- data/lib/aws-sdk-core/client_side_monitoring/publisher.rb +11 -1
- data/lib/aws-sdk-core/client_side_monitoring/request_metrics.rb +71 -9
- data/lib/aws-sdk-core/client_stubs.rb +21 -14
- data/lib/aws-sdk-core/credential_provider.rb +1 -30
- data/lib/aws-sdk-core/credential_provider_chain.rb +107 -43
- data/lib/aws-sdk-core/credentials.rb +2 -0
- data/lib/aws-sdk-core/deprecations.rb +17 -11
- data/lib/aws-sdk-core/eager_loader.rb +2 -0
- data/lib/aws-sdk-core/ec2_metadata.rb +238 -0
- data/lib/aws-sdk-core/ecs_credentials.rb +24 -9
- data/lib/aws-sdk-core/endpoint_cache.rb +193 -0
- data/lib/aws-sdk-core/endpoints/condition.rb +36 -0
- data/lib/aws-sdk-core/endpoints/endpoint.rb +17 -0
- data/lib/aws-sdk-core/endpoints/endpoint_rule.rb +71 -0
- data/lib/aws-sdk-core/endpoints/error_rule.rb +37 -0
- data/lib/aws-sdk-core/endpoints/function.rb +75 -0
- data/lib/aws-sdk-core/endpoints/matchers.rb +127 -0
- data/lib/aws-sdk-core/endpoints/reference.rb +26 -0
- data/lib/aws-sdk-core/endpoints/rule.rb +20 -0
- data/lib/aws-sdk-core/endpoints/rule_set.rb +47 -0
- data/lib/aws-sdk-core/endpoints/rules_provider.rb +32 -0
- data/lib/aws-sdk-core/endpoints/templater.rb +52 -0
- data/lib/aws-sdk-core/endpoints/tree_rule.rb +40 -0
- data/lib/aws-sdk-core/endpoints/url.rb +59 -0
- data/lib/aws-sdk-core/endpoints.rb +74 -0
- data/lib/aws-sdk-core/errors.rb +172 -12
- data/lib/aws-sdk-core/event_emitter.rb +44 -0
- data/lib/aws-sdk-core/ini_parser.rb +2 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +231 -42
- data/lib/aws-sdk-core/json/builder.rb +2 -0
- data/lib/aws-sdk-core/json/error_handler.rb +31 -3
- data/lib/aws-sdk-core/json/handler.rb +21 -1
- data/lib/aws-sdk-core/json/json_engine.rb +12 -8
- data/lib/aws-sdk-core/json/oj_engine.rb +35 -6
- data/lib/aws-sdk-core/json/parser.rb +10 -0
- data/lib/aws-sdk-core/json.rb +11 -28
- data/lib/aws-sdk-core/log/formatter.rb +16 -4
- data/lib/aws-sdk-core/log/handler.rb +2 -0
- data/lib/aws-sdk-core/log/param_filter.rb +38 -13
- data/lib/aws-sdk-core/log/param_formatter.rb +2 -0
- data/lib/aws-sdk-core/pageable_response.rb +118 -47
- data/lib/aws-sdk-core/pager.rb +5 -0
- data/lib/aws-sdk-core/param_converter.rb +2 -0
- data/lib/aws-sdk-core/param_validator.rb +63 -7
- data/lib/aws-sdk-core/plugins/api_key.rb +5 -1
- data/lib/aws-sdk-core/plugins/apig_authorizer_token.rb +2 -0
- data/lib/aws-sdk-core/plugins/apig_credentials_configuration.rb +2 -0
- data/lib/aws-sdk-core/plugins/apig_user_agent.rb +2 -0
- data/lib/aws-sdk-core/plugins/bearer_authorization.rb +67 -0
- data/lib/aws-sdk-core/plugins/checksum_algorithm.rb +340 -0
- data/lib/aws-sdk-core/plugins/client_metrics_plugin.rb +65 -6
- data/lib/aws-sdk-core/plugins/client_metrics_send_plugin.rb +10 -4
- data/lib/aws-sdk-core/plugins/credentials_configuration.rb +50 -7
- data/lib/aws-sdk-core/plugins/defaults_mode.rb +40 -0
- data/lib/aws-sdk-core/plugins/endpoint_discovery.rb +172 -0
- data/lib/aws-sdk-core/plugins/endpoint_pattern.rb +65 -0
- data/lib/aws-sdk-core/plugins/event_stream_configuration.rb +16 -0
- data/lib/aws-sdk-core/plugins/global_configuration.rb +2 -0
- data/lib/aws-sdk-core/plugins/helpful_socket_errors.rb +2 -0
- data/lib/aws-sdk-core/plugins/http_checksum.rb +64 -0
- data/lib/aws-sdk-core/plugins/idempotency_token.rb +2 -0
- data/lib/aws-sdk-core/plugins/invocation_id.rb +35 -0
- data/lib/aws-sdk-core/plugins/jsonvalue_converter.rb +36 -6
- data/lib/aws-sdk-core/plugins/logging.rb +2 -0
- data/lib/aws-sdk-core/plugins/param_converter.rb +2 -0
- data/lib/aws-sdk-core/plugins/param_validator.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/api_gateway.rb +19 -0
- data/lib/aws-sdk-core/plugins/protocols/ec2.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/json_rpc.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/query.rb +2 -0
- data/lib/aws-sdk-core/plugins/protocols/rest_json.rb +18 -1
- data/lib/aws-sdk-core/plugins/protocols/rest_xml.rb +2 -0
- data/lib/aws-sdk-core/plugins/recursion_detection.rb +38 -0
- data/lib/aws-sdk-core/plugins/regional_endpoint.rb +81 -16
- data/lib/aws-sdk-core/plugins/response_paging.rb +3 -1
- data/lib/aws-sdk-core/plugins/retries/client_rate_limiter.rb +139 -0
- data/lib/aws-sdk-core/plugins/retries/clock_skew.rb +100 -0
- data/lib/aws-sdk-core/plugins/retries/error_inspector.rb +147 -0
- data/lib/aws-sdk-core/plugins/retries/retry_quota.rb +59 -0
- data/lib/aws-sdk-core/plugins/retry_errors.rb +312 -92
- data/lib/aws-sdk-core/plugins/sign.rb +200 -0
- data/lib/aws-sdk-core/plugins/signature_v2.rb +3 -0
- data/lib/aws-sdk-core/plugins/signature_v4.rb +42 -32
- data/lib/aws-sdk-core/plugins/stub_responses.rb +28 -7
- data/lib/aws-sdk-core/plugins/transfer_encoding.rb +53 -0
- data/lib/aws-sdk-core/plugins/user_agent.rb +9 -5
- data/lib/aws-sdk-core/process_credentials.rb +20 -15
- data/lib/aws-sdk-core/query/ec2_param_builder.rb +2 -0
- data/lib/aws-sdk-core/query/handler.rb +8 -1
- data/lib/aws-sdk-core/query/param.rb +2 -0
- data/lib/aws-sdk-core/query/param_builder.rb +2 -0
- data/lib/aws-sdk-core/query/param_list.rb +2 -0
- data/lib/aws-sdk-core/query.rb +2 -0
- data/lib/aws-sdk-core/refreshing_credentials.rb +45 -12
- data/lib/aws-sdk-core/refreshing_token.rb +71 -0
- data/lib/aws-sdk-core/resources/collection.rb +3 -1
- data/lib/aws-sdk-core/rest/handler.rb +3 -1
- data/lib/aws-sdk-core/rest/request/body.rb +21 -1
- data/lib/aws-sdk-core/rest/request/builder.rb +2 -0
- data/lib/aws-sdk-core/rest/request/endpoint.rb +10 -3
- data/lib/aws-sdk-core/rest/request/headers.rb +16 -6
- data/lib/aws-sdk-core/rest/request/querystring_builder.rb +4 -2
- data/lib/aws-sdk-core/rest/response/body.rb +2 -0
- data/lib/aws-sdk-core/rest/response/headers.rb +6 -3
- data/lib/aws-sdk-core/rest/response/parser.rb +2 -0
- data/lib/aws-sdk-core/rest/response/status_code.rb +2 -0
- data/lib/aws-sdk-core/rest.rb +2 -0
- data/lib/aws-sdk-core/shared_config.rb +222 -118
- data/lib/aws-sdk-core/shared_credentials.rb +9 -1
- data/lib/aws-sdk-core/sso_credentials.rb +172 -0
- data/lib/aws-sdk-core/sso_token_provider.rb +135 -0
- data/lib/aws-sdk-core/static_token_provider.rb +14 -0
- data/lib/aws-sdk-core/structure.rb +24 -7
- data/lib/aws-sdk-core/stubbing/data_applicator.rb +2 -0
- data/lib/aws-sdk-core/stubbing/empty_stub.rb +2 -0
- data/lib/aws-sdk-core/stubbing/protocols/api_gateway.rb +2 -0
- data/lib/aws-sdk-core/stubbing/protocols/ec2.rb +2 -0
- data/lib/aws-sdk-core/stubbing/protocols/json.rb +3 -1
- data/lib/aws-sdk-core/stubbing/protocols/query.rb +4 -2
- data/lib/aws-sdk-core/stubbing/protocols/rest.rb +52 -7
- data/lib/aws-sdk-core/stubbing/protocols/rest_json.rb +3 -1
- data/lib/aws-sdk-core/stubbing/protocols/rest_xml.rb +2 -2
- data/lib/aws-sdk-core/stubbing/stub_data.rb +15 -4
- data/lib/aws-sdk-core/stubbing/xml_error.rb +2 -0
- data/lib/aws-sdk-core/token.rb +31 -0
- data/lib/aws-sdk-core/token_provider.rb +15 -0
- data/lib/aws-sdk-core/token_provider_chain.rb +51 -0
- data/lib/aws-sdk-core/type_builder.rb +2 -0
- data/lib/aws-sdk-core/util.rb +24 -0
- data/lib/aws-sdk-core/waiters/errors.rb +2 -0
- data/lib/aws-sdk-core/waiters/poller.rb +2 -0
- data/lib/aws-sdk-core/waiters/waiter.rb +4 -2
- data/lib/aws-sdk-core/waiters.rb +2 -0
- data/lib/aws-sdk-core/xml/builder.rb +5 -3
- data/lib/aws-sdk-core/xml/default_list.rb +2 -0
- data/lib/aws-sdk-core/xml/default_map.rb +2 -0
- data/lib/aws-sdk-core/xml/doc_builder.rb +15 -4
- data/lib/aws-sdk-core/xml/error_handler.rb +36 -4
- data/lib/aws-sdk-core/xml/parser/engines/libxml.rb +2 -0
- data/lib/aws-sdk-core/xml/parser/engines/nokogiri.rb +2 -0
- data/lib/aws-sdk-core/xml/parser/engines/oga.rb +2 -0
- data/lib/aws-sdk-core/xml/parser/engines/ox.rb +3 -1
- data/lib/aws-sdk-core/xml/parser/engines/rexml.rb +4 -1
- data/lib/aws-sdk-core/xml/parser/frame.rb +25 -0
- data/lib/aws-sdk-core/xml/parser/parsing_error.rb +2 -0
- data/lib/aws-sdk-core/xml/parser/stack.rb +2 -0
- data/lib/aws-sdk-core/xml/parser.rb +7 -0
- data/lib/aws-sdk-core/xml.rb +2 -0
- data/lib/aws-sdk-core.rb +42 -4
- data/lib/aws-sdk-sso/client.rb +610 -0
- data/lib/aws-sdk-sso/client_api.rb +190 -0
- data/lib/aws-sdk-sso/customizations.rb +1 -0
- data/lib/aws-sdk-sso/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-sso/endpoint_provider.rb +112 -0
- data/lib/aws-sdk-sso/endpoints.rb +71 -0
- data/lib/aws-sdk-sso/errors.rb +102 -0
- data/lib/aws-sdk-sso/plugins/endpoints.rb +76 -0
- data/lib/aws-sdk-sso/resource.rb +26 -0
- data/lib/aws-sdk-sso/types.rb +317 -0
- data/lib/aws-sdk-sso.rb +59 -0
- data/lib/aws-sdk-ssooidc/client.rb +606 -0
- data/lib/aws-sdk-ssooidc/client_api.rb +216 -0
- data/lib/aws-sdk-ssooidc/customizations.rb +1 -0
- data/lib/aws-sdk-ssooidc/endpoint_parameters.rb +66 -0
- data/lib/aws-sdk-ssooidc/endpoint_provider.rb +111 -0
- data/lib/aws-sdk-ssooidc/endpoints.rb +57 -0
- data/lib/aws-sdk-ssooidc/errors.rb +290 -0
- data/lib/aws-sdk-ssooidc/plugins/endpoints.rb +74 -0
- data/lib/aws-sdk-ssooidc/resource.rb +26 -0
- data/lib/aws-sdk-ssooidc/types.rb +502 -0
- data/lib/aws-sdk-ssooidc.rb +59 -0
- data/lib/aws-sdk-sts/client.rb +1426 -616
- data/lib/aws-sdk-sts/client_api.rb +76 -1
- data/lib/aws-sdk-sts/customizations.rb +4 -0
- data/lib/aws-sdk-sts/endpoint_parameters.rb +78 -0
- data/lib/aws-sdk-sts/endpoint_provider.rb +229 -0
- data/lib/aws-sdk-sts/endpoints.rb +135 -0
- data/lib/aws-sdk-sts/errors.rb +153 -1
- data/lib/aws-sdk-sts/plugins/endpoints.rb +84 -0
- data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +38 -0
- data/lib/aws-sdk-sts/presigner.rb +73 -0
- data/lib/aws-sdk-sts/resource.rb +4 -1
- data/lib/aws-sdk-sts/types.rb +918 -296
- data/lib/aws-sdk-sts.rb +20 -6
- data/lib/seahorse/client/async_base.rb +51 -0
- data/lib/seahorse/client/async_response.rb +64 -0
- data/lib/seahorse/client/base.rb +7 -2
- data/lib/seahorse/client/block_io.rb +6 -2
- data/lib/seahorse/client/configuration.rb +17 -3
- data/lib/seahorse/client/events.rb +3 -1
- data/lib/seahorse/client/h2/connection.rb +247 -0
- data/lib/seahorse/client/h2/handler.rb +152 -0
- data/lib/seahorse/client/handler.rb +2 -0
- data/lib/seahorse/client/handler_builder.rb +2 -0
- data/lib/seahorse/client/handler_list.rb +2 -0
- data/lib/seahorse/client/handler_list_entry.rb +6 -4
- data/lib/seahorse/client/http/async_response.rb +44 -0
- data/lib/seahorse/client/http/headers.rb +2 -0
- data/lib/seahorse/client/http/request.rb +5 -3
- data/lib/seahorse/client/http/response.rb +18 -11
- data/lib/seahorse/client/logging/formatter.rb +6 -2
- data/lib/seahorse/client/logging/handler.rb +2 -0
- data/lib/seahorse/client/managed_file.rb +2 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +30 -23
- data/lib/seahorse/client/net_http/handler.rb +24 -7
- data/lib/seahorse/client/net_http/patches.rb +16 -79
- data/lib/seahorse/client/networking_error.rb +30 -0
- data/lib/seahorse/client/plugin.rb +10 -7
- data/lib/seahorse/client/plugin_list.rb +2 -0
- data/lib/seahorse/client/plugins/content_length.rb +14 -3
- data/lib/seahorse/client/plugins/endpoint.rb +4 -2
- data/lib/seahorse/client/plugins/h2.rb +69 -0
- data/lib/seahorse/client/plugins/logging.rb +2 -0
- data/lib/seahorse/client/plugins/net_http.rb +39 -3
- data/lib/seahorse/client/plugins/operation_methods.rb +2 -0
- data/lib/seahorse/client/plugins/raise_response_errors.rb +2 -0
- data/lib/seahorse/client/plugins/request_callback.rb +110 -0
- data/lib/seahorse/client/plugins/response_target.rb +23 -14
- data/lib/seahorse/client/request.rb +2 -0
- data/lib/seahorse/client/request_context.rb +2 -0
- data/lib/seahorse/client/response.rb +5 -5
- data/lib/seahorse/model/api.rb +14 -0
- data/lib/seahorse/model/authorizer.rb +2 -0
- data/lib/seahorse/model/operation.rb +21 -0
- data/lib/seahorse/model/shapes.rb +29 -2
- data/lib/seahorse/util.rb +12 -1
- data/lib/seahorse/version.rb +2 -0
- data/lib/seahorse.rb +12 -0
- metadata +117 -16
data/lib/aws-sdk-sts/client.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# WARNING ABOUT GENERATED CODE
|
2
4
|
#
|
3
5
|
# This file is generated. See the contributing guide for more information:
|
4
|
-
# https://github.com/aws/aws-sdk-ruby/blob/
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
5
7
|
#
|
6
8
|
# WARNING ABOUT GENERATED CODE
|
7
9
|
|
@@ -15,18 +17,38 @@ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
|
|
15
17
|
require 'aws-sdk-core/plugins/retry_errors.rb'
|
16
18
|
require 'aws-sdk-core/plugins/global_configuration.rb'
|
17
19
|
require 'aws-sdk-core/plugins/regional_endpoint.rb'
|
20
|
+
require 'aws-sdk-core/plugins/endpoint_discovery.rb'
|
21
|
+
require 'aws-sdk-core/plugins/endpoint_pattern.rb'
|
18
22
|
require 'aws-sdk-core/plugins/response_paging.rb'
|
19
23
|
require 'aws-sdk-core/plugins/stub_responses.rb'
|
20
24
|
require 'aws-sdk-core/plugins/idempotency_token.rb'
|
21
25
|
require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
|
22
26
|
require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
|
23
27
|
require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
|
24
|
-
require 'aws-sdk-core/plugins/
|
28
|
+
require 'aws-sdk-core/plugins/transfer_encoding.rb'
|
29
|
+
require 'aws-sdk-core/plugins/http_checksum.rb'
|
30
|
+
require 'aws-sdk-core/plugins/checksum_algorithm.rb'
|
31
|
+
require 'aws-sdk-core/plugins/defaults_mode.rb'
|
32
|
+
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
33
|
+
require 'aws-sdk-core/plugins/sign.rb'
|
25
34
|
require 'aws-sdk-core/plugins/protocols/query.rb'
|
35
|
+
require 'aws-sdk-sts/plugins/sts_regional_endpoints.rb'
|
26
36
|
|
27
37
|
Aws::Plugins::GlobalConfiguration.add_identifier(:sts)
|
28
38
|
|
29
39
|
module Aws::STS
|
40
|
+
# An API client for STS. To construct a client, you need to configure a `:region` and `:credentials`.
|
41
|
+
#
|
42
|
+
# client = Aws::STS::Client.new(
|
43
|
+
# region: region_name,
|
44
|
+
# credentials: credentials,
|
45
|
+
# # ...
|
46
|
+
# )
|
47
|
+
#
|
48
|
+
# For details on configuring region and credentials see
|
49
|
+
# the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
|
50
|
+
#
|
51
|
+
# See {#initialize} for a full list of supported configuration options.
|
30
52
|
class Client < Seahorse::Client::Base
|
31
53
|
|
32
54
|
include Aws::ClientStubs
|
@@ -45,130 +67,307 @@ module Aws::STS
|
|
45
67
|
add_plugin(Aws::Plugins::RetryErrors)
|
46
68
|
add_plugin(Aws::Plugins::GlobalConfiguration)
|
47
69
|
add_plugin(Aws::Plugins::RegionalEndpoint)
|
70
|
+
add_plugin(Aws::Plugins::EndpointDiscovery)
|
71
|
+
add_plugin(Aws::Plugins::EndpointPattern)
|
48
72
|
add_plugin(Aws::Plugins::ResponsePaging)
|
49
73
|
add_plugin(Aws::Plugins::StubResponses)
|
50
74
|
add_plugin(Aws::Plugins::IdempotencyToken)
|
51
75
|
add_plugin(Aws::Plugins::JsonvalueConverter)
|
52
76
|
add_plugin(Aws::Plugins::ClientMetricsPlugin)
|
53
77
|
add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
|
54
|
-
add_plugin(Aws::Plugins::
|
78
|
+
add_plugin(Aws::Plugins::TransferEncoding)
|
79
|
+
add_plugin(Aws::Plugins::HttpChecksum)
|
80
|
+
add_plugin(Aws::Plugins::ChecksumAlgorithm)
|
81
|
+
add_plugin(Aws::Plugins::DefaultsMode)
|
82
|
+
add_plugin(Aws::Plugins::RecursionDetection)
|
83
|
+
add_plugin(Aws::Plugins::Sign)
|
55
84
|
add_plugin(Aws::Plugins::Protocols::Query)
|
85
|
+
add_plugin(Aws::STS::Plugins::STSRegionalEndpoints)
|
86
|
+
add_plugin(Aws::STS::Plugins::Endpoints)
|
56
87
|
|
57
|
-
# @
|
58
|
-
#
|
59
|
-
#
|
88
|
+
# @overload initialize(options)
|
89
|
+
# @param [Hash] options
|
90
|
+
# @option options [required, Aws::CredentialProvider] :credentials
|
91
|
+
# Your AWS credentials. This can be an instance of any one of the
|
92
|
+
# following classes:
|
93
|
+
#
|
94
|
+
# * `Aws::Credentials` - Used for configuring static, non-refreshing
|
95
|
+
# credentials.
|
96
|
+
#
|
97
|
+
# * `Aws::SharedCredentials` - Used for loading static credentials from a
|
98
|
+
# shared file, such as `~/.aws/config`.
|
99
|
+
#
|
100
|
+
# * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
|
101
|
+
#
|
102
|
+
# * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
|
103
|
+
# assume a role after providing credentials via the web.
|
104
|
+
#
|
105
|
+
# * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
|
106
|
+
# access token generated from `aws login`.
|
107
|
+
#
|
108
|
+
# * `Aws::ProcessCredentials` - Used for loading credentials from a
|
109
|
+
# process that outputs to stdout.
|
110
|
+
#
|
111
|
+
# * `Aws::InstanceProfileCredentials` - Used for loading credentials
|
112
|
+
# from an EC2 IMDS on an EC2 instance.
|
113
|
+
#
|
114
|
+
# * `Aws::ECSCredentials` - Used for loading credentials from
|
115
|
+
# instances running in ECS.
|
116
|
+
#
|
117
|
+
# * `Aws::CognitoIdentityCredentials` - Used for loading credentials
|
118
|
+
# from the Cognito Identity service.
|
119
|
+
#
|
120
|
+
# When `:credentials` are not configured directly, the following
|
121
|
+
# locations will be searched for credentials:
|
122
|
+
#
|
123
|
+
# * `Aws.config[:credentials]`
|
124
|
+
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
125
|
+
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
126
|
+
# * `~/.aws/credentials`
|
127
|
+
# * `~/.aws/config`
|
128
|
+
# * EC2/ECS IMDS instance profile - When used by default, the timeouts
|
129
|
+
# are very aggressive. Construct and pass an instance of
|
130
|
+
# `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
|
131
|
+
# enable retries and extended timeouts. Instance profile credential
|
132
|
+
# fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED']
|
133
|
+
# to true.
|
134
|
+
#
|
135
|
+
# @option options [required, String] :region
|
136
|
+
# The AWS region to connect to. The configured `:region` is
|
137
|
+
# used to determine the service `:endpoint`. When not passed,
|
138
|
+
# a default `:region` is searched for in the following locations:
|
139
|
+
#
|
140
|
+
# * `Aws.config[:region]`
|
141
|
+
# * `ENV['AWS_REGION']`
|
142
|
+
# * `ENV['AMAZON_REGION']`
|
143
|
+
# * `ENV['AWS_DEFAULT_REGION']`
|
144
|
+
# * `~/.aws/credentials`
|
145
|
+
# * `~/.aws/config`
|
146
|
+
#
|
147
|
+
# @option options [String] :access_key_id
|
148
|
+
#
|
149
|
+
# @option options [Boolean] :active_endpoint_cache (false)
|
150
|
+
# When set to `true`, a thread polling for endpoints will be running in
|
151
|
+
# the background every 60 secs (default). Defaults to `false`.
|
152
|
+
#
|
153
|
+
# @option options [Boolean] :adaptive_retry_wait_to_fill (true)
|
154
|
+
# Used only in `adaptive` retry mode. When true, the request will sleep
|
155
|
+
# until there is sufficent client side capacity to retry the request.
|
156
|
+
# When false, the request will raise a `RetryCapacityNotAvailableError` and will
|
157
|
+
# not retry instead of sleeping.
|
158
|
+
#
|
159
|
+
# @option options [Boolean] :client_side_monitoring (false)
|
160
|
+
# When `true`, client-side metrics will be collected for all API requests from
|
161
|
+
# this client.
|
162
|
+
#
|
163
|
+
# @option options [String] :client_side_monitoring_client_id ("")
|
164
|
+
# Allows you to provide an identifier for this client which will be attached to
|
165
|
+
# all generated client side metrics. Defaults to an empty string.
|
166
|
+
#
|
167
|
+
# @option options [String] :client_side_monitoring_host ("127.0.0.1")
|
168
|
+
# Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
|
169
|
+
# side monitoring agent is running on, where client metrics will be published via UDP.
|
170
|
+
#
|
171
|
+
# @option options [Integer] :client_side_monitoring_port (31000)
|
172
|
+
# Required for publishing client metrics. The port that the client side monitoring
|
173
|
+
# agent is running on, where client metrics will be published via UDP.
|
174
|
+
#
|
175
|
+
# @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
|
176
|
+
# Allows you to provide a custom client-side monitoring publisher class. By default,
|
177
|
+
# will use the Client Side Monitoring Agent Publisher.
|
178
|
+
#
|
179
|
+
# @option options [Boolean] :convert_params (true)
|
180
|
+
# When `true`, an attempt is made to coerce request parameters into
|
181
|
+
# the required types.
|
182
|
+
#
|
183
|
+
# @option options [Boolean] :correct_clock_skew (true)
|
184
|
+
# Used only in `standard` and adaptive retry modes. Specifies whether to apply
|
185
|
+
# a clock skew correction and retry requests with skewed client clocks.
|
186
|
+
#
|
187
|
+
# @option options [String] :defaults_mode ("legacy")
|
188
|
+
# See {Aws::DefaultsModeConfiguration} for a list of the
|
189
|
+
# accepted modes and the configuration defaults that are included.
|
190
|
+
#
|
191
|
+
# @option options [Boolean] :disable_host_prefix_injection (false)
|
192
|
+
# Set to true to disable SDK automatically adding host prefix
|
193
|
+
# to default service endpoint when available.
|
194
|
+
#
|
195
|
+
# @option options [String] :endpoint
|
196
|
+
# The client endpoint is normally constructed from the `:region`
|
197
|
+
# option. You should only configure an `:endpoint` when connecting
|
198
|
+
# to test or custom endpoints. This should be a valid HTTP(S) URI.
|
199
|
+
#
|
200
|
+
# @option options [Integer] :endpoint_cache_max_entries (1000)
|
201
|
+
# Used for the maximum size limit of the LRU cache storing endpoints data
|
202
|
+
# for endpoint discovery enabled operations. Defaults to 1000.
|
203
|
+
#
|
204
|
+
# @option options [Integer] :endpoint_cache_max_threads (10)
|
205
|
+
# Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
|
206
|
+
#
|
207
|
+
# @option options [Integer] :endpoint_cache_poll_interval (60)
|
208
|
+
# When :endpoint_discovery and :active_endpoint_cache is enabled,
|
209
|
+
# Use this option to config the time interval in seconds for making
|
210
|
+
# requests fetching endpoints information. Defaults to 60 sec.
|
211
|
+
#
|
212
|
+
# @option options [Boolean] :endpoint_discovery (false)
|
213
|
+
# When set to `true`, endpoint discovery will be enabled for operations when available.
|
214
|
+
#
|
215
|
+
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
216
|
+
# The log formatter.
|
217
|
+
#
|
218
|
+
# @option options [Symbol] :log_level (:info)
|
219
|
+
# The log level to send messages to the `:logger` at.
|
220
|
+
#
|
221
|
+
# @option options [Logger] :logger
|
222
|
+
# The Logger instance to send log messages to. If this option
|
223
|
+
# is not set, logging will be disabled.
|
224
|
+
#
|
225
|
+
# @option options [Integer] :max_attempts (3)
|
226
|
+
# An integer representing the maximum number attempts that will be made for
|
227
|
+
# a single request, including the initial attempt. For example,
|
228
|
+
# setting this value to 5 will result in a request being retried up to
|
229
|
+
# 4 times. Used in `standard` and `adaptive` retry modes.
|
230
|
+
#
|
231
|
+
# @option options [String] :profile ("default")
|
232
|
+
# Used when loading credentials from the shared credentials file
|
233
|
+
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
234
|
+
#
|
235
|
+
# @option options [Proc] :retry_backoff
|
236
|
+
# A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
|
237
|
+
# This option is only used in the `legacy` retry mode.
|
238
|
+
#
|
239
|
+
# @option options [Float] :retry_base_delay (0.3)
|
240
|
+
# The base delay in seconds used by the default backoff function. This option
|
241
|
+
# is only used in the `legacy` retry mode.
|
242
|
+
#
|
243
|
+
# @option options [Symbol] :retry_jitter (:none)
|
244
|
+
# A delay randomiser function used by the default backoff function.
|
245
|
+
# Some predefined functions can be referenced by name - :none, :equal, :full,
|
246
|
+
# otherwise a Proc that takes and returns a number. This option is only used
|
247
|
+
# in the `legacy` retry mode.
|
248
|
+
#
|
249
|
+
# @see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
250
|
+
#
|
251
|
+
# @option options [Integer] :retry_limit (3)
|
252
|
+
# The maximum number of times to retry failed requests. Only
|
253
|
+
# ~ 500 level server errors and certain ~ 400 level client errors
|
254
|
+
# are retried. Generally, these are throttling errors, data
|
255
|
+
# checksum errors, networking errors, timeout errors, auth errors,
|
256
|
+
# endpoint discovery, and errors from expired credentials.
|
257
|
+
# This option is only used in the `legacy` retry mode.
|
60
258
|
#
|
61
|
-
#
|
62
|
-
#
|
259
|
+
# @option options [Integer] :retry_max_delay (0)
|
260
|
+
# The maximum number of seconds to delay between retries (0 for no limit)
|
261
|
+
# used by the default backoff function. This option is only used in the
|
262
|
+
# `legacy` retry mode.
|
63
263
|
#
|
64
|
-
#
|
65
|
-
#
|
264
|
+
# @option options [String] :retry_mode ("legacy")
|
265
|
+
# Specifies which retry algorithm to use. Values are:
|
66
266
|
#
|
67
|
-
#
|
68
|
-
#
|
267
|
+
# * `legacy` - The pre-existing retry behavior. This is default value if
|
268
|
+
# no retry mode is provided.
|
69
269
|
#
|
70
|
-
#
|
270
|
+
# * `standard` - A standardized set of retry rules across the AWS SDKs.
|
271
|
+
# This includes support for retry quotas, which limit the number of
|
272
|
+
# unsuccessful retries a client can make.
|
71
273
|
#
|
72
|
-
#
|
73
|
-
#
|
274
|
+
# * `adaptive` - An experimental retry mode that includes all the
|
275
|
+
# functionality of `standard` mode along with automatic client side
|
276
|
+
# throttling. This is a provisional mode that may change behavior
|
277
|
+
# in the future.
|
74
278
|
#
|
75
|
-
# * `Aws.config[:credentials]`
|
76
|
-
# * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
|
77
|
-
# * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
|
78
|
-
# * `~/.aws/credentials`
|
79
|
-
# * `~/.aws/config`
|
80
|
-
# * EC2 IMDS instance profile - When used by default, the timeouts are
|
81
|
-
# very aggressive. Construct and pass an instance of
|
82
|
-
# `Aws::InstanceProfileCredentails` to enable retries and extended
|
83
|
-
# timeouts.
|
84
279
|
#
|
85
|
-
#
|
86
|
-
# The AWS region to connect to. The configured `:region` is
|
87
|
-
# used to determine the service `:endpoint`. When not passed,
|
88
|
-
# a default `:region` is search for in the following locations:
|
280
|
+
# @option options [String] :secret_access_key
|
89
281
|
#
|
90
|
-
#
|
91
|
-
# * `ENV['AWS_REGION']`
|
92
|
-
# * `ENV['AMAZON_REGION']`
|
93
|
-
# * `ENV['AWS_DEFAULT_REGION']`
|
94
|
-
# * `~/.aws/credentials`
|
95
|
-
# * `~/.aws/config`
|
282
|
+
# @option options [String] :session_token
|
96
283
|
#
|
97
|
-
#
|
284
|
+
# @option options [String] :sts_regional_endpoints ("regional")
|
285
|
+
# Passing in 'regional' to enable regional endpoint for STS for all supported
|
286
|
+
# regions (except 'aws-global'). Using 'legacy' mode will force all legacy
|
287
|
+
# regions to resolve to the STS global endpoint.
|
98
288
|
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
289
|
+
# @option options [Boolean] :stub_responses (false)
|
290
|
+
# Causes the client to return stubbed responses. By default
|
291
|
+
# fake responses are generated and returned. You can specify
|
292
|
+
# the response data to return or errors to raise by calling
|
293
|
+
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
102
294
|
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
# all generated client side metrics. Defaults to an empty string.
|
295
|
+
# ** Please note ** When response stubbing is enabled, no HTTP
|
296
|
+
# requests are made, and retries are disabled.
|
106
297
|
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
298
|
+
# @option options [Aws::TokenProvider] :token_provider
|
299
|
+
# A Bearer Token Provider. This can be an instance of any one of the
|
300
|
+
# following classes:
|
110
301
|
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
# will use the Client Side Monitoring Agent Publisher.
|
302
|
+
# * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
|
303
|
+
# tokens.
|
114
304
|
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
# the required types.
|
305
|
+
# * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
|
306
|
+
# access token generated from `aws login`.
|
118
307
|
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
# option. You should only configure an `:endpoint` when connecting
|
122
|
-
# to test endpoints. This should be avalid HTTP(S) URI.
|
308
|
+
# When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
|
309
|
+
# will be used to search for tokens configured for your profile in shared configuration files.
|
123
310
|
#
|
124
|
-
#
|
125
|
-
#
|
311
|
+
# @option options [Boolean] :use_dualstack_endpoint
|
312
|
+
# When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
|
313
|
+
# will be used if available.
|
126
314
|
#
|
127
|
-
#
|
128
|
-
#
|
315
|
+
# @option options [Boolean] :use_fips_endpoint
|
316
|
+
# When set to `true`, fips compatible endpoints will be used if available.
|
317
|
+
# When a `fips` region is used, the region is normalized and this config
|
318
|
+
# is set to `true`.
|
129
319
|
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
320
|
+
# @option options [Boolean] :validate_params (true)
|
321
|
+
# When `true`, request parameters are validated before
|
322
|
+
# sending the request.
|
133
323
|
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
324
|
+
# @option options [Aws::STS::EndpointProvider] :endpoint_provider
|
325
|
+
# The endpoint provider used to resolve endpoints. Any object that responds to `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::STS::EndpointParameters`
|
137
326
|
#
|
138
|
-
#
|
139
|
-
#
|
327
|
+
# @option options [URI::HTTP,String] :http_proxy A proxy to send
|
328
|
+
# requests through. Formatted like 'http://proxy.com:123'.
|
140
329
|
#
|
141
|
-
#
|
142
|
-
#
|
330
|
+
# @option options [Float] :http_open_timeout (15) The number of
|
331
|
+
# seconds to wait when opening a HTTP session before raising a
|
332
|
+
# `Timeout::Error`.
|
143
333
|
#
|
144
|
-
# @
|
334
|
+
# @option options [Float] :http_read_timeout (60) The default
|
335
|
+
# number of seconds to wait for response data. This value can
|
336
|
+
# safely be set per-request on the session.
|
145
337
|
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
# checksum errors, networking errors, timeout errors and auth
|
151
|
-
# errors from expired credentials.
|
338
|
+
# @option options [Float] :http_idle_timeout (5) The number of
|
339
|
+
# seconds a connection is allowed to sit idle before it is
|
340
|
+
# considered stale. Stale connections are closed and removed
|
341
|
+
# from the pool before making a request.
|
152
342
|
#
|
153
|
-
#
|
154
|
-
#
|
343
|
+
# @option options [Float] :http_continue_timeout (1) The number of
|
344
|
+
# seconds to wait for a 100-continue response before sending the
|
345
|
+
# request body. This option has no effect unless the request has
|
346
|
+
# "Expect" header set to "100-continue". Defaults to `nil` which
|
347
|
+
# disables this behaviour. This value can safely be set per
|
348
|
+
# request on the session.
|
155
349
|
#
|
156
|
-
#
|
350
|
+
# @option options [Float] :ssl_timeout (nil) Sets the SSL timeout
|
351
|
+
# in seconds.
|
157
352
|
#
|
158
|
-
#
|
353
|
+
# @option options [Boolean] :http_wire_trace (false) When `true`,
|
354
|
+
# HTTP debug output will be sent to the `:logger`.
|
159
355
|
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
# the response data to return or errors to raise by calling
|
164
|
-
# {ClientStubs#stub_responses}. See {ClientStubs} for more information.
|
356
|
+
# @option options [Boolean] :ssl_verify_peer (true) When `true`,
|
357
|
+
# SSL peer certificates are verified when establishing a
|
358
|
+
# connection.
|
165
359
|
#
|
166
|
-
#
|
167
|
-
#
|
360
|
+
# @option options [String] :ssl_ca_bundle Full path to the SSL
|
361
|
+
# certificate authority bundle file that should be used when
|
362
|
+
# verifying peer certificates. If you do not pass
|
363
|
+
# `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
|
364
|
+
# will be used if available.
|
168
365
|
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
366
|
+
# @option options [String] :ssl_ca_directory Full path of the
|
367
|
+
# directory that contains the unbundled SSL certificate
|
368
|
+
# authority files for verifying peer certificates. If you do
|
369
|
+
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
|
370
|
+
# system default will be used if available.
|
172
371
|
#
|
173
372
|
def initialize(*args)
|
174
373
|
super
|
@@ -176,126 +375,118 @@ module Aws::STS
|
|
176
375
|
|
177
376
|
# @!group API Operations
|
178
377
|
|
179
|
-
# Returns a set of temporary security credentials
|
180
|
-
# access
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
378
|
+
# Returns a set of temporary security credentials that you can use to
|
379
|
+
# access Amazon Web Services resources that you might not normally have
|
380
|
+
# access to. These temporary credentials consist of an access key ID, a
|
381
|
+
# secret access key, and a security token. Typically, you use
|
382
|
+
# `AssumeRole` within your account or for cross-account access. For a
|
383
|
+
# comparison of `AssumeRole` with other API operations that produce
|
384
|
+
# temporary credentials, see [Requesting Temporary Security
|
385
|
+
# Credentials][1] and [Comparing the Amazon Web Services STS API
|
386
|
+
# operations][2] in the *IAM User Guide*.
|
187
387
|
#
|
188
|
-
# **
|
189
|
-
# credentials; access is denied. You must use credentials for an IAM
|
190
|
-
# user or an IAM role to call `AssumeRole`.
|
191
|
-
#
|
192
|
-
# For cross-account access, imagine that you own multiple accounts and
|
193
|
-
# need to access resources in each account. You could create long-term
|
194
|
-
# credentials in each account to access those resources. However,
|
195
|
-
# managing all those credentials and remembering which one can access
|
196
|
-
# which account can be time consuming. Instead, you can create one set
|
197
|
-
# of long-term credentials in one account and then use temporary
|
198
|
-
# security credentials to access all the other accounts by assuming
|
199
|
-
# roles in those accounts. For more information about roles, see [IAM
|
200
|
-
# Roles (Delegation and Federation)][3] in the *IAM User Guide*.
|
201
|
-
#
|
202
|
-
# For federation, you can, for example, grant single sign-on access to
|
203
|
-
# the AWS Management Console. If you already have an identity and
|
204
|
-
# authentication system in your corporate network, you don't have to
|
205
|
-
# recreate user identities in AWS in order to grant those user
|
206
|
-
# identities access to AWS. Instead, after a user has been
|
207
|
-
# authenticated, you call `AssumeRole` (and specify the role with the
|
208
|
-
# appropriate permissions) to get temporary security credentials for
|
209
|
-
# that user. With those temporary security credentials, you construct a
|
210
|
-
# sign-in URL that users can use to access the console. For more
|
211
|
-
# information, see [Common Scenarios for Temporary Credentials][4] in
|
212
|
-
# the *IAM User Guide*.
|
213
|
-
#
|
214
|
-
# By default, the temporary security credentials created by `AssumeRole`
|
215
|
-
# last for one hour. However, you can use the optional `DurationSeconds`
|
216
|
-
# parameter to specify the duration of your session. You can provide a
|
217
|
-
# value from 900 seconds (15 minutes) up to the maximum session duration
|
218
|
-
# setting for the role. This setting can have a value from 1 hour to 12
|
219
|
-
# hours. To learn how to view the maximum value for your role, see [View
|
220
|
-
# the Maximum Session Duration Setting for a Role][5] in the *IAM User
|
221
|
-
# Guide*. The maximum session duration limit applies when you use the
|
222
|
-
# `AssumeRole*` API operations or the `assume-role*` CLI operations but
|
223
|
-
# does not apply when you use those operations to create a console URL.
|
224
|
-
# For more information, see [Using IAM Roles][6] in the *IAM User
|
225
|
-
# Guide*.
|
388
|
+
# **Permissions**
|
226
389
|
#
|
227
390
|
# The temporary security credentials created by `AssumeRole` can be used
|
228
|
-
# to make API calls to any
|
229
|
-
# cannot call the
|
230
|
-
# `GetSessionToken`
|
231
|
-
#
|
232
|
-
#
|
233
|
-
#
|
234
|
-
#
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
238
|
-
#
|
239
|
-
#
|
240
|
-
#
|
241
|
-
# credentials
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
391
|
+
# to make API calls to any Amazon Web Services service with the
|
392
|
+
# following exception: You cannot call the Amazon Web Services STS
|
393
|
+
# `GetFederationToken` or `GetSessionToken` API operations.
|
394
|
+
#
|
395
|
+
# (Optional) You can pass inline or managed [session policies][3] to
|
396
|
+
# this operation. You can pass a single JSON policy document to use as
|
397
|
+
# an inline session policy. You can also specify up to 10 managed policy
|
398
|
+
# Amazon Resource Names (ARNs) to use as managed session policies. The
|
399
|
+
# plaintext that you use for both inline and managed session policies
|
400
|
+
# can't exceed 2,048 characters. Passing policies to this operation
|
401
|
+
# returns new temporary credentials. The resulting session's
|
402
|
+
# permissions are the intersection of the role's identity-based policy
|
403
|
+
# and the session policies. You can use the role's temporary
|
404
|
+
# credentials in subsequent Amazon Web Services API calls to access
|
405
|
+
# resources in the account that owns the role. You cannot use session
|
406
|
+
# policies to grant more permissions than those allowed by the
|
407
|
+
# identity-based policy of the role that is being assumed. For more
|
408
|
+
# information, see [Session Policies][3] in the *IAM User Guide*.
|
409
|
+
#
|
410
|
+
# When you create a role, you create two policies: A role trust policy
|
411
|
+
# that specifies *who* can assume the role and a permissions policy that
|
412
|
+
# specifies *what* can be done with the role. You specify the trusted
|
413
|
+
# principal who is allowed to assume the role in the role trust policy.
|
414
|
+
#
|
415
|
+
# To assume a role from a different account, your Amazon Web Services
|
416
|
+
# account must be trusted by the role. The trust relationship is defined
|
417
|
+
# in the role's trust policy when the role is created. That trust
|
418
|
+
# policy states which accounts are allowed to delegate that access to
|
419
|
+
# users in the account.
|
420
|
+
#
|
421
|
+
# A user who wants to access a role in a different account must also
|
422
|
+
# have permissions that are delegated from the user account
|
423
|
+
# administrator. The administrator must attach a policy that allows the
|
424
|
+
# user to call `AssumeRole` for the ARN of the role in the other
|
425
|
+
# account.
|
426
|
+
#
|
427
|
+
# To allow a user to assume a role in the same account, you can do
|
428
|
+
# either of the following:
|
429
|
+
#
|
430
|
+
# * Attach a policy to the user that allows the user to call
|
431
|
+
# `AssumeRole` (as long as the role's trust policy trusts the
|
432
|
+
# account).
|
433
|
+
#
|
434
|
+
# * Add the user as a principal directly in the role's trust policy.
|
435
|
+
#
|
436
|
+
# You can do either because the role’s trust policy acts as an IAM
|
437
|
+
# resource-based policy. When a resource-based policy grants access to a
|
438
|
+
# principal in the same account, no additional identity-based policy is
|
439
|
+
# required. For more information about trust policies and resource-based
|
440
|
+
# policies, see [IAM Policies][4] in the *IAM User Guide*.
|
441
|
+
#
|
442
|
+
# **Tags**
|
443
|
+
#
|
444
|
+
# (Optional) You can pass tag key-value pairs to your session. These
|
445
|
+
# tags are called session tags. For more information about session tags,
|
446
|
+
# see [Passing Session Tags in STS][5] in the *IAM User Guide*.
|
447
|
+
#
|
448
|
+
# An administrator must grant you the permissions necessary to pass
|
449
|
+
# session tags. The administrator can also create granular permissions
|
450
|
+
# to allow you to pass only specific session tags. For more information,
|
451
|
+
# see [Tutorial: Using Tags for Attribute-Based Access Control][6] in
|
245
452
|
# the *IAM User Guide*.
|
246
453
|
#
|
247
|
-
#
|
248
|
-
#
|
249
|
-
#
|
250
|
-
# to delegate access to this account's role.
|
251
|
-
#
|
252
|
-
# The user who wants to access the role must also have permissions
|
253
|
-
# delegated from the role's administrator. If the user is in a
|
254
|
-
# different account than the role, then the user's administrator must
|
255
|
-
# attach a policy that allows the user to call AssumeRole on the ARN of
|
256
|
-
# the role in the other account. If the user is in the same account as
|
257
|
-
# the role, then you can either attach a policy to the user (identical
|
258
|
-
# to the previous different account user), or you can add the user as a
|
259
|
-
# principal directly in the role's trust policy. In this case, the
|
260
|
-
# trust policy acts as the only resource-based policy in IAM, and users
|
261
|
-
# in the same account as the role do not need explicit permission to
|
262
|
-
# assume the role. For more information about trust policies and
|
263
|
-
# resource-based policies, see [IAM Policies][8] in the *IAM User
|
264
|
-
# Guide*.
|
454
|
+
# You can set the session tags as transitive. Transitive tags persist
|
455
|
+
# during role chaining. For more information, see [Chaining Roles with
|
456
|
+
# Session Tags][7] in the *IAM User Guide*.
|
265
457
|
#
|
266
458
|
# **Using MFA with AssumeRole**
|
267
459
|
#
|
268
|
-
# You can
|
460
|
+
# (Optional) You can include multi-factor authentication (MFA)
|
269
461
|
# information when you call `AssumeRole`. This is useful for
|
270
|
-
# cross-account scenarios
|
271
|
-
#
|
272
|
-
#
|
273
|
-
#
|
274
|
-
#
|
275
|
-
#
|
462
|
+
# cross-account scenarios to ensure that the user that assumes the role
|
463
|
+
# has been authenticated with an Amazon Web Services MFA device. In that
|
464
|
+
# scenario, the trust policy of the role being assumed includes a
|
465
|
+
# condition that tests for MFA authentication. If the caller does not
|
466
|
+
# include valid MFA information, the request to assume the role is
|
467
|
+
# denied. The condition in a trust policy that tests for MFA
|
276
468
|
# authentication might look like the following example.
|
277
469
|
#
|
278
470
|
# `"Condition": \{"Bool": \{"aws:MultiFactorAuthPresent": true\}\}`
|
279
471
|
#
|
280
|
-
# For more information, see [Configuring MFA-Protected API Access][
|
472
|
+
# For more information, see [Configuring MFA-Protected API Access][8] in
|
281
473
|
# the *IAM User Guide* guide.
|
282
474
|
#
|
283
475
|
# To use MFA with `AssumeRole`, you pass values for the `SerialNumber`
|
284
476
|
# and `TokenCode` parameters. The `SerialNumber` value identifies the
|
285
477
|
# user's hardware or virtual MFA device. The `TokenCode` is the
|
286
|
-
# time-based one-time password (TOTP) that the MFA
|
478
|
+
# time-based one-time password (TOTP) that the MFA device produces.
|
287
479
|
#
|
288
480
|
#
|
289
481
|
#
|
290
|
-
# [1]:
|
291
|
-
# [2]:
|
292
|
-
# [3]:
|
293
|
-
# [4]:
|
294
|
-
# [5]:
|
295
|
-
# [6]:
|
296
|
-
# [7]:
|
297
|
-
# [8]:
|
298
|
-
# [9]: http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html
|
482
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
483
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
|
484
|
+
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
485
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
|
486
|
+
# [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
487
|
+
# [6]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
488
|
+
# [7]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
489
|
+
# [8]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html
|
299
490
|
#
|
300
491
|
# @option params [required, String] :role_arn
|
301
492
|
# The Amazon Resource Name (ARN) of the role to assume.
|
@@ -308,7 +499,7 @@ module Aws::STS
|
|
308
499
|
# cross-account scenarios, the role session name is visible to, and can
|
309
500
|
# be logged by the account that owns the role. The role session name is
|
310
501
|
# also used in the ARN of the assumed role principal. This means that
|
311
|
-
# subsequent cross-account API requests
|
502
|
+
# subsequent cross-account API requests that use the temporary security
|
312
503
|
# credentials will expose the role session name to the external account
|
313
504
|
# in their CloudTrail logs.
|
314
505
|
#
|
@@ -317,87 +508,197 @@ module Aws::STS
|
|
317
508
|
# spaces. You can also include underscores or any of the following
|
318
509
|
# characters: =,.@-
|
319
510
|
#
|
320
|
-
# @option params [
|
321
|
-
#
|
322
|
-
#
|
323
|
-
#
|
324
|
-
# security credentials that are returned by the operation have the
|
325
|
-
# permissions that are allowed by both (the intersection of) the access
|
326
|
-
# policy of the role that is being assumed, *and* the policy that you
|
327
|
-
# pass. This gives you a way to further restrict the permissions for the
|
328
|
-
# resulting temporary security credentials. You cannot use the passed
|
329
|
-
# policy to grant permissions that are in excess of those allowed by the
|
330
|
-
# access policy of the role that is being assumed. For more information,
|
331
|
-
# see [Permissions for AssumeRole, AssumeRoleWithSAML, and
|
332
|
-
# AssumeRoleWithWebIdentity][1] in the *IAM User Guide*.
|
511
|
+
# @option params [Array<Types::PolicyDescriptorType>] :policy_arns
|
512
|
+
# The Amazon Resource Names (ARNs) of the IAM managed policies that you
|
513
|
+
# want to use as managed session policies. The policies must exist in
|
514
|
+
# the same account as the role.
|
333
515
|
#
|
334
|
-
#
|
335
|
-
#
|
516
|
+
# This parameter is optional. You can provide up to 10 managed policy
|
517
|
+
# ARNs. However, the plaintext that you use for both inline and managed
|
518
|
+
# session policies can't exceed 2,048 characters. For more information
|
519
|
+
# about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services
|
520
|
+
# Service Namespaces][1] in the Amazon Web Services General Reference.
|
521
|
+
#
|
522
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
523
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
524
|
+
# format that has a separate limit. Your request can fail for this limit
|
525
|
+
# even if your plaintext meets the other requirements. The
|
526
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
527
|
+
# the policies and tags for your request are to the upper size limit.
|
528
|
+
#
|
529
|
+
# </note>
|
530
|
+
#
|
531
|
+
# Passing policies to this operation returns new temporary credentials.
|
532
|
+
# The resulting session's permissions are the intersection of the
|
533
|
+
# role's identity-based policy and the session policies. You can use
|
534
|
+
# the role's temporary credentials in subsequent Amazon Web Services
|
535
|
+
# API calls to access resources in the account that owns the role. You
|
536
|
+
# cannot use session policies to grant more permissions than those
|
537
|
+
# allowed by the identity-based policy of the role that is being
|
538
|
+
# assumed. For more information, see [Session Policies][2] in the *IAM
|
539
|
+
# User Guide*.
|
540
|
+
#
|
541
|
+
#
|
542
|
+
#
|
543
|
+
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
544
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
545
|
+
#
|
546
|
+
# @option params [String] :policy
|
547
|
+
# An IAM policy in JSON format that you want to use as an inline session
|
548
|
+
# policy.
|
549
|
+
#
|
550
|
+
# This parameter is optional. Passing policies to this operation returns
|
551
|
+
# new temporary credentials. The resulting session's permissions are
|
552
|
+
# the intersection of the role's identity-based policy and the session
|
553
|
+
# policies. You can use the role's temporary credentials in subsequent
|
554
|
+
# Amazon Web Services API calls to access resources in the account that
|
555
|
+
# owns the role. You cannot use session policies to grant more
|
556
|
+
# permissions than those allowed by the identity-based policy of the
|
557
|
+
# role that is being assumed. For more information, see [Session
|
558
|
+
# Policies][1] in the *IAM User Guide*.
|
559
|
+
#
|
560
|
+
# The plaintext that you use for both inline and managed session
|
561
|
+
# policies can't exceed 2,048 characters. The JSON policy characters
|
336
562
|
# can be any ASCII character from the space character to the end of the
|
337
|
-
# valid character list (\\u0020
|
338
|
-
# (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
563
|
+
# valid character list (\\u0020 through \\u00FF). It can also include
|
564
|
+
# the tab (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
339
565
|
# characters.
|
340
566
|
#
|
341
|
-
# <note markdown="1">
|
342
|
-
#
|
343
|
-
# separate limit.
|
344
|
-
#
|
345
|
-
#
|
567
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
568
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
569
|
+
# format that has a separate limit. Your request can fail for this limit
|
570
|
+
# even if your plaintext meets the other requirements. The
|
571
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
572
|
+
# the policies and tags for your request are to the upper size limit.
|
346
573
|
#
|
347
574
|
# </note>
|
348
575
|
#
|
349
576
|
#
|
350
577
|
#
|
351
|
-
# [1]:
|
578
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
352
579
|
#
|
353
580
|
# @option params [Integer] :duration_seconds
|
354
|
-
# The duration, in seconds, of the role session. The value can
|
355
|
-
# from 900 seconds (15 minutes) up to the maximum session duration
|
356
|
-
#
|
357
|
-
# hours. If you specify a value higher than this
|
358
|
-
#
|
359
|
-
#
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
581
|
+
# The duration, in seconds, of the role session. The value specified can
|
582
|
+
# range from 900 seconds (15 minutes) up to the maximum session duration
|
583
|
+
# set for the role. The maximum session duration setting can have a
|
584
|
+
# value from 1 hour to 12 hours. If you specify a value higher than this
|
585
|
+
# setting or the administrator setting (whichever is lower), the
|
586
|
+
# operation fails. For example, if you specify a session duration of 12
|
587
|
+
# hours, but your administrator set the maximum session duration to 6
|
588
|
+
# hours, your operation fails.
|
589
|
+
#
|
590
|
+
# Role chaining limits your Amazon Web Services CLI or Amazon Web
|
591
|
+
# Services API role session to a maximum of one hour. When you use the
|
592
|
+
# `AssumeRole` API operation to assume a role, you can specify the
|
593
|
+
# duration of your role session with the `DurationSeconds` parameter.
|
594
|
+
# You can specify a parameter value of up to 43200 seconds (12 hours),
|
595
|
+
# depending on the maximum session duration setting for your role.
|
596
|
+
# However, if you assume a role using role chaining and provide a
|
597
|
+
# `DurationSeconds` parameter value greater than one hour, the operation
|
598
|
+
# fails. To learn how to view the maximum value for your role, see [View
|
599
|
+
# the Maximum Session Duration Setting for a Role][1] in the *IAM User
|
600
|
+
# Guide*.
|
363
601
|
#
|
364
|
-
# By default, the value is set to 3600 seconds.
|
602
|
+
# By default, the value is set to `3600` seconds.
|
365
603
|
#
|
366
604
|
# <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
|
367
605
|
# console session that you might request using the returned credentials.
|
368
606
|
# The request to the federation endpoint for a console sign-in token
|
369
607
|
# takes a `SessionDuration` parameter that specifies the maximum length
|
370
608
|
# of the console session. For more information, see [Creating a URL that
|
371
|
-
# Enables Federated Users to Access the
|
372
|
-
# the *IAM User Guide*.
|
609
|
+
# Enables Federated Users to Access the Amazon Web Services Management
|
610
|
+
# Console][2] in the *IAM User Guide*.
|
611
|
+
#
|
612
|
+
# </note>
|
613
|
+
#
|
614
|
+
#
|
615
|
+
#
|
616
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
617
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
618
|
+
#
|
619
|
+
# @option params [Array<Types::Tag>] :tags
|
620
|
+
# A list of session tags that you want to pass. Each session tag
|
621
|
+
# consists of a key name and an associated value. For more information
|
622
|
+
# about session tags, see [Tagging Amazon Web Services STS Sessions][1]
|
623
|
+
# in the *IAM User Guide*.
|
624
|
+
#
|
625
|
+
# This parameter is optional. You can pass up to 50 session tags. The
|
626
|
+
# plaintext session tag keys can’t exceed 128 characters, and the values
|
627
|
+
# can’t exceed 256 characters. For these and additional limits, see [IAM
|
628
|
+
# and STS Character Limits][2] in the *IAM User Guide*.
|
629
|
+
#
|
630
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
631
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
632
|
+
# format that has a separate limit. Your request can fail for this limit
|
633
|
+
# even if your plaintext meets the other requirements. The
|
634
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
635
|
+
# the policies and tags for your request are to the upper size limit.
|
373
636
|
#
|
374
637
|
# </note>
|
375
638
|
#
|
639
|
+
# You can pass a session tag with the same key as a tag that is already
|
640
|
+
# attached to the role. When you do, session tags override a role tag
|
641
|
+
# with the same key.
|
642
|
+
#
|
643
|
+
# Tag key–value pairs are not case sensitive, but case is preserved.
|
644
|
+
# This means that you cannot have separate `Department` and `department`
|
645
|
+
# tag keys. Assume that the role has the `Department`=`Marketing` tag
|
646
|
+
# and you pass the `department`=`engineering` session tag. `Department`
|
647
|
+
# and `department` are not saved as separate tags, and the session tag
|
648
|
+
# passed in the request takes precedence over the role tag.
|
649
|
+
#
|
650
|
+
# Additionally, if you used temporary credentials to perform this
|
651
|
+
# operation, the new session inherits any transitive session tags from
|
652
|
+
# the calling session. If you pass a session tag with the same key as an
|
653
|
+
# inherited tag, the operation fails. To view the inherited tags for a
|
654
|
+
# session, see the CloudTrail logs. For more information, see [Viewing
|
655
|
+
# Session Tags in CloudTrail][3] in the *IAM User Guide*.
|
656
|
+
#
|
657
|
+
#
|
376
658
|
#
|
659
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
660
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
661
|
+
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs
|
377
662
|
#
|
378
|
-
#
|
379
|
-
#
|
663
|
+
# @option params [Array<String>] :transitive_tag_keys
|
664
|
+
# A list of keys for session tags that you want to set as transitive. If
|
665
|
+
# you set a tag key as transitive, the corresponding key and value
|
666
|
+
# passes to subsequent sessions in a role chain. For more information,
|
667
|
+
# see [Chaining Roles with Session Tags][1] in the *IAM User Guide*.
|
668
|
+
#
|
669
|
+
# This parameter is optional. When you set session tags as transitive,
|
670
|
+
# the session policy and session tags packed binary limit is not
|
671
|
+
# affected.
|
672
|
+
#
|
673
|
+
# If you choose not to specify a transitive tag key, then no tags are
|
674
|
+
# passed from this session to any subsequent sessions.
|
675
|
+
#
|
676
|
+
#
|
677
|
+
#
|
678
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
380
679
|
#
|
381
680
|
# @option params [String] :external_id
|
382
|
-
# A unique identifier that
|
383
|
-
#
|
384
|
-
#
|
385
|
-
#
|
386
|
-
#
|
387
|
-
#
|
388
|
-
#
|
389
|
-
#
|
390
|
-
#
|
391
|
-
#
|
681
|
+
# A unique identifier that might be required when you assume a role in
|
682
|
+
# another account. If the administrator of the account to which the role
|
683
|
+
# belongs provided you with an external ID, then provide that value in
|
684
|
+
# the `ExternalId` parameter. This value can be any string, such as a
|
685
|
+
# passphrase or account number. A cross-account role is usually set up
|
686
|
+
# to trust everyone in an account. Therefore, the administrator of the
|
687
|
+
# trusting account might send an external ID to the administrator of the
|
688
|
+
# trusted account. That way, only someone with the ID can assume the
|
689
|
+
# role, rather than everyone in the account. For more information about
|
690
|
+
# the external ID, see [How to Use an External ID When Granting Access
|
691
|
+
# to Your Amazon Web Services Resources to a Third Party][1] in the *IAM
|
692
|
+
# User Guide*.
|
392
693
|
#
|
393
|
-
# The regex used to
|
694
|
+
# The regex used to validate this parameter is a string of characters
|
394
695
|
# consisting of upper- and lower-case alphanumeric characters with no
|
395
696
|
# spaces. You can also include underscores or any of the following
|
396
697
|
# characters: =,.@:/-
|
397
698
|
#
|
398
699
|
#
|
399
700
|
#
|
400
|
-
# [1]:
|
701
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
|
401
702
|
#
|
402
703
|
# @option params [String] :serial_number
|
403
704
|
# The identification number of the MFA device that is associated with
|
@@ -415,7 +716,7 @@ module Aws::STS
|
|
415
716
|
#
|
416
717
|
# @option params [String] :token_code
|
417
718
|
# The value provided by the MFA device, if the trust policy of the role
|
418
|
-
# being assumed requires MFA (
|
719
|
+
# being assumed requires MFA. (In other words, if the policy includes a
|
419
720
|
# condition that tests for MFA). If the role being assumed requires MFA
|
420
721
|
# and if the `TokenCode` value is missing or expired, the `AssumeRole`
|
421
722
|
# call returns an "access denied" error.
|
@@ -423,21 +724,62 @@ module Aws::STS
|
|
423
724
|
# The format for this parameter, as described by its regex pattern, is a
|
424
725
|
# sequence of six numeric digits.
|
425
726
|
#
|
727
|
+
# @option params [String] :source_identity
|
728
|
+
# The source identity specified by the principal that is calling the
|
729
|
+
# `AssumeRole` operation.
|
730
|
+
#
|
731
|
+
# You can require users to specify a source identity when they assume a
|
732
|
+
# role. You do this by using the `sts:SourceIdentity` condition key in a
|
733
|
+
# role trust policy. You can use source identity information in
|
734
|
+
# CloudTrail logs to determine who took actions with a role. You can use
|
735
|
+
# the `aws:SourceIdentity` condition key to further control access to
|
736
|
+
# Amazon Web Services resources based on the value of source identity.
|
737
|
+
# For more information about using source identity, see [Monitor and
|
738
|
+
# control actions taken with assumed roles][1] in the *IAM User Guide*.
|
739
|
+
#
|
740
|
+
# The regex used to validate this parameter is a string of characters
|
741
|
+
# consisting of upper- and lower-case alphanumeric characters with no
|
742
|
+
# spaces. You can also include underscores or any of the following
|
743
|
+
# characters: =,.@-. You cannot use a value that begins with the text
|
744
|
+
# `aws:`. This prefix is reserved for Amazon Web Services internal use.
|
745
|
+
#
|
746
|
+
#
|
747
|
+
#
|
748
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
749
|
+
#
|
426
750
|
# @return [Types::AssumeRoleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
427
751
|
#
|
428
752
|
# * {Types::AssumeRoleResponse#credentials #credentials} => Types::Credentials
|
429
753
|
# * {Types::AssumeRoleResponse#assumed_role_user #assumed_role_user} => Types::AssumedRoleUser
|
430
754
|
# * {Types::AssumeRoleResponse#packed_policy_size #packed_policy_size} => Integer
|
755
|
+
# * {Types::AssumeRoleResponse#source_identity #source_identity} => String
|
431
756
|
#
|
432
757
|
#
|
433
758
|
# @example Example: To assume a role
|
434
759
|
#
|
435
760
|
# resp = client.assume_role({
|
436
|
-
# duration_seconds: 3600,
|
437
761
|
# external_id: "123ABC",
|
438
|
-
# policy: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3
|
762
|
+
# policy: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}",
|
439
763
|
# role_arn: "arn:aws:iam::123456789012:role/demo",
|
440
|
-
# role_session_name: "
|
764
|
+
# role_session_name: "testAssumeRoleSession",
|
765
|
+
# tags: [
|
766
|
+
# {
|
767
|
+
# key: "Project",
|
768
|
+
# value: "Unicorn",
|
769
|
+
# },
|
770
|
+
# {
|
771
|
+
# key: "Team",
|
772
|
+
# value: "Automation",
|
773
|
+
# },
|
774
|
+
# {
|
775
|
+
# key: "Cost-Center",
|
776
|
+
# value: "12345",
|
777
|
+
# },
|
778
|
+
# ],
|
779
|
+
# transitive_tag_keys: [
|
780
|
+
# "Project",
|
781
|
+
# "Cost-Center",
|
782
|
+
# ],
|
441
783
|
# })
|
442
784
|
#
|
443
785
|
# resp.to_h outputs the following:
|
@@ -452,7 +794,7 @@ module Aws::STS
|
|
452
794
|
# secret_access_key: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
|
453
795
|
# session_token: "AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==",
|
454
796
|
# },
|
455
|
-
# packed_policy_size:
|
797
|
+
# packed_policy_size: 8,
|
456
798
|
# }
|
457
799
|
#
|
458
800
|
# @example Request syntax with placeholder values
|
@@ -460,11 +802,24 @@ module Aws::STS
|
|
460
802
|
# resp = client.assume_role({
|
461
803
|
# role_arn: "arnType", # required
|
462
804
|
# role_session_name: "roleSessionNameType", # required
|
805
|
+
# policy_arns: [
|
806
|
+
# {
|
807
|
+
# arn: "arnType",
|
808
|
+
# },
|
809
|
+
# ],
|
463
810
|
# policy: "sessionPolicyDocumentType",
|
464
811
|
# duration_seconds: 1,
|
812
|
+
# tags: [
|
813
|
+
# {
|
814
|
+
# key: "tagKeyType", # required
|
815
|
+
# value: "tagValueType", # required
|
816
|
+
# },
|
817
|
+
# ],
|
818
|
+
# transitive_tag_keys: ["tagKeyType"],
|
465
819
|
# external_id: "externalIdType",
|
466
820
|
# serial_number: "serialNumberType",
|
467
821
|
# token_code: "tokenCodeType",
|
822
|
+
# source_identity: "sourceIdentityType",
|
468
823
|
# })
|
469
824
|
#
|
470
825
|
# @example Response structure
|
@@ -476,6 +831,7 @@ module Aws::STS
|
|
476
831
|
# resp.assumed_role_user.assumed_role_id #=> String
|
477
832
|
# resp.assumed_role_user.arn #=> String
|
478
833
|
# resp.packed_policy_size #=> Integer
|
834
|
+
# resp.source_identity #=> String
|
479
835
|
#
|
480
836
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole AWS API Documentation
|
481
837
|
#
|
@@ -489,16 +845,19 @@ module Aws::STS
|
|
489
845
|
# Returns a set of temporary security credentials for users who have
|
490
846
|
# been authenticated via a SAML authentication response. This operation
|
491
847
|
# provides a mechanism for tying an enterprise identity store or
|
492
|
-
# directory to role-based
|
493
|
-
# or configuration. For a comparison of
|
494
|
-
#
|
495
|
-
#
|
496
|
-
#
|
848
|
+
# directory to role-based Amazon Web Services access without
|
849
|
+
# user-specific credentials or configuration. For a comparison of
|
850
|
+
# `AssumeRoleWithSAML` with the other API operations that produce
|
851
|
+
# temporary credentials, see [Requesting Temporary Security
|
852
|
+
# Credentials][1] and [Comparing the Amazon Web Services STS API
|
853
|
+
# operations][2] in the *IAM User Guide*.
|
497
854
|
#
|
498
855
|
# The temporary security credentials returned by this operation consist
|
499
856
|
# of an access key ID, a secret access key, and a security token.
|
500
857
|
# Applications can use these temporary security credentials to sign
|
501
|
-
# calls to
|
858
|
+
# calls to Amazon Web Services services.
|
859
|
+
#
|
860
|
+
# **Session Duration**
|
502
861
|
#
|
503
862
|
# By default, the temporary security credentials created by
|
504
863
|
# `AssumeRoleWithSAML` last for one hour. However, you can use the
|
@@ -512,72 +871,128 @@ module Aws::STS
|
|
512
871
|
# for your role, see [View the Maximum Session Duration Setting for a
|
513
872
|
# Role][3] in the *IAM User Guide*. The maximum session duration limit
|
514
873
|
# applies when you use the `AssumeRole*` API operations or the
|
515
|
-
# `assume-role*` CLI
|
516
|
-
# operations to create a console URL. For more information,
|
517
|
-
# IAM Roles][4] in the *IAM User Guide*.
|
874
|
+
# `assume-role*` CLI commands. However the limit does not apply when you
|
875
|
+
# use those operations to create a console URL. For more information,
|
876
|
+
# see [Using IAM Roles][4] in the *IAM User Guide*.
|
877
|
+
#
|
878
|
+
# <note markdown="1"> [Role chaining][5] limits your CLI or Amazon Web Services API role
|
879
|
+
# session to a maximum of one hour. When you use the `AssumeRole` API
|
880
|
+
# operation to assume a role, you can specify the duration of your role
|
881
|
+
# session with the `DurationSeconds` parameter. You can specify a
|
882
|
+
# parameter value of up to 43200 seconds (12 hours), depending on the
|
883
|
+
# maximum session duration setting for your role. However, if you assume
|
884
|
+
# a role using role chaining and provide a `DurationSeconds` parameter
|
885
|
+
# value greater than one hour, the operation fails.
|
886
|
+
#
|
887
|
+
# </note>
|
888
|
+
#
|
889
|
+
# **Permissions**
|
518
890
|
#
|
519
891
|
# The temporary security credentials created by `AssumeRoleWithSAML` can
|
520
|
-
# be used to make API calls to any
|
521
|
-
# exception: you cannot call the STS
|
522
|
-
# `GetSessionToken`
|
523
|
-
#
|
524
|
-
#
|
525
|
-
#
|
526
|
-
#
|
527
|
-
#
|
528
|
-
#
|
529
|
-
#
|
530
|
-
#
|
531
|
-
#
|
532
|
-
#
|
533
|
-
#
|
534
|
-
#
|
535
|
-
#
|
536
|
-
#
|
537
|
-
# information, see [
|
538
|
-
#
|
892
|
+
# be used to make API calls to any Amazon Web Services service with the
|
893
|
+
# following exception: you cannot call the STS `GetFederationToken` or
|
894
|
+
# `GetSessionToken` API operations.
|
895
|
+
#
|
896
|
+
# (Optional) You can pass inline or managed [session policies][6] to
|
897
|
+
# this operation. You can pass a single JSON policy document to use as
|
898
|
+
# an inline session policy. You can also specify up to 10 managed policy
|
899
|
+
# Amazon Resource Names (ARNs) to use as managed session policies. The
|
900
|
+
# plaintext that you use for both inline and managed session policies
|
901
|
+
# can't exceed 2,048 characters. Passing policies to this operation
|
902
|
+
# returns new temporary credentials. The resulting session's
|
903
|
+
# permissions are the intersection of the role's identity-based policy
|
904
|
+
# and the session policies. You can use the role's temporary
|
905
|
+
# credentials in subsequent Amazon Web Services API calls to access
|
906
|
+
# resources in the account that owns the role. You cannot use session
|
907
|
+
# policies to grant more permissions than those allowed by the
|
908
|
+
# identity-based policy of the role that is being assumed. For more
|
909
|
+
# information, see [Session Policies][6] in the *IAM User Guide*.
|
910
|
+
#
|
911
|
+
# Calling `AssumeRoleWithSAML` does not require the use of Amazon Web
|
912
|
+
# Services security credentials. The identity of the caller is validated
|
913
|
+
# by using keys in the metadata document that is uploaded for the SAML
|
914
|
+
# provider entity for your identity provider.
|
915
|
+
#
|
916
|
+
# Calling `AssumeRoleWithSAML` can result in an entry in your CloudTrail
|
917
|
+
# logs. The entry includes the value in the `NameID` element of the SAML
|
918
|
+
# assertion. We recommend that you use a `NameIDType` that is not
|
919
|
+
# associated with any personally identifiable information (PII). For
|
920
|
+
# example, you could instead use the persistent identifier
|
921
|
+
# (`urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`).
|
922
|
+
#
|
923
|
+
# **Tags**
|
924
|
+
#
|
925
|
+
# (Optional) You can configure your IdP to pass attributes into your
|
926
|
+
# SAML assertion as session tags. Each session tag consists of a key
|
927
|
+
# name and an associated value. For more information about session tags,
|
928
|
+
# see [Passing Session Tags in STS][7] in the *IAM User Guide*.
|
929
|
+
#
|
930
|
+
# You can pass up to 50 session tags. The plaintext session tag keys
|
931
|
+
# can’t exceed 128 characters and the values can’t exceed 256
|
932
|
+
# characters. For these and additional limits, see [IAM and STS
|
933
|
+
# Character Limits][8] in the *IAM User Guide*.
|
934
|
+
#
|
935
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
936
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
937
|
+
# format that has a separate limit. Your request can fail for this limit
|
938
|
+
# even if your plaintext meets the other requirements. The
|
939
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
940
|
+
# the policies and tags for your request are to the upper size limit.
|
941
|
+
#
|
942
|
+
# </note>
|
943
|
+
#
|
944
|
+
# You can pass a session tag with the same key as a tag that is attached
|
945
|
+
# to the role. When you do, session tags override the role's tags with
|
946
|
+
# the same key.
|
947
|
+
#
|
948
|
+
# An administrator must grant you the permissions necessary to pass
|
949
|
+
# session tags. The administrator can also create granular permissions
|
950
|
+
# to allow you to pass only specific session tags. For more information,
|
951
|
+
# see [Tutorial: Using Tags for Attribute-Based Access Control][9] in
|
952
|
+
# the *IAM User Guide*.
|
953
|
+
#
|
954
|
+
# You can set the session tags as transitive. Transitive tags persist
|
955
|
+
# during role chaining. For more information, see [Chaining Roles with
|
956
|
+
# Session Tags][10] in the *IAM User Guide*.
|
957
|
+
#
|
958
|
+
# **SAML Configuration**
|
539
959
|
#
|
540
960
|
# Before your application can call `AssumeRoleWithSAML`, you must
|
541
961
|
# configure your SAML identity provider (IdP) to issue the claims
|
542
|
-
# required by
|
543
|
-
# Management (IAM) to create a SAML provider entity in your
|
544
|
-
# that represents your identity provider
|
545
|
-
# specifies this SAML provider in
|
546
|
-
#
|
547
|
-
# Calling `AssumeRoleWithSAML` does not require the use of AWS security
|
548
|
-
# credentials. The identity of the caller is validated by using keys in
|
549
|
-
# the metadata document that is uploaded for the SAML provider entity
|
550
|
-
# for your identity provider.
|
551
|
-
#
|
552
|
-
# Calling `AssumeRoleWithSAML` can result in an entry in your AWS
|
553
|
-
# CloudTrail logs. The entry includes the value in the `NameID` element
|
554
|
-
# of the SAML assertion. We recommend that you use a NameIDType that is
|
555
|
-
# not associated with any personally identifiable information (PII). For
|
556
|
-
# example, you could instead use the Persistent Identifier
|
557
|
-
# (`urn:oasis:names:tc:SAML:2.0:nameid-format:persistent`).
|
962
|
+
# required by Amazon Web Services. Additionally, you must use Identity
|
963
|
+
# and Access Management (IAM) to create a SAML provider entity in your
|
964
|
+
# Amazon Web Services account that represents your identity provider.
|
965
|
+
# You must also create an IAM role that specifies this SAML provider in
|
966
|
+
# its trust policy.
|
558
967
|
#
|
559
968
|
# For more information, see the following resources:
|
560
969
|
#
|
561
|
-
# * [About SAML 2.0-based Federation][
|
970
|
+
# * [About SAML 2.0-based Federation][11] in the *IAM User Guide*.
|
562
971
|
#
|
563
|
-
# * [Creating SAML Identity Providers][
|
972
|
+
# * [Creating SAML Identity Providers][12] in the *IAM User Guide*.
|
564
973
|
#
|
565
|
-
# * [Configuring a Relying Party and Claims][
|
974
|
+
# * [Configuring a Relying Party and Claims][13] in the *IAM User
|
975
|
+
# Guide*.
|
566
976
|
#
|
567
|
-
# * [Creating a Role for SAML 2.0 Federation][
|
977
|
+
# * [Creating a Role for SAML 2.0 Federation][14] in the *IAM User
|
568
978
|
# Guide*.
|
569
979
|
#
|
570
980
|
#
|
571
981
|
#
|
572
|
-
# [1]:
|
573
|
-
# [2]:
|
574
|
-
# [3]:
|
575
|
-
# [4]:
|
576
|
-
# [5]:
|
577
|
-
# [6]:
|
578
|
-
# [7]:
|
579
|
-
# [8]:
|
580
|
-
# [9]:
|
982
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
983
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
|
984
|
+
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
985
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
|
986
|
+
# [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining
|
987
|
+
# [6]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
988
|
+
# [7]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
989
|
+
# [8]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
990
|
+
# [9]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
991
|
+
# [10]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
992
|
+
# [11]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html
|
993
|
+
# [12]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html
|
994
|
+
# [13]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html
|
995
|
+
# [14]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html
|
581
996
|
#
|
582
997
|
# @option params [required, String] :role_arn
|
583
998
|
# The Amazon Resource Name (ARN) of the role that the caller is
|
@@ -588,47 +1003,83 @@ module Aws::STS
|
|
588
1003
|
# describes the IdP.
|
589
1004
|
#
|
590
1005
|
# @option params [required, String] :saml_assertion
|
591
|
-
# The
|
1006
|
+
# The base64 encoded SAML authentication response provided by the IdP.
|
592
1007
|
#
|
593
1008
|
# For more information, see [Configuring a Relying Party and Adding
|
594
|
-
# Claims][1] in the *
|
1009
|
+
# Claims][1] in the *IAM User Guide*.
|
595
1010
|
#
|
596
1011
|
#
|
597
1012
|
#
|
598
|
-
# [1]:
|
1013
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html
|
599
1014
|
#
|
600
|
-
# @option params [
|
601
|
-
#
|
602
|
-
#
|
603
|
-
#
|
604
|
-
# security credentials that are returned by the operation have the
|
605
|
-
# permissions that are allowed by both the access policy of the role
|
606
|
-
# that is being assumed, <i> <b>and</b> </i> the policy that you pass.
|
607
|
-
# This gives you a way to further restrict the permissions for the
|
608
|
-
# resulting temporary security credentials. You cannot use the passed
|
609
|
-
# policy to grant permissions that are in excess of those allowed by the
|
610
|
-
# access policy of the role that is being assumed. For more information,
|
611
|
-
# [Permissions for AssumeRole, AssumeRoleWithSAML, and
|
612
|
-
# AssumeRoleWithWebIdentity][1] in the *IAM User Guide*.
|
1015
|
+
# @option params [Array<Types::PolicyDescriptorType>] :policy_arns
|
1016
|
+
# The Amazon Resource Names (ARNs) of the IAM managed policies that you
|
1017
|
+
# want to use as managed session policies. The policies must exist in
|
1018
|
+
# the same account as the role.
|
613
1019
|
#
|
614
|
-
#
|
615
|
-
#
|
1020
|
+
# This parameter is optional. You can provide up to 10 managed policy
|
1021
|
+
# ARNs. However, the plaintext that you use for both inline and managed
|
1022
|
+
# session policies can't exceed 2,048 characters. For more information
|
1023
|
+
# about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services
|
1024
|
+
# Service Namespaces][1] in the Amazon Web Services General Reference.
|
1025
|
+
#
|
1026
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1027
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1028
|
+
# format that has a separate limit. Your request can fail for this limit
|
1029
|
+
# even if your plaintext meets the other requirements. The
|
1030
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1031
|
+
# the policies and tags for your request are to the upper size limit.
|
1032
|
+
#
|
1033
|
+
# </note>
|
1034
|
+
#
|
1035
|
+
# Passing policies to this operation returns new temporary credentials.
|
1036
|
+
# The resulting session's permissions are the intersection of the
|
1037
|
+
# role's identity-based policy and the session policies. You can use
|
1038
|
+
# the role's temporary credentials in subsequent Amazon Web Services
|
1039
|
+
# API calls to access resources in the account that owns the role. You
|
1040
|
+
# cannot use session policies to grant more permissions than those
|
1041
|
+
# allowed by the identity-based policy of the role that is being
|
1042
|
+
# assumed. For more information, see [Session Policies][2] in the *IAM
|
1043
|
+
# User Guide*.
|
1044
|
+
#
|
1045
|
+
#
|
1046
|
+
#
|
1047
|
+
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
1048
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
1049
|
+
#
|
1050
|
+
# @option params [String] :policy
|
1051
|
+
# An IAM policy in JSON format that you want to use as an inline session
|
1052
|
+
# policy.
|
1053
|
+
#
|
1054
|
+
# This parameter is optional. Passing policies to this operation returns
|
1055
|
+
# new temporary credentials. The resulting session's permissions are
|
1056
|
+
# the intersection of the role's identity-based policy and the session
|
1057
|
+
# policies. You can use the role's temporary credentials in subsequent
|
1058
|
+
# Amazon Web Services API calls to access resources in the account that
|
1059
|
+
# owns the role. You cannot use session policies to grant more
|
1060
|
+
# permissions than those allowed by the identity-based policy of the
|
1061
|
+
# role that is being assumed. For more information, see [Session
|
1062
|
+
# Policies][1] in the *IAM User Guide*.
|
1063
|
+
#
|
1064
|
+
# The plaintext that you use for both inline and managed session
|
1065
|
+
# policies can't exceed 2,048 characters. The JSON policy characters
|
616
1066
|
# can be any ASCII character from the space character to the end of the
|
617
|
-
# valid character list (\\u0020
|
618
|
-
# (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
1067
|
+
# valid character list (\\u0020 through \\u00FF). It can also include
|
1068
|
+
# the tab (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
619
1069
|
# characters.
|
620
1070
|
#
|
621
|
-
# <note markdown="1">
|
622
|
-
#
|
623
|
-
# separate limit.
|
624
|
-
#
|
625
|
-
#
|
1071
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1072
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1073
|
+
# format that has a separate limit. Your request can fail for this limit
|
1074
|
+
# even if your plaintext meets the other requirements. The
|
1075
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1076
|
+
# the policies and tags for your request are to the upper size limit.
|
626
1077
|
#
|
627
1078
|
# </note>
|
628
1079
|
#
|
629
1080
|
#
|
630
1081
|
#
|
631
|
-
# [1]:
|
1082
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
632
1083
|
#
|
633
1084
|
# @option params [Integer] :duration_seconds
|
634
1085
|
# The duration, in seconds, of the role session. Your role session lasts
|
@@ -644,22 +1095,22 @@ module Aws::STS
|
|
644
1095
|
# maximum value for your role, see [View the Maximum Session Duration
|
645
1096
|
# Setting for a Role][1] in the *IAM User Guide*.
|
646
1097
|
#
|
647
|
-
# By default, the value is set to 3600 seconds.
|
1098
|
+
# By default, the value is set to `3600` seconds.
|
648
1099
|
#
|
649
1100
|
# <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
|
650
1101
|
# console session that you might request using the returned credentials.
|
651
1102
|
# The request to the federation endpoint for a console sign-in token
|
652
1103
|
# takes a `SessionDuration` parameter that specifies the maximum length
|
653
1104
|
# of the console session. For more information, see [Creating a URL that
|
654
|
-
# Enables Federated Users to Access the
|
655
|
-
# the *IAM User Guide*.
|
1105
|
+
# Enables Federated Users to Access the Amazon Web Services Management
|
1106
|
+
# Console][2] in the *IAM User Guide*.
|
656
1107
|
#
|
657
1108
|
# </note>
|
658
1109
|
#
|
659
1110
|
#
|
660
1111
|
#
|
661
|
-
# [1]:
|
662
|
-
# [2]:
|
1112
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
1113
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
663
1114
|
#
|
664
1115
|
# @return [Types::AssumeRoleWithSAMLResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
665
1116
|
#
|
@@ -671,6 +1122,37 @@ module Aws::STS
|
|
671
1122
|
# * {Types::AssumeRoleWithSAMLResponse#issuer #issuer} => String
|
672
1123
|
# * {Types::AssumeRoleWithSAMLResponse#audience #audience} => String
|
673
1124
|
# * {Types::AssumeRoleWithSAMLResponse#name_qualifier #name_qualifier} => String
|
1125
|
+
# * {Types::AssumeRoleWithSAMLResponse#source_identity #source_identity} => String
|
1126
|
+
#
|
1127
|
+
#
|
1128
|
+
# @example Example: To assume a role using a SAML assertion
|
1129
|
+
#
|
1130
|
+
# resp = client.assume_role_with_saml({
|
1131
|
+
# duration_seconds: 3600,
|
1132
|
+
# principal_arn: "arn:aws:iam::123456789012:saml-provider/SAML-test",
|
1133
|
+
# role_arn: "arn:aws:iam::123456789012:role/TestSaml",
|
1134
|
+
# saml_assertion: "VERYLONGENCODEDASSERTIONEXAMPLExzYW1sOkF1ZGllbmNlPmJsYW5rPC9zYW1sOkF1ZGllbmNlPjwvc2FtbDpBdWRpZW5jZVJlc3RyaWN0aW9uPjwvc2FtbDpDb25kaXRpb25zPjxzYW1sOlN1YmplY3Q+PHNhbWw6TmFtZUlEIEZvcm1hdD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOm5hbWVpZC1mb3JtYXQ6dHJhbnNpZW50Ij5TYW1sRXhhbXBsZTwvc2FtbDpOYW1lSUQ+PHNhbWw6U3ViamVjdENvbmZpcm1hdGlvbiBNZXRob2Q9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpjbTpiZWFyZXIiPjxzYW1sOlN1YmplY3RDb25maXJtYXRpb25EYXRhIE5vdE9uT3JBZnRlcj0iMjAxOS0xMS0wMVQyMDoyNTowNS4xNDVaIiBSZWNpcGllbnQ9Imh0dHBzOi8vc2lnbmluLmF3cy5hbWF6b24uY29tL3NhbWwiLz48L3NhbWw6U3ViamVjdENvbmZpcm1hdGlvbj48L3NhbWw6U3ViamVjdD48c2FtbDpBdXRoblN0YXRlbWVudCBBdXRoPD94bWwgdmpSZXNwb25zZT4=",
|
1135
|
+
# })
|
1136
|
+
#
|
1137
|
+
# resp.to_h outputs the following:
|
1138
|
+
# {
|
1139
|
+
# assumed_role_user: {
|
1140
|
+
# arn: "arn:aws:sts::123456789012:assumed-role/TestSaml",
|
1141
|
+
# assumed_role_id: "ARO456EXAMPLE789:TestSaml",
|
1142
|
+
# },
|
1143
|
+
# audience: "https://signin.aws.amazon.com/saml",
|
1144
|
+
# credentials: {
|
1145
|
+
# access_key_id: "ASIAV3ZUEFP6EXAMPLE",
|
1146
|
+
# expiration: Time.parse("2019-11-01T20:26:47Z"),
|
1147
|
+
# secret_access_key: "8P+SQvWIuLnKhh8d++jpw0nNmQRBZvNEXAMPLEKEY",
|
1148
|
+
# session_token: "IQoJb3JpZ2luX2VjEOz////////////////////wEXAMPLEtMSJHMEUCIDoKK3JH9uGQE1z0sINr5M4jk+Na8KHDcCYRVjJCZEvOAiEA3OvJGtw1EcViOleS2vhs8VdCKFJQWPQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA==",
|
1149
|
+
# },
|
1150
|
+
# issuer: "https://integ.example.com/idp/shibboleth",
|
1151
|
+
# name_qualifier: "SbdGOnUkh1i4+EXAMPLExL/jEvs=",
|
1152
|
+
# packed_policy_size: 6,
|
1153
|
+
# subject: "SamlExample",
|
1154
|
+
# subject_type: "transient",
|
1155
|
+
# }
|
674
1156
|
#
|
675
1157
|
# @example Request syntax with placeholder values
|
676
1158
|
#
|
@@ -678,6 +1160,11 @@ module Aws::STS
|
|
678
1160
|
# role_arn: "arnType", # required
|
679
1161
|
# principal_arn: "arnType", # required
|
680
1162
|
# saml_assertion: "SAMLAssertionType", # required
|
1163
|
+
# policy_arns: [
|
1164
|
+
# {
|
1165
|
+
# arn: "arnType",
|
1166
|
+
# },
|
1167
|
+
# ],
|
681
1168
|
# policy: "sessionPolicyDocumentType",
|
682
1169
|
# duration_seconds: 1,
|
683
1170
|
# })
|
@@ -696,6 +1183,7 @@ module Aws::STS
|
|
696
1183
|
# resp.issuer #=> String
|
697
1184
|
# resp.audience #=> String
|
698
1185
|
# resp.name_qualifier #=> String
|
1186
|
+
# resp.source_identity #=> String
|
699
1187
|
#
|
700
1188
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML AWS API Documentation
|
701
1189
|
#
|
@@ -708,36 +1196,43 @@ module Aws::STS
|
|
708
1196
|
|
709
1197
|
# Returns a set of temporary security credentials for users who have
|
710
1198
|
# been authenticated in a mobile or web application with a web identity
|
711
|
-
# provider
|
712
|
-
# or any OpenID Connect-compatible identity
|
1199
|
+
# provider. Example providers include the OAuth 2.0 providers Login with
|
1200
|
+
# Amazon and Facebook, or any OpenID Connect-compatible identity
|
1201
|
+
# provider such as Google or [Amazon Cognito federated identities][1].
|
713
1202
|
#
|
714
1203
|
# <note markdown="1"> For mobile applications, we recommend that you use Amazon Cognito. You
|
715
|
-
# can use Amazon Cognito with the [
|
716
|
-
#
|
717
|
-
#
|
718
|
-
#
|
719
|
-
#
|
720
|
-
#
|
721
|
-
#
|
1204
|
+
# can use Amazon Cognito with the [Amazon Web Services SDK for iOS
|
1205
|
+
# Developer Guide][2] and the [Amazon Web Services SDK for Android
|
1206
|
+
# Developer Guide][3] to uniquely identify a user. You can also supply
|
1207
|
+
# the user with a consistent identity throughout the lifetime of an
|
1208
|
+
# application.
|
1209
|
+
#
|
1210
|
+
# To learn more about Amazon Cognito, see [Amazon Cognito Overview][4]
|
1211
|
+
# in *Amazon Web Services SDK for Android Developer Guide* and [Amazon
|
1212
|
+
# Cognito Overview][5] in the *Amazon Web Services SDK for iOS Developer
|
1213
|
+
# Guide*.
|
722
1214
|
#
|
723
1215
|
# </note>
|
724
1216
|
#
|
725
|
-
# Calling `AssumeRoleWithWebIdentity` does not require the use of
|
726
|
-
# security credentials. Therefore, you can distribute an
|
727
|
-
# (for example, on mobile devices) that requests temporary
|
728
|
-
# credentials without including long-term
|
729
|
-
# application
|
730
|
-
#
|
731
|
-
#
|
732
|
-
#
|
733
|
-
#
|
734
|
-
#
|
735
|
-
#
|
1217
|
+
# Calling `AssumeRoleWithWebIdentity` does not require the use of Amazon
|
1218
|
+
# Web Services security credentials. Therefore, you can distribute an
|
1219
|
+
# application (for example, on mobile devices) that requests temporary
|
1220
|
+
# security credentials without including long-term Amazon Web Services
|
1221
|
+
# credentials in the application. You also don't need to deploy
|
1222
|
+
# server-based proxy services that use long-term Amazon Web Services
|
1223
|
+
# credentials. Instead, the identity of the caller is validated by using
|
1224
|
+
# a token from the web identity provider. For a comparison of
|
1225
|
+
# `AssumeRoleWithWebIdentity` with the other API operations that produce
|
1226
|
+
# temporary credentials, see [Requesting Temporary Security
|
1227
|
+
# Credentials][6] and [Comparing the Amazon Web Services STS API
|
1228
|
+
# operations][7] in the *IAM User Guide*.
|
736
1229
|
#
|
737
1230
|
# The temporary security credentials returned by this API consist of an
|
738
1231
|
# access key ID, a secret access key, and a security token. Applications
|
739
|
-
# can use these temporary security credentials to sign calls to
|
740
|
-
# service
|
1232
|
+
# can use these temporary security credentials to sign calls to Amazon
|
1233
|
+
# Web Services service API operations.
|
1234
|
+
#
|
1235
|
+
# **Session Duration**
|
741
1236
|
#
|
742
1237
|
# By default, the temporary security credentials created by
|
743
1238
|
# `AssumeRoleWithWebIdentity` last for one hour. However, you can use
|
@@ -746,32 +1241,71 @@ module Aws::STS
|
|
746
1241
|
# to the maximum session duration setting for the role. This setting can
|
747
1242
|
# have a value from 1 hour to 12 hours. To learn how to view the maximum
|
748
1243
|
# value for your role, see [View the Maximum Session Duration Setting
|
749
|
-
# for a Role][
|
1244
|
+
# for a Role][8] in the *IAM User Guide*. The maximum session duration
|
750
1245
|
# limit applies when you use the `AssumeRole*` API operations or the
|
751
|
-
# `assume-role*` CLI
|
752
|
-
# operations to create a console URL. For more information,
|
753
|
-
# IAM Roles][
|
1246
|
+
# `assume-role*` CLI commands. However the limit does not apply when you
|
1247
|
+
# use those operations to create a console URL. For more information,
|
1248
|
+
# see [Using IAM Roles][9] in the *IAM User Guide*.
|
1249
|
+
#
|
1250
|
+
# **Permissions**
|
754
1251
|
#
|
755
1252
|
# The temporary security credentials created by
|
756
|
-
# `AssumeRoleWithWebIdentity` can be used to make API calls to any
|
757
|
-
# service with the following exception: you cannot
|
758
|
-
#
|
759
|
-
#
|
760
|
-
#
|
761
|
-
#
|
762
|
-
#
|
763
|
-
#
|
764
|
-
#
|
765
|
-
#
|
766
|
-
#
|
767
|
-
#
|
768
|
-
#
|
769
|
-
# credentials
|
770
|
-
#
|
771
|
-
#
|
772
|
-
#
|
1253
|
+
# `AssumeRoleWithWebIdentity` can be used to make API calls to any
|
1254
|
+
# Amazon Web Services service with the following exception: you cannot
|
1255
|
+
# call the STS `GetFederationToken` or `GetSessionToken` API operations.
|
1256
|
+
#
|
1257
|
+
# (Optional) You can pass inline or managed [session policies][10] to
|
1258
|
+
# this operation. You can pass a single JSON policy document to use as
|
1259
|
+
# an inline session policy. You can also specify up to 10 managed policy
|
1260
|
+
# Amazon Resource Names (ARNs) to use as managed session policies. The
|
1261
|
+
# plaintext that you use for both inline and managed session policies
|
1262
|
+
# can't exceed 2,048 characters. Passing policies to this operation
|
1263
|
+
# returns new temporary credentials. The resulting session's
|
1264
|
+
# permissions are the intersection of the role's identity-based policy
|
1265
|
+
# and the session policies. You can use the role's temporary
|
1266
|
+
# credentials in subsequent Amazon Web Services API calls to access
|
1267
|
+
# resources in the account that owns the role. You cannot use session
|
1268
|
+
# policies to grant more permissions than those allowed by the
|
1269
|
+
# identity-based policy of the role that is being assumed. For more
|
1270
|
+
# information, see [Session Policies][10] in the *IAM User Guide*.
|
1271
|
+
#
|
1272
|
+
# **Tags**
|
1273
|
+
#
|
1274
|
+
# (Optional) You can configure your IdP to pass attributes into your web
|
1275
|
+
# identity token as session tags. Each session tag consists of a key
|
1276
|
+
# name and an associated value. For more information about session tags,
|
1277
|
+
# see [Passing Session Tags in STS][11] in the *IAM User Guide*.
|
1278
|
+
#
|
1279
|
+
# You can pass up to 50 session tags. The plaintext session tag keys
|
1280
|
+
# can’t exceed 128 characters and the values can’t exceed 256
|
1281
|
+
# characters. For these and additional limits, see [IAM and STS
|
1282
|
+
# Character Limits][12] in the *IAM User Guide*.
|
1283
|
+
#
|
1284
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1285
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1286
|
+
# format that has a separate limit. Your request can fail for this limit
|
1287
|
+
# even if your plaintext meets the other requirements. The
|
1288
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1289
|
+
# the policies and tags for your request are to the upper size limit.
|
1290
|
+
#
|
1291
|
+
# </note>
|
1292
|
+
#
|
1293
|
+
# You can pass a session tag with the same key as a tag that is attached
|
1294
|
+
# to the role. When you do, the session tag overrides the role tag with
|
1295
|
+
# the same key.
|
1296
|
+
#
|
1297
|
+
# An administrator must grant you the permissions necessary to pass
|
1298
|
+
# session tags. The administrator can also create granular permissions
|
1299
|
+
# to allow you to pass only specific session tags. For more information,
|
1300
|
+
# see [Tutorial: Using Tags for Attribute-Based Access Control][13] in
|
773
1301
|
# the *IAM User Guide*.
|
774
1302
|
#
|
1303
|
+
# You can set the session tags as transitive. Transitive tags persist
|
1304
|
+
# during role chaining. For more information, see [Chaining Roles with
|
1305
|
+
# Session Tags][14] in the *IAM User Guide*.
|
1306
|
+
#
|
1307
|
+
# **Identities**
|
1308
|
+
#
|
775
1309
|
# Before your application can call `AssumeRoleWithWebIdentity`, you must
|
776
1310
|
# have an identity token from a supported identity provider and create a
|
777
1311
|
# role that the application can assume. The role that your application
|
@@ -779,50 +1313,56 @@ module Aws::STS
|
|
779
1313
|
# identity token. In other words, the identity provider must be
|
780
1314
|
# specified in the role's trust policy.
|
781
1315
|
#
|
782
|
-
# Calling `AssumeRoleWithWebIdentity` can result in an entry in your
|
783
|
-
# CloudTrail logs. The entry includes the [Subject][
|
784
|
-
#
|
1316
|
+
# Calling `AssumeRoleWithWebIdentity` can result in an entry in your
|
1317
|
+
# CloudTrail logs. The entry includes the [Subject][15] of the provided
|
1318
|
+
# web identity token. We recommend that you avoid using any personally
|
785
1319
|
# identifiable information (PII) in this field. For example, you could
|
786
1320
|
# instead use a GUID or a pairwise identifier, as [suggested in the OIDC
|
787
|
-
# specification][
|
1321
|
+
# specification][16].
|
788
1322
|
#
|
789
1323
|
# For more information about how to use web identity federation and the
|
790
1324
|
# `AssumeRoleWithWebIdentity` API, see the following resources:
|
791
1325
|
#
|
792
|
-
# * [Using Web Identity Federation
|
793
|
-
# [Federation Through a Web-based Identity Provider][
|
1326
|
+
# * [Using Web Identity Federation API Operations for Mobile Apps][17]
|
1327
|
+
# and [Federation Through a Web-based Identity Provider][18].
|
794
1328
|
#
|
795
|
-
# * [ Web Identity Federation Playground][
|
796
|
-
#
|
797
|
-
#
|
798
|
-
#
|
1329
|
+
# * [ Web Identity Federation Playground][19]. Walk through the process
|
1330
|
+
# of authenticating through Login with Amazon, Facebook, or Google,
|
1331
|
+
# getting temporary security credentials, and then using those
|
1332
|
+
# credentials to make a request to Amazon Web Services.
|
799
1333
|
#
|
800
|
-
# * [
|
801
|
-
#
|
802
|
-
#
|
803
|
-
# use
|
1334
|
+
# * [Amazon Web Services SDK for iOS Developer Guide][2] and [Amazon Web
|
1335
|
+
# Services SDK for Android Developer Guide][3]. These toolkits contain
|
1336
|
+
# sample apps that show how to invoke the identity providers. The
|
1337
|
+
# toolkits then show how to use the information from these providers
|
1338
|
+
# to get and use temporary security credentials.
|
804
1339
|
#
|
805
|
-
# * [Web Identity Federation with Mobile Applications][
|
1340
|
+
# * [Web Identity Federation with Mobile Applications][20]. This article
|
806
1341
|
# discusses web identity federation and shows an example of how to use
|
807
1342
|
# web identity federation to get access to content in Amazon S3.
|
808
1343
|
#
|
809
1344
|
#
|
810
1345
|
#
|
811
|
-
# [1]:
|
812
|
-
# [2]: http://aws.amazon.com/
|
813
|
-
# [3]: http://
|
814
|
-
# [4]:
|
815
|
-
# [5]:
|
816
|
-
# [6]:
|
817
|
-
# [7]:
|
818
|
-
# [8]:
|
819
|
-
# [9]:
|
820
|
-
# [10]:
|
821
|
-
# [11]:
|
822
|
-
# [12]:
|
823
|
-
# [13]:
|
824
|
-
# [14]: https://
|
825
|
-
# [15]: http://
|
1346
|
+
# [1]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html
|
1347
|
+
# [2]: http://aws.amazon.com/sdkforios/
|
1348
|
+
# [3]: http://aws.amazon.com/sdkforandroid/
|
1349
|
+
# [4]: https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840
|
1350
|
+
# [5]: https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664
|
1351
|
+
# [6]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
1352
|
+
# [7]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
|
1353
|
+
# [8]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
1354
|
+
# [9]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
|
1355
|
+
# [10]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
1356
|
+
# [11]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
1357
|
+
# [12]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
1358
|
+
# [13]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
1359
|
+
# [14]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
1360
|
+
# [15]: http://openid.net/specs/openid-connect-core-1_0.html#Claims
|
1361
|
+
# [16]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes
|
1362
|
+
# [17]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html
|
1363
|
+
# [18]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity
|
1364
|
+
# [19]: https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/
|
1365
|
+
# [20]: http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications
|
826
1366
|
#
|
827
1367
|
# @option params [required, String] :role_arn
|
828
1368
|
# The Amazon Resource Name (ARN) of the role that the caller is
|
@@ -849,48 +1389,84 @@ module Aws::STS
|
|
849
1389
|
# `AssumeRoleWithWebIdentity` call.
|
850
1390
|
#
|
851
1391
|
# @option params [String] :provider_id
|
852
|
-
# The fully qualified host component of the domain name of the
|
853
|
-
# provider.
|
1392
|
+
# The fully qualified host component of the domain name of the OAuth 2.0
|
1393
|
+
# identity provider. Do not specify this value for an OpenID Connect
|
1394
|
+
# identity provider.
|
854
1395
|
#
|
855
|
-
#
|
856
|
-
#
|
857
|
-
#
|
858
|
-
# schemes and port numbers.
|
1396
|
+
# Currently `www.amazon.com` and `graph.facebook.com` are the only
|
1397
|
+
# supported identity providers for OAuth 2.0 access tokens. Do not
|
1398
|
+
# include URL schemes and port numbers.
|
859
1399
|
#
|
860
1400
|
# Do not specify this value for OpenID Connect ID tokens.
|
861
1401
|
#
|
862
|
-
# @option params [
|
863
|
-
#
|
864
|
-
#
|
865
|
-
#
|
866
|
-
# security credentials that are returned by the operation have the
|
867
|
-
# permissions that are allowed by both the access policy of the role
|
868
|
-
# that is being assumed, <i> <b>and</b> </i> the policy that you pass.
|
869
|
-
# This gives you a way to further restrict the permissions for the
|
870
|
-
# resulting temporary security credentials. You cannot use the passed
|
871
|
-
# policy to grant permissions that are in excess of those allowed by the
|
872
|
-
# access policy of the role that is being assumed. For more information,
|
873
|
-
# see [Permissions for AssumeRoleWithWebIdentity][1] in the *IAM User
|
874
|
-
# Guide*.
|
1402
|
+
# @option params [Array<Types::PolicyDescriptorType>] :policy_arns
|
1403
|
+
# The Amazon Resource Names (ARNs) of the IAM managed policies that you
|
1404
|
+
# want to use as managed session policies. The policies must exist in
|
1405
|
+
# the same account as the role.
|
875
1406
|
#
|
876
|
-
#
|
877
|
-
#
|
1407
|
+
# This parameter is optional. You can provide up to 10 managed policy
|
1408
|
+
# ARNs. However, the plaintext that you use for both inline and managed
|
1409
|
+
# session policies can't exceed 2,048 characters. For more information
|
1410
|
+
# about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services
|
1411
|
+
# Service Namespaces][1] in the Amazon Web Services General Reference.
|
1412
|
+
#
|
1413
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1414
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1415
|
+
# format that has a separate limit. Your request can fail for this limit
|
1416
|
+
# even if your plaintext meets the other requirements. The
|
1417
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1418
|
+
# the policies and tags for your request are to the upper size limit.
|
1419
|
+
#
|
1420
|
+
# </note>
|
1421
|
+
#
|
1422
|
+
# Passing policies to this operation returns new temporary credentials.
|
1423
|
+
# The resulting session's permissions are the intersection of the
|
1424
|
+
# role's identity-based policy and the session policies. You can use
|
1425
|
+
# the role's temporary credentials in subsequent Amazon Web Services
|
1426
|
+
# API calls to access resources in the account that owns the role. You
|
1427
|
+
# cannot use session policies to grant more permissions than those
|
1428
|
+
# allowed by the identity-based policy of the role that is being
|
1429
|
+
# assumed. For more information, see [Session Policies][2] in the *IAM
|
1430
|
+
# User Guide*.
|
1431
|
+
#
|
1432
|
+
#
|
1433
|
+
#
|
1434
|
+
# [1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
1435
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
1436
|
+
#
|
1437
|
+
# @option params [String] :policy
|
1438
|
+
# An IAM policy in JSON format that you want to use as an inline session
|
1439
|
+
# policy.
|
1440
|
+
#
|
1441
|
+
# This parameter is optional. Passing policies to this operation returns
|
1442
|
+
# new temporary credentials. The resulting session's permissions are
|
1443
|
+
# the intersection of the role's identity-based policy and the session
|
1444
|
+
# policies. You can use the role's temporary credentials in subsequent
|
1445
|
+
# Amazon Web Services API calls to access resources in the account that
|
1446
|
+
# owns the role. You cannot use session policies to grant more
|
1447
|
+
# permissions than those allowed by the identity-based policy of the
|
1448
|
+
# role that is being assumed. For more information, see [Session
|
1449
|
+
# Policies][1] in the *IAM User Guide*.
|
1450
|
+
#
|
1451
|
+
# The plaintext that you use for both inline and managed session
|
1452
|
+
# policies can't exceed 2,048 characters. The JSON policy characters
|
878
1453
|
# can be any ASCII character from the space character to the end of the
|
879
|
-
# valid character list (\\u0020
|
880
|
-
# (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
1454
|
+
# valid character list (\\u0020 through \\u00FF). It can also include
|
1455
|
+
# the tab (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
881
1456
|
# characters.
|
882
1457
|
#
|
883
|
-
# <note markdown="1">
|
884
|
-
#
|
885
|
-
# separate limit.
|
886
|
-
#
|
887
|
-
#
|
1458
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1459
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1460
|
+
# format that has a separate limit. Your request can fail for this limit
|
1461
|
+
# even if your plaintext meets the other requirements. The
|
1462
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1463
|
+
# the policies and tags for your request are to the upper size limit.
|
888
1464
|
#
|
889
1465
|
# </note>
|
890
1466
|
#
|
891
1467
|
#
|
892
1468
|
#
|
893
|
-
# [1]:
|
1469
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
894
1470
|
#
|
895
1471
|
# @option params [Integer] :duration_seconds
|
896
1472
|
# The duration, in seconds, of the role session. The value can range
|
@@ -903,22 +1479,22 @@ module Aws::STS
|
|
903
1479
|
# see [View the Maximum Session Duration Setting for a Role][1] in the
|
904
1480
|
# *IAM User Guide*.
|
905
1481
|
#
|
906
|
-
# By default, the value is set to 3600 seconds.
|
1482
|
+
# By default, the value is set to `3600` seconds.
|
907
1483
|
#
|
908
1484
|
# <note markdown="1"> The `DurationSeconds` parameter is separate from the duration of a
|
909
1485
|
# console session that you might request using the returned credentials.
|
910
1486
|
# The request to the federation endpoint for a console sign-in token
|
911
1487
|
# takes a `SessionDuration` parameter that specifies the maximum length
|
912
1488
|
# of the console session. For more information, see [Creating a URL that
|
913
|
-
# Enables Federated Users to Access the
|
914
|
-
# the *IAM User Guide*.
|
1489
|
+
# Enables Federated Users to Access the Amazon Web Services Management
|
1490
|
+
# Console][2] in the *IAM User Guide*.
|
915
1491
|
#
|
916
1492
|
# </note>
|
917
1493
|
#
|
918
1494
|
#
|
919
1495
|
#
|
920
|
-
# [1]:
|
921
|
-
# [2]:
|
1496
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
1497
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
922
1498
|
#
|
923
1499
|
# @return [Types::AssumeRoleWithWebIdentityResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
924
1500
|
#
|
@@ -928,12 +1504,14 @@ module Aws::STS
|
|
928
1504
|
# * {Types::AssumeRoleWithWebIdentityResponse#packed_policy_size #packed_policy_size} => Integer
|
929
1505
|
# * {Types::AssumeRoleWithWebIdentityResponse#provider #provider} => String
|
930
1506
|
# * {Types::AssumeRoleWithWebIdentityResponse#audience #audience} => String
|
1507
|
+
# * {Types::AssumeRoleWithWebIdentityResponse#source_identity #source_identity} => String
|
931
1508
|
#
|
932
1509
|
#
|
933
1510
|
# @example Example: To assume a role as an OpenID Connect-federated user
|
934
1511
|
#
|
935
1512
|
# resp = client.assume_role_with_web_identity({
|
936
1513
|
# duration_seconds: 3600,
|
1514
|
+
# policy: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}",
|
937
1515
|
# provider_id: "www.amazon.com",
|
938
1516
|
# role_arn: "arn:aws:iam::123456789012:role/FederatedWebIdentityRole",
|
939
1517
|
# role_session_name: "app1",
|
@@ -965,6 +1543,11 @@ module Aws::STS
|
|
965
1543
|
# role_session_name: "roleSessionNameType", # required
|
966
1544
|
# web_identity_token: "clientTokenType", # required
|
967
1545
|
# provider_id: "urlType",
|
1546
|
+
# policy_arns: [
|
1547
|
+
# {
|
1548
|
+
# arn: "arnType",
|
1549
|
+
# },
|
1550
|
+
# ],
|
968
1551
|
# policy: "sessionPolicyDocumentType",
|
969
1552
|
# duration_seconds: 1,
|
970
1553
|
# })
|
@@ -981,6 +1564,7 @@ module Aws::STS
|
|
981
1564
|
# resp.packed_policy_size #=> Integer
|
982
1565
|
# resp.provider #=> String
|
983
1566
|
# resp.audience #=> String
|
1567
|
+
# resp.source_identity #=> String
|
984
1568
|
#
|
985
1569
|
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity AWS API Documentation
|
986
1570
|
#
|
@@ -992,33 +1576,34 @@ module Aws::STS
|
|
992
1576
|
end
|
993
1577
|
|
994
1578
|
# Decodes additional information about the authorization status of a
|
995
|
-
# request from an encoded message returned in response to an
|
996
|
-
# request.
|
1579
|
+
# request from an encoded message returned in response to an Amazon Web
|
1580
|
+
# Services request.
|
997
1581
|
#
|
998
|
-
# For example, if a user is not authorized to perform an
|
999
|
-
# or she has requested, the request returns a
|
1582
|
+
# For example, if a user is not authorized to perform an operation that
|
1583
|
+
# he or she has requested, the request returns a
|
1000
1584
|
# `Client.UnauthorizedOperation` response (an HTTP 403 response). Some
|
1001
|
-
#
|
1002
|
-
# details about this authorization failure.
|
1585
|
+
# Amazon Web Services operations additionally return an encoded message
|
1586
|
+
# that can provide details about this authorization failure.
|
1003
1587
|
#
|
1004
|
-
# <note markdown="1"> Only certain
|
1005
|
-
# documentation for an individual
|
1006
|
-
# returns an encoded message in
|
1588
|
+
# <note markdown="1"> Only certain Amazon Web Services operations return an encoded
|
1589
|
+
# authorization message. The documentation for an individual operation
|
1590
|
+
# indicates whether that operation returns an encoded message in
|
1591
|
+
# addition to returning an HTTP code.
|
1007
1592
|
#
|
1008
1593
|
# </note>
|
1009
1594
|
#
|
1010
1595
|
# The message is encoded because the details of the authorization status
|
1011
|
-
# can
|
1012
|
-
#
|
1013
|
-
# user must be granted permissions
|
1014
|
-
# `DecodeAuthorizationMessage` (`sts:DecodeAuthorizationMessage`)
|
1596
|
+
# can contain privileged information that the user who requested the
|
1597
|
+
# operation should not see. To decode an authorization status message, a
|
1598
|
+
# user must be granted permissions through an IAM [policy][1] to request
|
1599
|
+
# the `DecodeAuthorizationMessage` (`sts:DecodeAuthorizationMessage`)
|
1015
1600
|
# action.
|
1016
1601
|
#
|
1017
1602
|
# The decoded message includes the following type of information:
|
1018
1603
|
#
|
1019
1604
|
# * Whether the request was denied due to an explicit deny or due to the
|
1020
1605
|
# absence of an explicit allow. For more information, see [Determining
|
1021
|
-
# Whether a Request is Allowed or Denied][
|
1606
|
+
# Whether a Request is Allowed or Denied][2] in the *IAM User Guide*.
|
1022
1607
|
#
|
1023
1608
|
# * The principal who made the request.
|
1024
1609
|
#
|
@@ -1030,7 +1615,8 @@ module Aws::STS
|
|
1030
1615
|
#
|
1031
1616
|
#
|
1032
1617
|
#
|
1033
|
-
# [1]:
|
1618
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
|
1619
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow
|
1034
1620
|
#
|
1035
1621
|
# @option params [required, String] :encoded_message
|
1036
1622
|
# The encoded message that was returned with the response.
|
@@ -1070,8 +1656,83 @@ module Aws::STS
|
|
1070
1656
|
req.send_request(options)
|
1071
1657
|
end
|
1072
1658
|
|
1073
|
-
# Returns
|
1074
|
-
#
|
1659
|
+
# Returns the account identifier for the specified access key ID.
|
1660
|
+
#
|
1661
|
+
# Access keys consist of two parts: an access key ID (for example,
|
1662
|
+
# `AKIAIOSFODNN7EXAMPLE`) and a secret access key (for example,
|
1663
|
+
# `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`). For more information
|
1664
|
+
# about access keys, see [Managing Access Keys for IAM Users][1] in the
|
1665
|
+
# *IAM User Guide*.
|
1666
|
+
#
|
1667
|
+
# When you pass an access key ID to this operation, it returns the ID of
|
1668
|
+
# the Amazon Web Services account to which the keys belong. Access key
|
1669
|
+
# IDs beginning with `AKIA` are long-term credentials for an IAM user or
|
1670
|
+
# the Amazon Web Services account root user. Access key IDs beginning
|
1671
|
+
# with `ASIA` are temporary credentials that are created using STS
|
1672
|
+
# operations. If the account in the response belongs to you, you can
|
1673
|
+
# sign in as the root user and review your root user access keys. Then,
|
1674
|
+
# you can pull a [credentials report][2] to learn which IAM user owns
|
1675
|
+
# the keys. To learn who requested the temporary credentials for an
|
1676
|
+
# `ASIA` access key, view the STS events in your [CloudTrail logs][3] in
|
1677
|
+
# the *IAM User Guide*.
|
1678
|
+
#
|
1679
|
+
# This operation does not indicate the state of the access key. The key
|
1680
|
+
# might be active, inactive, or deleted. Active keys might not have
|
1681
|
+
# permissions to perform an operation. Providing a deleted access key
|
1682
|
+
# might return an error that the key doesn't exist.
|
1683
|
+
#
|
1684
|
+
#
|
1685
|
+
#
|
1686
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
|
1687
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html
|
1688
|
+
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
|
1689
|
+
#
|
1690
|
+
# @option params [required, String] :access_key_id
|
1691
|
+
# The identifier of an access key.
|
1692
|
+
#
|
1693
|
+
# This parameter allows (through its regex pattern) a string of
|
1694
|
+
# characters that can consist of any upper- or lowercase letter or
|
1695
|
+
# digit.
|
1696
|
+
#
|
1697
|
+
# @return [Types::GetAccessKeyInfoResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1698
|
+
#
|
1699
|
+
# * {Types::GetAccessKeyInfoResponse#account #account} => String
|
1700
|
+
#
|
1701
|
+
# @example Request syntax with placeholder values
|
1702
|
+
#
|
1703
|
+
# resp = client.get_access_key_info({
|
1704
|
+
# access_key_id: "accessKeyIdType", # required
|
1705
|
+
# })
|
1706
|
+
#
|
1707
|
+
# @example Response structure
|
1708
|
+
#
|
1709
|
+
# resp.account #=> String
|
1710
|
+
#
|
1711
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetAccessKeyInfo AWS API Documentation
|
1712
|
+
#
|
1713
|
+
# @overload get_access_key_info(params = {})
|
1714
|
+
# @param [Hash] params ({})
|
1715
|
+
def get_access_key_info(params = {}, options = {})
|
1716
|
+
req = build_request(:get_access_key_info, params)
|
1717
|
+
req.send_request(options)
|
1718
|
+
end
|
1719
|
+
|
1720
|
+
# Returns details about the IAM user or role whose credentials are used
|
1721
|
+
# to call the operation.
|
1722
|
+
#
|
1723
|
+
# <note markdown="1"> No permissions are required to perform this operation. If an
|
1724
|
+
# administrator adds a policy to your IAM user or role that explicitly
|
1725
|
+
# denies access to the `sts:GetCallerIdentity` action, you can still
|
1726
|
+
# perform this operation. Permissions are not required because the same
|
1727
|
+
# information is returned when an IAM user or role is denied access. To
|
1728
|
+
# view an example response, see [I Am Not Authorized to Perform:
|
1729
|
+
# iam:DeleteVirtualMFADevice][1] in the *IAM User Guide*.
|
1730
|
+
#
|
1731
|
+
# </note>
|
1732
|
+
#
|
1733
|
+
#
|
1734
|
+
#
|
1735
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa
|
1075
1736
|
#
|
1076
1737
|
# @return [Types::GetCallerIdentityResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1077
1738
|
#
|
@@ -1144,97 +1805,117 @@ module Aws::STS
|
|
1144
1805
|
# access key ID, a secret access key, and a security token) for a
|
1145
1806
|
# federated user. A typical use is in a proxy application that gets
|
1146
1807
|
# temporary security credentials on behalf of distributed applications
|
1147
|
-
# inside a corporate network.
|
1148
|
-
#
|
1149
|
-
#
|
1150
|
-
#
|
1151
|
-
#
|
1152
|
-
#
|
1153
|
-
#
|
1154
|
-
# *IAM User Guide*.
|
1808
|
+
# inside a corporate network. You must call the `GetFederationToken`
|
1809
|
+
# operation using the long-term security credentials of an IAM user. As
|
1810
|
+
# a result, this call is appropriate in contexts where those credentials
|
1811
|
+
# can be safely stored, usually in a server-based application. For a
|
1812
|
+
# comparison of `GetFederationToken` with the other API operations that
|
1813
|
+
# produce temporary credentials, see [Requesting Temporary Security
|
1814
|
+
# Credentials][1] and [Comparing the Amazon Web Services STS API
|
1815
|
+
# operations][2] in the *IAM User Guide*.
|
1155
1816
|
#
|
1156
|
-
# <note markdown="1">
|
1817
|
+
# <note markdown="1"> You can create a mobile-based or browser-based app that can
|
1157
1818
|
# authenticate users using a web identity provider like Login with
|
1158
1819
|
# Amazon, Facebook, Google, or an OpenID Connect-compatible identity
|
1159
|
-
# provider, we recommend that you use [Amazon Cognito][3]
|
1160
|
-
# `AssumeRoleWithWebIdentity`. For more information, see [Federation
|
1161
|
-
# Through a Web-based Identity Provider][4]
|
1820
|
+
# provider. In this case, we recommend that you use [Amazon Cognito][3]
|
1821
|
+
# or `AssumeRoleWithWebIdentity`. For more information, see [Federation
|
1822
|
+
# Through a Web-based Identity Provider][4] in the *IAM User Guide*.
|
1162
1823
|
#
|
1163
1824
|
# </note>
|
1164
1825
|
#
|
1165
|
-
#
|
1166
|
-
#
|
1167
|
-
#
|
1168
|
-
#
|
1169
|
-
#
|
1170
|
-
#
|
1171
|
-
# the
|
1172
|
-
# information, see [IAM Best Practices][5] in the *IAM User Guide*.
|
1173
|
-
#
|
1174
|
-
# The temporary security credentials that are obtained by using the
|
1175
|
-
# long-term credentials of an IAM user are valid for the specified
|
1176
|
-
# duration, from 900 seconds (15 minutes) up to a maximium of 129600
|
1177
|
-
# seconds (36 hours). The default is 43200 seconds (12 hours). Temporary
|
1178
|
-
# credentials that are obtained by using AWS root account credentials
|
1179
|
-
# have a maximum duration of 3600 seconds (1 hour).
|
1180
|
-
#
|
1181
|
-
# The temporary security credentials created by `GetFederationToken` can
|
1182
|
-
# be used to make API calls to any AWS service with the following
|
1183
|
-
# exceptions:
|
1826
|
+
# You can also call `GetFederationToken` using the security credentials
|
1827
|
+
# of an Amazon Web Services account root user, but we do not recommend
|
1828
|
+
# it. Instead, we recommend that you create an IAM user for the purpose
|
1829
|
+
# of the proxy application. Then attach a policy to the IAM user that
|
1830
|
+
# limits federated users to only the actions and resources that they
|
1831
|
+
# need to access. For more information, see [IAM Best Practices][5] in
|
1832
|
+
# the *IAM User Guide*.
|
1184
1833
|
#
|
1185
|
-
#
|
1834
|
+
# **Session duration**
|
1186
1835
|
#
|
1187
|
-
#
|
1836
|
+
# The temporary credentials are valid for the specified duration, from
|
1837
|
+
# 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36
|
1838
|
+
# hours). The default session duration is 43,200 seconds (12 hours).
|
1839
|
+
# Temporary credentials obtained by using the Amazon Web Services
|
1840
|
+
# account root user credentials have a maximum duration of 3,600 seconds
|
1841
|
+
# (1 hour).
|
1188
1842
|
#
|
1189
1843
|
# **Permissions**
|
1190
1844
|
#
|
1191
|
-
#
|
1192
|
-
#
|
1193
|
-
#
|
1194
|
-
# *
|
1195
|
-
#
|
1196
|
-
#
|
1197
|
-
# *
|
1198
|
-
#
|
1199
|
-
#
|
1200
|
-
#
|
1201
|
-
#
|
1202
|
-
#
|
1203
|
-
#
|
1204
|
-
#
|
1205
|
-
#
|
1206
|
-
# the
|
1207
|
-
#
|
1208
|
-
#
|
1209
|
-
#
|
1210
|
-
#
|
1211
|
-
#
|
1212
|
-
#
|
1213
|
-
#
|
1214
|
-
#
|
1215
|
-
# appropriate to that individual user, using a policy that allows only a
|
1216
|
-
# subset of permissions that are granted to the IAM user.
|
1217
|
-
#
|
1218
|
-
# If you do not pass a policy, the resulting temporary security
|
1219
|
-
# credentials have no effective permissions. The only exception is when
|
1220
|
-
# the temporary security credentials are used to access a resource that
|
1221
|
-
# has a resource-based policy that specifically allows the federated
|
1222
|
-
# user to access the resource.
|
1223
|
-
#
|
1224
|
-
# For more information about how permissions work, see [Permissions for
|
1225
|
-
# GetFederationToken][6]. For information about using
|
1845
|
+
# You can use the temporary credentials created by `GetFederationToken`
|
1846
|
+
# in any Amazon Web Services service except the following:
|
1847
|
+
#
|
1848
|
+
# * You cannot call any IAM operations using the CLI or the Amazon Web
|
1849
|
+
# Services API.
|
1850
|
+
#
|
1851
|
+
# * You cannot call any STS operations except `GetCallerIdentity`.
|
1852
|
+
#
|
1853
|
+
# You must pass an inline or managed [session policy][6] to this
|
1854
|
+
# operation. You can pass a single JSON policy document to use as an
|
1855
|
+
# inline session policy. You can also specify up to 10 managed policy
|
1856
|
+
# Amazon Resource Names (ARNs) to use as managed session policies. The
|
1857
|
+
# plaintext that you use for both inline and managed session policies
|
1858
|
+
# can't exceed 2,048 characters.
|
1859
|
+
#
|
1860
|
+
# Though the session policy parameters are optional, if you do not pass
|
1861
|
+
# a policy, then the resulting federated user session has no
|
1862
|
+
# permissions. When you pass session policies, the session permissions
|
1863
|
+
# are the intersection of the IAM user policies and the session policies
|
1864
|
+
# that you pass. This gives you a way to further restrict the
|
1865
|
+
# permissions for a federated user. You cannot use session policies to
|
1866
|
+
# grant more permissions than those that are defined in the permissions
|
1867
|
+
# policy of the IAM user. For more information, see [Session
|
1868
|
+
# Policies][6] in the *IAM User Guide*. For information about using
|
1226
1869
|
# `GetFederationToken` to create temporary security credentials, see
|
1227
1870
|
# [GetFederationToken—Federation Through a Custom Identity Broker][7].
|
1228
1871
|
#
|
1872
|
+
# You can use the credentials to access a resource that has a
|
1873
|
+
# resource-based policy. If that policy specifically references the
|
1874
|
+
# federated user session in the `Principal` element of the policy, the
|
1875
|
+
# session has the permissions allowed by the policy. These permissions
|
1876
|
+
# are granted in addition to the permissions granted by the session
|
1877
|
+
# policies.
|
1878
|
+
#
|
1879
|
+
# **Tags**
|
1229
1880
|
#
|
1881
|
+
# (Optional) You can pass tag key-value pairs to your session. These are
|
1882
|
+
# called session tags. For more information about session tags, see
|
1883
|
+
# [Passing Session Tags in STS][8] in the *IAM User Guide*.
|
1230
1884
|
#
|
1231
|
-
#
|
1232
|
-
#
|
1885
|
+
# <note markdown="1"> You can create a mobile-based or browser-based app that can
|
1886
|
+
# authenticate users using a web identity provider like Login with
|
1887
|
+
# Amazon, Facebook, Google, or an OpenID Connect-compatible identity
|
1888
|
+
# provider. In this case, we recommend that you use [Amazon Cognito][3]
|
1889
|
+
# or `AssumeRoleWithWebIdentity`. For more information, see [Federation
|
1890
|
+
# Through a Web-based Identity Provider][4] in the *IAM User Guide*.
|
1891
|
+
#
|
1892
|
+
# </note>
|
1893
|
+
#
|
1894
|
+
# An administrator must grant you the permissions necessary to pass
|
1895
|
+
# session tags. The administrator can also create granular permissions
|
1896
|
+
# to allow you to pass only specific session tags. For more information,
|
1897
|
+
# see [Tutorial: Using Tags for Attribute-Based Access Control][9] in
|
1898
|
+
# the *IAM User Guide*.
|
1899
|
+
#
|
1900
|
+
# Tag key–value pairs are not case sensitive, but case is preserved.
|
1901
|
+
# This means that you cannot have separate `Department` and `department`
|
1902
|
+
# tag keys. Assume that the user that you are federating has the
|
1903
|
+
# `Department`=`Marketing` tag and you pass the
|
1904
|
+
# `department`=`engineering` session tag. `Department` and `department`
|
1905
|
+
# are not saved as separate tags, and the session tag passed in the
|
1906
|
+
# request takes precedence over the user tag.
|
1907
|
+
#
|
1908
|
+
#
|
1909
|
+
#
|
1910
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
1911
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
|
1233
1912
|
# [3]: http://aws.amazon.com/cognito/
|
1234
|
-
# [4]:
|
1235
|
-
# [5]:
|
1236
|
-
# [6]:
|
1237
|
-
# [7]:
|
1913
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity
|
1914
|
+
# [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
|
1915
|
+
# [6]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
1916
|
+
# [7]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken
|
1917
|
+
# [8]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
1918
|
+
# [9]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
1238
1919
|
#
|
1239
1920
|
# @option params [required, String] :name
|
1240
1921
|
# The name of the federated user. The name is used as an identifier for
|
@@ -1248,53 +1929,144 @@ module Aws::STS
|
|
1248
1929
|
# characters: =,.@-
|
1249
1930
|
#
|
1250
1931
|
# @option params [String] :policy
|
1251
|
-
# An IAM policy in JSON format that
|
1252
|
-
#
|
1253
|
-
#
|
1254
|
-
#
|
1255
|
-
#
|
1256
|
-
#
|
1257
|
-
#
|
1258
|
-
#
|
1259
|
-
#
|
1260
|
-
#
|
1261
|
-
#
|
1262
|
-
#
|
1263
|
-
#
|
1264
|
-
#
|
1265
|
-
#
|
1266
|
-
# user to
|
1932
|
+
# An IAM policy in JSON format that you want to use as an inline session
|
1933
|
+
# policy.
|
1934
|
+
#
|
1935
|
+
# You must pass an inline or managed [session policy][1] to this
|
1936
|
+
# operation. You can pass a single JSON policy document to use as an
|
1937
|
+
# inline session policy. You can also specify up to 10 managed policy
|
1938
|
+
# Amazon Resource Names (ARNs) to use as managed session policies.
|
1939
|
+
#
|
1940
|
+
# This parameter is optional. However, if you do not pass any session
|
1941
|
+
# policies, then the resulting federated user session has no
|
1942
|
+
# permissions.
|
1943
|
+
#
|
1944
|
+
# When you pass session policies, the session permissions are the
|
1945
|
+
# intersection of the IAM user policies and the session policies that
|
1946
|
+
# you pass. This gives you a way to further restrict the permissions for
|
1947
|
+
# a federated user. You cannot use session policies to grant more
|
1948
|
+
# permissions than those that are defined in the permissions policy of
|
1949
|
+
# the IAM user. For more information, see [Session Policies][1] in the
|
1950
|
+
# *IAM User Guide*.
|
1267
1951
|
#
|
1268
|
-
# The
|
1269
|
-
#
|
1952
|
+
# The resulting credentials can be used to access a resource that has a
|
1953
|
+
# resource-based policy. If that policy specifically references the
|
1954
|
+
# federated user session in the `Principal` element of the policy, the
|
1955
|
+
# session has the permissions allowed by the policy. These permissions
|
1956
|
+
# are granted in addition to the permissions that are granted by the
|
1957
|
+
# session policies.
|
1958
|
+
#
|
1959
|
+
# The plaintext that you use for both inline and managed session
|
1960
|
+
# policies can't exceed 2,048 characters. The JSON policy characters
|
1270
1961
|
# can be any ASCII character from the space character to the end of the
|
1271
|
-
# valid character list (\\u0020
|
1272
|
-
# (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
1962
|
+
# valid character list (\\u0020 through \\u00FF). It can also include
|
1963
|
+
# the tab (\\u0009), linefeed (\\u000A), and carriage return (\\u000D)
|
1273
1964
|
# characters.
|
1274
1965
|
#
|
1275
|
-
# <note markdown="1">
|
1276
|
-
#
|
1277
|
-
# separate limit.
|
1278
|
-
#
|
1279
|
-
#
|
1966
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
1967
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
1968
|
+
# format that has a separate limit. Your request can fail for this limit
|
1969
|
+
# even if your plaintext meets the other requirements. The
|
1970
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
1971
|
+
# the policies and tags for your request are to the upper size limit.
|
1280
1972
|
#
|
1281
1973
|
# </note>
|
1282
1974
|
#
|
1283
|
-
# For more information about how permissions work, see [Permissions for
|
1284
|
-
# GetFederationToken][1].
|
1285
1975
|
#
|
1286
1976
|
#
|
1977
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
1978
|
+
#
|
1979
|
+
# @option params [Array<Types::PolicyDescriptorType>] :policy_arns
|
1980
|
+
# The Amazon Resource Names (ARNs) of the IAM managed policies that you
|
1981
|
+
# want to use as a managed session policy. The policies must exist in
|
1982
|
+
# the same account as the IAM user that is requesting federated access.
|
1287
1983
|
#
|
1288
|
-
# [1]
|
1984
|
+
# You must pass an inline or managed [session policy][1] to this
|
1985
|
+
# operation. You can pass a single JSON policy document to use as an
|
1986
|
+
# inline session policy. You can also specify up to 10 managed policy
|
1987
|
+
# Amazon Resource Names (ARNs) to use as managed session policies. The
|
1988
|
+
# plaintext that you use for both inline and managed session policies
|
1989
|
+
# can't exceed 2,048 characters. You can provide up to 10 managed
|
1990
|
+
# policy ARNs. For more information about ARNs, see [Amazon Resource
|
1991
|
+
# Names (ARNs) and Amazon Web Services Service Namespaces][2] in the
|
1992
|
+
# Amazon Web Services General Reference.
|
1993
|
+
#
|
1994
|
+
# This parameter is optional. However, if you do not pass any session
|
1995
|
+
# policies, then the resulting federated user session has no
|
1996
|
+
# permissions.
|
1997
|
+
#
|
1998
|
+
# When you pass session policies, the session permissions are the
|
1999
|
+
# intersection of the IAM user policies and the session policies that
|
2000
|
+
# you pass. This gives you a way to further restrict the permissions for
|
2001
|
+
# a federated user. You cannot use session policies to grant more
|
2002
|
+
# permissions than those that are defined in the permissions policy of
|
2003
|
+
# the IAM user. For more information, see [Session Policies][1] in the
|
2004
|
+
# *IAM User Guide*.
|
2005
|
+
#
|
2006
|
+
# The resulting credentials can be used to access a resource that has a
|
2007
|
+
# resource-based policy. If that policy specifically references the
|
2008
|
+
# federated user session in the `Principal` element of the policy, the
|
2009
|
+
# session has the permissions allowed by the policy. These permissions
|
2010
|
+
# are granted in addition to the permissions that are granted by the
|
2011
|
+
# session policies.
|
2012
|
+
#
|
2013
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
2014
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
2015
|
+
# format that has a separate limit. Your request can fail for this limit
|
2016
|
+
# even if your plaintext meets the other requirements. The
|
2017
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
2018
|
+
# the policies and tags for your request are to the upper size limit.
|
2019
|
+
#
|
2020
|
+
# </note>
|
2021
|
+
#
|
2022
|
+
#
|
2023
|
+
#
|
2024
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
2025
|
+
# [2]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
1289
2026
|
#
|
1290
2027
|
# @option params [Integer] :duration_seconds
|
1291
2028
|
# The duration, in seconds, that the session should last. Acceptable
|
1292
2029
|
# durations for federation sessions range from 900 seconds (15 minutes)
|
1293
|
-
# to
|
1294
|
-
# default. Sessions obtained using
|
1295
|
-
# restricted to a maximum of
|
1296
|
-
# duration is longer than one hour, the session
|
1297
|
-
#
|
2030
|
+
# to 129,600 seconds (36 hours), with 43,200 seconds (12 hours) as the
|
2031
|
+
# default. Sessions obtained using Amazon Web Services account root user
|
2032
|
+
# credentials are restricted to a maximum of 3,600 seconds (one hour).
|
2033
|
+
# If the specified duration is longer than one hour, the session
|
2034
|
+
# obtained by using root user credentials defaults to one hour.
|
2035
|
+
#
|
2036
|
+
# @option params [Array<Types::Tag>] :tags
|
2037
|
+
# A list of session tags. Each session tag consists of a key name and an
|
2038
|
+
# associated value. For more information about session tags, see
|
2039
|
+
# [Passing Session Tags in STS][1] in the *IAM User Guide*.
|
2040
|
+
#
|
2041
|
+
# This parameter is optional. You can pass up to 50 session tags. The
|
2042
|
+
# plaintext session tag keys can’t exceed 128 characters and the values
|
2043
|
+
# can’t exceed 256 characters. For these and additional limits, see [IAM
|
2044
|
+
# and STS Character Limits][2] in the *IAM User Guide*.
|
2045
|
+
#
|
2046
|
+
# <note markdown="1"> An Amazon Web Services conversion compresses the passed inline session
|
2047
|
+
# policy, managed policy ARNs, and session tags into a packed binary
|
2048
|
+
# format that has a separate limit. Your request can fail for this limit
|
2049
|
+
# even if your plaintext meets the other requirements. The
|
2050
|
+
# `PackedPolicySize` response element indicates by percentage how close
|
2051
|
+
# the policies and tags for your request are to the upper size limit.
|
2052
|
+
#
|
2053
|
+
# </note>
|
2054
|
+
#
|
2055
|
+
# You can pass a session tag with the same key as a tag that is already
|
2056
|
+
# attached to the user you are federating. When you do, session tags
|
2057
|
+
# override a user tag with the same key.
|
2058
|
+
#
|
2059
|
+
# Tag key–value pairs are not case sensitive, but case is preserved.
|
2060
|
+
# This means that you cannot have separate `Department` and `department`
|
2061
|
+
# tag keys. Assume that the role has the `Department`=`Marketing` tag
|
2062
|
+
# and you pass the `department`=`engineering` session tag. `Department`
|
2063
|
+
# and `department` are not saved as separate tags, and the session tag
|
2064
|
+
# passed in the request takes precedence over the role tag.
|
2065
|
+
#
|
2066
|
+
#
|
2067
|
+
#
|
2068
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
2069
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
1298
2070
|
#
|
1299
2071
|
# @return [Types::GetFederationTokenResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1300
2072
|
#
|
@@ -1307,8 +2079,18 @@ module Aws::STS
|
|
1307
2079
|
#
|
1308
2080
|
# resp = client.get_federation_token({
|
1309
2081
|
# duration_seconds: 3600,
|
1310
|
-
# name: "
|
1311
|
-
# policy: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3
|
2082
|
+
# name: "testFedUserSession",
|
2083
|
+
# policy: "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Stmt1\",\"Effect\":\"Allow\",\"Action\":\"s3:ListAllMyBuckets\",\"Resource\":\"*\"}]}",
|
2084
|
+
# tags: [
|
2085
|
+
# {
|
2086
|
+
# key: "Project",
|
2087
|
+
# value: "Pegasus",
|
2088
|
+
# },
|
2089
|
+
# {
|
2090
|
+
# key: "Cost-Center",
|
2091
|
+
# value: "98765",
|
2092
|
+
# },
|
2093
|
+
# ],
|
1312
2094
|
# })
|
1313
2095
|
#
|
1314
2096
|
# resp.to_h outputs the following:
|
@@ -1323,7 +2105,7 @@ module Aws::STS
|
|
1323
2105
|
# arn: "arn:aws:sts::123456789012:federated-user/Bob",
|
1324
2106
|
# federated_user_id: "123456789012:Bob",
|
1325
2107
|
# },
|
1326
|
-
# packed_policy_size:
|
2108
|
+
# packed_policy_size: 8,
|
1327
2109
|
# }
|
1328
2110
|
#
|
1329
2111
|
# @example Request syntax with placeholder values
|
@@ -1331,7 +2113,18 @@ module Aws::STS
|
|
1331
2113
|
# resp = client.get_federation_token({
|
1332
2114
|
# name: "userNameType", # required
|
1333
2115
|
# policy: "sessionPolicyDocumentType",
|
2116
|
+
# policy_arns: [
|
2117
|
+
# {
|
2118
|
+
# arn: "arnType",
|
2119
|
+
# },
|
2120
|
+
# ],
|
1334
2121
|
# duration_seconds: 1,
|
2122
|
+
# tags: [
|
2123
|
+
# {
|
2124
|
+
# key: "tagKeyType", # required
|
2125
|
+
# value: "tagValueType", # required
|
2126
|
+
# },
|
2127
|
+
# ],
|
1335
2128
|
# })
|
1336
2129
|
#
|
1337
2130
|
# @example Response structure
|
@@ -1353,72 +2146,89 @@ module Aws::STS
|
|
1353
2146
|
req.send_request(options)
|
1354
2147
|
end
|
1355
2148
|
|
1356
|
-
# Returns a set of temporary credentials for an
|
1357
|
-
# The credentials consist of an access key ID, a
|
1358
|
-
# a security token. Typically, you use
|
1359
|
-
# use MFA to protect programmatic calls
|
1360
|
-
#
|
2149
|
+
# Returns a set of temporary credentials for an Amazon Web Services
|
2150
|
+
# account or IAM user. The credentials consist of an access key ID, a
|
2151
|
+
# secret access key, and a security token. Typically, you use
|
2152
|
+
# `GetSessionToken` if you want to use MFA to protect programmatic calls
|
2153
|
+
# to specific Amazon Web Services API operations like Amazon EC2
|
2154
|
+
# `StopInstances`. MFA-enabled IAM users would need to call
|
1361
2155
|
# `GetSessionToken` and submit an MFA code that is associated with their
|
1362
2156
|
# MFA device. Using the temporary security credentials that are returned
|
1363
|
-
# from the call, IAM users can then make programmatic calls to
|
1364
|
-
# require MFA authentication. If you do not supply a
|
1365
|
-
# then the API returns an access denied error. For a
|
1366
|
-
# `GetSessionToken` with the other
|
1367
|
-
# credentials, see [Requesting Temporary Security
|
1368
|
-
# [Comparing the
|
1369
|
-
#
|
1370
|
-
#
|
1371
|
-
#
|
1372
|
-
#
|
1373
|
-
#
|
1374
|
-
#
|
1375
|
-
#
|
1376
|
-
#
|
1377
|
-
#
|
2157
|
+
# from the call, IAM users can then make programmatic calls to API
|
2158
|
+
# operations that require MFA authentication. If you do not supply a
|
2159
|
+
# correct MFA code, then the API returns an access denied error. For a
|
2160
|
+
# comparison of `GetSessionToken` with the other API operations that
|
2161
|
+
# produce temporary credentials, see [Requesting Temporary Security
|
2162
|
+
# Credentials][1] and [Comparing the Amazon Web Services STS API
|
2163
|
+
# operations][2] in the *IAM User Guide*.
|
2164
|
+
#
|
2165
|
+
# <note markdown="1"> No permissions are required for users to perform this operation. The
|
2166
|
+
# purpose of the `sts:GetSessionToken` operation is to authenticate the
|
2167
|
+
# user using MFA. You cannot use policies to control authentication
|
2168
|
+
# operations. For more information, see [Permissions for
|
2169
|
+
# GetSessionToken][3] in the *IAM User Guide*.
|
2170
|
+
#
|
2171
|
+
# </note>
|
2172
|
+
#
|
2173
|
+
# **Session Duration**
|
2174
|
+
#
|
2175
|
+
# The `GetSessionToken` operation must be called by using the long-term
|
2176
|
+
# Amazon Web Services security credentials of the Amazon Web Services
|
2177
|
+
# account root user or an IAM user. Credentials that are created by IAM
|
2178
|
+
# users are valid for the duration that you specify. This duration can
|
2179
|
+
# range from 900 seconds (15 minutes) up to a maximum of 129,600 seconds
|
2180
|
+
# (36 hours), with a default of 43,200 seconds (12 hours). Credentials
|
2181
|
+
# based on account credentials can range from 900 seconds (15 minutes)
|
2182
|
+
# up to 3,600 seconds (1 hour), with a default of 1 hour.
|
2183
|
+
#
|
2184
|
+
# **Permissions**
|
1378
2185
|
#
|
1379
2186
|
# The temporary security credentials created by `GetSessionToken` can be
|
1380
|
-
# used to make API calls to any
|
1381
|
-
# exceptions:
|
2187
|
+
# used to make API calls to any Amazon Web Services service with the
|
2188
|
+
# following exceptions:
|
1382
2189
|
#
|
1383
|
-
# * You cannot call any IAM
|
1384
|
-
# is included in the request.
|
2190
|
+
# * You cannot call any IAM API operations unless MFA authentication
|
2191
|
+
# information is included in the request.
|
1385
2192
|
#
|
1386
2193
|
# * You cannot call any STS API *except* `AssumeRole` or
|
1387
2194
|
# `GetCallerIdentity`.
|
1388
2195
|
#
|
1389
|
-
# <note markdown="1"> We recommend that you do not call `GetSessionToken` with
|
1390
|
-
# credentials. Instead, follow our [best
|
1391
|
-
# or more IAM users, giving them the
|
1392
|
-
# IAM users for everyday interaction
|
2196
|
+
# <note markdown="1"> We recommend that you do not call `GetSessionToken` with Amazon Web
|
2197
|
+
# Services account root user credentials. Instead, follow our [best
|
2198
|
+
# practices][4] by creating one or more IAM users, giving them the
|
2199
|
+
# necessary permissions, and using IAM users for everyday interaction
|
2200
|
+
# with Amazon Web Services.
|
1393
2201
|
#
|
1394
2202
|
# </note>
|
1395
2203
|
#
|
1396
|
-
# The
|
1397
|
-
#
|
1398
|
-
#
|
1399
|
-
#
|
1400
|
-
#
|
1401
|
-
#
|
1402
|
-
#
|
2204
|
+
# The credentials that are returned by `GetSessionToken` are based on
|
2205
|
+
# permissions associated with the user whose credentials were used to
|
2206
|
+
# call the operation. If `GetSessionToken` is called using Amazon Web
|
2207
|
+
# Services account root user credentials, the temporary credentials have
|
2208
|
+
# root user permissions. Similarly, if `GetSessionToken` is called using
|
2209
|
+
# the credentials of an IAM user, the temporary credentials have the
|
2210
|
+
# same permissions as the IAM user.
|
1403
2211
|
#
|
1404
2212
|
# For more information about using `GetSessionToken` to create temporary
|
1405
2213
|
# credentials, go to [Temporary Credentials for Users in Untrusted
|
1406
|
-
# Environments][
|
2214
|
+
# Environments][5] in the *IAM User Guide*.
|
1407
2215
|
#
|
1408
2216
|
#
|
1409
2217
|
#
|
1410
|
-
# [1]:
|
1411
|
-
# [2]:
|
1412
|
-
# [3]:
|
1413
|
-
# [4]:
|
2218
|
+
# [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
2219
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison
|
2220
|
+
# [3]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html
|
2221
|
+
# [4]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users
|
2222
|
+
# [5]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken
|
1414
2223
|
#
|
1415
2224
|
# @option params [Integer] :duration_seconds
|
1416
2225
|
# The duration, in seconds, that the credentials should remain valid.
|
1417
2226
|
# Acceptable durations for IAM user sessions range from 900 seconds (15
|
1418
|
-
# minutes) to
|
1419
|
-
# as the default. Sessions for
|
1420
|
-
# maximum of
|
1421
|
-
# hour, the session for
|
2227
|
+
# minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12 hours)
|
2228
|
+
# as the default. Sessions for Amazon Web Services account owners are
|
2229
|
+
# restricted to a maximum of 3,600 seconds (one hour). If the duration
|
2230
|
+
# is longer than one hour, the session for Amazon Web Services account
|
2231
|
+
# owners defaults to one hour.
|
1422
2232
|
#
|
1423
2233
|
# @option params [String] :serial_number
|
1424
2234
|
# The identification number of the MFA device that is associated with
|
@@ -1427,10 +2237,10 @@ module Aws::STS
|
|
1427
2237
|
# The value is either the serial number for a hardware device (such as
|
1428
2238
|
# `GAHT12345678`) or an Amazon Resource Name (ARN) for a virtual device
|
1429
2239
|
# (such as `arn:aws:iam::123456789012:mfa/user`). You can find the
|
1430
|
-
# device for an IAM user by going to the
|
1431
|
-
# viewing the user's security credentials.
|
2240
|
+
# device for an IAM user by going to the Amazon Web Services Management
|
2241
|
+
# Console and viewing the user's security credentials.
|
1432
2242
|
#
|
1433
|
-
# The regex used to
|
2243
|
+
# The regex used to validate this parameter is a string of characters
|
1434
2244
|
# consisting of upper- and lower-case alphanumeric characters with no
|
1435
2245
|
# spaces. You can also include underscores or any of the following
|
1436
2246
|
# characters: =,.@:/-
|
@@ -1438,9 +2248,9 @@ module Aws::STS
|
|
1438
2248
|
# @option params [String] :token_code
|
1439
2249
|
# The value provided by the MFA device, if MFA is required. If any
|
1440
2250
|
# policy requires the IAM user to submit an MFA code, specify this
|
1441
|
-
# value. If MFA authentication is required,
|
1442
|
-
#
|
1443
|
-
#
|
2251
|
+
# value. If MFA authentication is required, the user must provide a code
|
2252
|
+
# when requesting a set of temporary security credentials. A user who
|
2253
|
+
# fails to provide the code receives an "access denied" response when
|
1444
2254
|
# requesting resources that require MFA authentication.
|
1445
2255
|
#
|
1446
2256
|
# The format for this parameter, as described by its regex pattern, is a
|
@@ -1506,7 +2316,7 @@ module Aws::STS
|
|
1506
2316
|
params: params,
|
1507
2317
|
config: config)
|
1508
2318
|
context[:gem_name] = 'aws-sdk-core'
|
1509
|
-
context[:gem_version] = '3.
|
2319
|
+
context[:gem_version] = '3.168.4'
|
1510
2320
|
Seahorse::Client::Request.new(handlers, context)
|
1511
2321
|
end
|
1512
2322
|
|