aws-sdk-core 2.3.23 → 3.89.1

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