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