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