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