aws-sdk-core 2.3.23 → 3.89.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/VERSION +1 -0
- data/ca-bundle.crt +3615 -3541
- data/lib/aws-sdk-core.rb +106 -404
- data/lib/aws-sdk-core/arn.rb +77 -0
- data/lib/aws-sdk-core/arn_parser.rb +38 -0
- data/lib/aws-sdk-core/assume_role_web_identity_credentials.rb +101 -0
- 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 +49 -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 +0 -29
- data/lib/aws-sdk-core/credential_provider_chain.rb +56 -6
- data/lib/aws-sdk-core/deprecations.rb +16 -10
- data/lib/aws-sdk-core/ecs_credentials.rb +14 -10
- data/lib/aws-sdk-core/endpoint_cache.rb +191 -0
- data/lib/aws-sdk-core/errors.rb +221 -11
- data/lib/aws-sdk-core/event_emitter.rb +62 -0
- data/lib/aws-sdk-core/ini_parser.rb +41 -0
- data/lib/aws-sdk-core/instance_profile_credentials.rb +133 -42
- data/lib/aws-sdk-core/json.rb +9 -10
- 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/formatter.rb +7 -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 +60 -26
- 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 +280 -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 +48 -19
- data/lib/aws-sdk-core/plugins/response_paging.rb +5 -18
- data/lib/aws-sdk-core/plugins/retry_errors.rb +102 -24
- 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 -10
- data/lib/aws-sdk-core/process_credentials.rb +80 -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 +451 -0
- data/lib/aws-sdk-core/shared_credentials.rb +16 -53
- data/lib/aws-sdk-core/structure.rb +22 -13
- 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 +3 -2
- 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 +2156 -0
- data/lib/aws-sdk-sts/client_api.rb +336 -0
- data/lib/aws-sdk-sts/customizations.rb +2 -0
- data/lib/aws-sdk-sts/errors.rb +142 -0
- data/lib/aws-sdk-sts/plugins/sts_regional_endpoints.rb +32 -0
- data/lib/aws-sdk-sts/presigner.rb +67 -0
- data/lib/aws-sdk-sts/resource.rb +23 -0
- data/lib/aws-sdk-sts/types.rb +1504 -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 +5 -9
- data/lib/seahorse/client/configuration.rb +10 -2
- data/lib/seahorse/client/events.rb +1 -1
- data/lib/seahorse/client/h2/connection.rb +246 -0
- data/lib/seahorse/client/h2/handler.rb +151 -0
- data/lib/seahorse/client/handler_list_entry.rb +2 -2
- data/lib/seahorse/client/http/async_response.rb +42 -0
- data/lib/seahorse/client/http/response.rb +13 -8
- data/lib/seahorse/client/logging/formatter.rb +7 -1
- data/lib/seahorse/client/logging/handler.rb +2 -0
- data/lib/seahorse/client/net_http/connection_pool.rb +46 -28
- data/lib/seahorse/client/net_http/handler.rb +17 -3
- 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 +67 -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 +127 -360
- 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 -1819
- 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 -1742
- 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 -67
- 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
data/lib/aws-sdk-core/errors.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
require 'thread'
|
2
|
-
|
3
1
|
module Aws
|
4
|
-
|
5
|
-
# Each Service module has its own Errors module, e.g. {S3::Errors}.
|
6
2
|
module Errors
|
7
3
|
|
4
|
+
class NonSupportedRubyVersionError < RuntimeError; end
|
5
|
+
|
8
6
|
# The base class for all errors returned by an Amazon Web Service.
|
9
7
|
# All ~400 level client errors and ~500 level server errors are raised
|
10
8
|
# as service errors. This indicates it was an error returned from the
|
@@ -13,9 +11,12 @@ module Aws
|
|
13
11
|
|
14
12
|
# @param [Seahorse::Client::RequestContext] context
|
15
13
|
# @param [String] message
|
16
|
-
|
14
|
+
# @param [Aws::Structure] data
|
15
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
17
16
|
@code = self.class.code
|
17
|
+
@message = message if message && !message.empty?
|
18
18
|
@context = context
|
19
|
+
@data = data
|
19
20
|
super(message)
|
20
21
|
end
|
21
22
|
|
@@ -26,6 +27,9 @@ module Aws
|
|
26
27
|
# that triggered the remote service to return this error.
|
27
28
|
attr_reader :context
|
28
29
|
|
30
|
+
# @return [Aws::Structure]
|
31
|
+
attr_reader :data
|
32
|
+
|
29
33
|
class << self
|
30
34
|
|
31
35
|
# @return [String]
|
@@ -34,20 +38,222 @@ module Aws
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
41
|
+
# Raised when InstanceProfileCredentialsProvider or
|
42
|
+
# EcsCredentialsProvider fails to parse the metadata response after retries
|
43
|
+
class MetadataParserError < RuntimeError
|
44
|
+
def initialize(*args)
|
45
|
+
msg = "Failed to parse metadata service response."
|
46
|
+
super(msg)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Raised when a `streaming` operation has `requiresLength` trait
|
51
|
+
# enabled but request payload size/length cannot be calculated
|
52
|
+
class MissingContentLength < RuntimeError
|
53
|
+
def initialize(*args)
|
54
|
+
msg = 'Required `Content-Length` value missing for the request.'
|
55
|
+
super(msg)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Rasied when endpoint discovery failed for operations
|
60
|
+
# that requires endpoints from endpoint discovery
|
61
|
+
class EndpointDiscoveryError < RuntimeError
|
62
|
+
def initialize(*args)
|
63
|
+
msg = 'Endpoint discovery failed for the operation or discovered endpoint is not working, '\
|
64
|
+
'request will keep failing until endpoint discovery succeeds or :endpoint option is provided.'
|
65
|
+
super(msg)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# raised when hostLabel member is not provided
|
70
|
+
# at operation input when endpoint trait is available
|
71
|
+
# with 'hostPrefix' requirement
|
72
|
+
class MissingEndpointHostLabelValue < RuntimeError
|
73
|
+
|
74
|
+
def initialize(name)
|
75
|
+
msg = "Missing required parameter #{name} to construct"\
|
76
|
+
" endpoint host prefix. You can disable host prefix by"\
|
77
|
+
" setting :disable_host_prefix_injection to `true`."
|
78
|
+
super(msg)
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
# Raised when attempting to #signal an event before
|
84
|
+
# making an async request
|
85
|
+
class SignalEventError < RuntimeError; end
|
86
|
+
|
87
|
+
# Raised when EventStream Parser failed to parse
|
88
|
+
# a raw event message
|
89
|
+
class EventStreamParserError < RuntimeError; end
|
90
|
+
|
91
|
+
# Raise when EventStream Builder failed to build
|
92
|
+
# an event message with parameters provided
|
93
|
+
class EventStreamBuilderError < RuntimeError; end
|
94
|
+
|
95
|
+
# Error event in an event stream which has event_type :error
|
96
|
+
# error code and error message can be retrieved when available.
|
97
|
+
#
|
98
|
+
# example usage:
|
99
|
+
#
|
100
|
+
# client.stream_foo(name: 'bar') do |event|
|
101
|
+
# stream.on_error_event do |event|
|
102
|
+
# puts "Error #{event.error_code}: #{event.error_message}"
|
103
|
+
# raise event
|
104
|
+
# end
|
105
|
+
# end
|
106
|
+
#
|
107
|
+
class EventError < RuntimeError
|
108
|
+
|
109
|
+
def initialize(event_type, code, message)
|
110
|
+
@event_type = event_type
|
111
|
+
@error_code = code
|
112
|
+
@error_message = message
|
113
|
+
end
|
114
|
+
|
115
|
+
# @return [Symbol]
|
116
|
+
attr_reader :event_type
|
117
|
+
|
118
|
+
# @return [String]
|
119
|
+
attr_reader :error_code
|
120
|
+
|
121
|
+
# @return [String]
|
122
|
+
attr_reader :error_message
|
123
|
+
|
124
|
+
end
|
125
|
+
|
126
|
+
# Raised when ARN string input doesn't follow the standard:
|
127
|
+
# https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-arns
|
128
|
+
class InvalidARNError < RuntimeError; end
|
129
|
+
|
130
|
+
# Raised when the region from the ARN string is different from the :region
|
131
|
+
# configured on the service client.
|
132
|
+
class InvalidARNRegionError < RuntimeError
|
133
|
+
def initialize(*args)
|
134
|
+
msg = 'ARN region is different from the configured client region.'
|
135
|
+
super(msg)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
# Raised when the partition of the ARN region is different than the
|
140
|
+
# partition of the :region configured on the service client.
|
141
|
+
class InvalidARNPartitionError < RuntimeError
|
142
|
+
def initialize(*args)
|
143
|
+
msg = 'ARN region partition is different from the configured '\
|
144
|
+
'client region partition.'
|
145
|
+
super(msg)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
37
149
|
# Various plugins perform client-side checksums of responses.
|
38
150
|
# This error indicates a checksum failed.
|
39
151
|
class ChecksumError < RuntimeError; end
|
40
152
|
|
41
|
-
# Raised when a
|
153
|
+
# Raised when a client is constructed and the specified shared
|
42
154
|
# credentials profile does not exist.
|
43
155
|
class NoSuchProfileError < RuntimeError; end
|
44
156
|
|
45
|
-
# Raised when a
|
157
|
+
# Raised when a client is constructed, where Assume Role credentials are
|
158
|
+
# expected, and there is no source profile specified.
|
159
|
+
class NoSourceProfileError < RuntimeError; end
|
160
|
+
|
161
|
+
# Raised when a client is constructed with Assume Role credentials using
|
162
|
+
# a credential_source, and that source type is unsupported.
|
163
|
+
class InvalidCredentialSourceError < RuntimeError; end
|
164
|
+
|
165
|
+
# Raised when a client is constructed with Assume Role credentials, but
|
166
|
+
# the profile has both source_profile and credential_source.
|
167
|
+
class CredentialSourceConflictError < RuntimeError; end
|
168
|
+
|
169
|
+
# Raised when a client is constructed with Assume Role credentials using
|
170
|
+
# a credential_source, and that source doesn't provide credentials.
|
171
|
+
class NoSourceCredentialsError < RuntimeError; end
|
172
|
+
|
173
|
+
# Raised when a client is constructed and credentials are not
|
46
174
|
# set, or the set credentials are empty.
|
47
|
-
class MissingCredentialsError < RuntimeError
|
175
|
+
class MissingCredentialsError < RuntimeError
|
176
|
+
def initialize(*args)
|
177
|
+
msg = 'unable to sign request without credentials set'
|
178
|
+
super(msg)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Raised when :web_identity_token_file parameter is not
|
183
|
+
# provided or the file doesn't exist when initializing
|
184
|
+
# AssumeRoleWebIdentityCredentials credential provider
|
185
|
+
class MissingWebIdentityTokenFile < RuntimeError
|
186
|
+
def initialize(*args)
|
187
|
+
msg = 'Missing :web_identity_token_file parameter or'\
|
188
|
+
' invalid file path provided for'\
|
189
|
+
' Aws::AssumeRoleWebIdentityCredentials provider'
|
190
|
+
super(msg)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Raised when a credentials provider process returns a JSON
|
195
|
+
# payload with either invalid version number or malformed contents
|
196
|
+
class InvalidProcessCredentialsPayload < RuntimeError; end
|
197
|
+
|
198
|
+
# Raised when a client is constructed and region is not specified.
|
199
|
+
class MissingRegionError < ArgumentError
|
200
|
+
def initialize(*args)
|
201
|
+
msg = "missing region; use :region option or "
|
202
|
+
msg << "export region name to ENV['AWS_REGION']"
|
203
|
+
super(msg)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
# Raised when attempting to connect to an endpoint and a `SocketError`
|
208
|
+
# is received from the HTTP client. This error is typically the result
|
209
|
+
# of configuring an invalid `:region`.
|
210
|
+
class NoSuchEndpointError < RuntimeError
|
211
|
+
|
212
|
+
def initialize(options = {})
|
213
|
+
@context = options[:context]
|
214
|
+
@endpoint = @context.http_request.endpoint
|
215
|
+
@original_error = options[:original_error]
|
216
|
+
super(<<-MSG)
|
217
|
+
Encountered a `SocketError` while attempting to connect to:
|
48
218
|
|
49
|
-
|
50
|
-
|
219
|
+
#{endpoint.to_s}
|
220
|
+
|
221
|
+
This is typically the result of an invalid `:region` option or a
|
222
|
+
poorly formatted `:endpoint` option.
|
223
|
+
|
224
|
+
* Avoid configuring the `:endpoint` option directly. Endpoints are constructed
|
225
|
+
from the `:region`. The `:endpoint` option is reserved for connecting to
|
226
|
+
non-standard test endpoints.
|
227
|
+
|
228
|
+
* Not every service is available in every region.
|
229
|
+
|
230
|
+
* Never suffix region names with availability zones.
|
231
|
+
Use "us-east-1", not "us-east-1a"
|
232
|
+
|
233
|
+
Known AWS regions include (not specific to this service):
|
234
|
+
|
235
|
+
#{possible_regions}
|
236
|
+
MSG
|
237
|
+
end
|
238
|
+
|
239
|
+
attr_reader :context
|
240
|
+
|
241
|
+
attr_reader :endpoint
|
242
|
+
|
243
|
+
attr_reader :original_error
|
244
|
+
|
245
|
+
private
|
246
|
+
|
247
|
+
def possible_regions
|
248
|
+
Aws.partitions.inject([]) do |region_names, partition|
|
249
|
+
partition.regions.each do |region|
|
250
|
+
region_names << region.name
|
251
|
+
end
|
252
|
+
region_names
|
253
|
+
end.join("\n")
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
51
257
|
|
52
258
|
# This module is mixed into another module, providing dynamic
|
53
259
|
# error classes. Error classes all inherit from {ServiceError}.
|
@@ -82,7 +288,11 @@ module Aws
|
|
82
288
|
def error_class(error_code)
|
83
289
|
constant = error_class_constant(error_code)
|
84
290
|
if error_const_set?(constant)
|
85
|
-
|
291
|
+
# modeled error class exist
|
292
|
+
# set code attribute
|
293
|
+
err_class = const_get(constant)
|
294
|
+
err_class.code = constant.to_s
|
295
|
+
err_class
|
86
296
|
else
|
87
297
|
set_error_constant(constant)
|
88
298
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
module Aws
|
2
|
+
class EventEmitter
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@listeners = {}
|
6
|
+
@validate_event = true
|
7
|
+
@status = :sleep
|
8
|
+
@signal_queue = Queue.new
|
9
|
+
end
|
10
|
+
|
11
|
+
attr_accessor :stream
|
12
|
+
|
13
|
+
attr_accessor :encoder
|
14
|
+
|
15
|
+
attr_accessor :validate_event
|
16
|
+
|
17
|
+
attr_accessor :signal_queue
|
18
|
+
|
19
|
+
def on(type, callback)
|
20
|
+
(@listeners[type] ||= []) << callback
|
21
|
+
end
|
22
|
+
|
23
|
+
def signal(type, event)
|
24
|
+
return unless @listeners[type]
|
25
|
+
@listeners[type].each do |listener|
|
26
|
+
listener.call(event) if event.event_type == type
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def emit(type, params)
|
31
|
+
unless @stream
|
32
|
+
raise Aws::Errors::SignalEventError.new(
|
33
|
+
"Singaling events before making async request"\
|
34
|
+
" is not allowed."
|
35
|
+
)
|
36
|
+
end
|
37
|
+
if @validate_event && type != :end_stream
|
38
|
+
Aws::ParamValidator.validate!(
|
39
|
+
@encoder.rules.shape.member(type), params)
|
40
|
+
end
|
41
|
+
_ready_for_events?
|
42
|
+
@stream.data(
|
43
|
+
@encoder.encode(type, params),
|
44
|
+
end_stream: type == :end_stream
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def _ready_for_events?
|
51
|
+
return true if @status == :ready
|
52
|
+
|
53
|
+
# blocked until once initial 200 response is received
|
54
|
+
# signal will be available in @signal_queue
|
55
|
+
# and this check will no longer be blocked
|
56
|
+
@signal_queue.pop
|
57
|
+
@status = :ready
|
58
|
+
true
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Aws
|
2
|
+
# @api private
|
3
|
+
class IniParser
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def ini_parse(raw)
|
7
|
+
current_profile = nil
|
8
|
+
current_prefix = nil
|
9
|
+
raw.lines.inject({}) do |acc, line|
|
10
|
+
line = line.split(/^|\s;/).first # remove comments
|
11
|
+
profile = line.match(/^\[([^\[\]]+)\]\s*(#.+)?$/) unless line.nil?
|
12
|
+
if profile
|
13
|
+
current_profile = profile[1]
|
14
|
+
named_profile = current_profile.match(/^profile\s+(.+?)$/)
|
15
|
+
current_profile = named_profile[1] if named_profile
|
16
|
+
elsif current_profile
|
17
|
+
unless line.nil?
|
18
|
+
item = line.match(/^(.+?)\s*=\s*(.+?)\s*$/)
|
19
|
+
prefix = line.match(/^(.+?)\s*=\s*$/)
|
20
|
+
end
|
21
|
+
if item && item[1].match(/^\s+/)
|
22
|
+
# Need to add lines to a nested configuration.
|
23
|
+
inner_item = line.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/)
|
24
|
+
acc[current_profile] ||= {}
|
25
|
+
acc[current_profile][current_prefix] ||= {}
|
26
|
+
acc[current_profile][current_prefix][inner_item[1]] = inner_item[2]
|
27
|
+
elsif item
|
28
|
+
current_prefix = nil
|
29
|
+
acc[current_profile] ||= {}
|
30
|
+
acc[current_profile][item[1]] = item[2]
|
31
|
+
elsif prefix
|
32
|
+
current_prefix = prefix[1]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
acc
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -11,6 +11,12 @@ module Aws
|
|
11
11
|
# @api private
|
12
12
|
class Non200Response < RuntimeError; end
|
13
13
|
|
14
|
+
# @api private
|
15
|
+
class TokenRetrivalError < RuntimeError; end
|
16
|
+
|
17
|
+
# @api private
|
18
|
+
class TokenExpiredError < RuntimeError; end
|
19
|
+
|
14
20
|
# These are the errors we trap when attempting to talk to the
|
15
21
|
# instance metadata service. Any of these imply the service
|
16
22
|
# is not present, no responding or some other non-recoverable
|
@@ -23,16 +29,24 @@ module Aws
|
|
23
29
|
Errno::ENETUNREACH,
|
24
30
|
SocketError,
|
25
31
|
Timeout::Error,
|
26
|
-
Non200Response
|
27
|
-
]
|
32
|
+
Non200Response
|
33
|
+
].freeze
|
34
|
+
|
35
|
+
# Path base for GET request for profile and credentials
|
36
|
+
# @api private
|
37
|
+
METADATA_PATH_BASE = '/latest/meta-data/iam/security-credentials/'.freeze
|
38
|
+
|
39
|
+
# Path for PUT request for token
|
40
|
+
# @api private
|
41
|
+
METADATA_TOKEN_PATH = '/latest/api/token'.freeze
|
28
42
|
|
29
43
|
# @param [Hash] options
|
30
|
-
# @option options [Integer] :retries (
|
44
|
+
# @option options [Integer] :retries (1) Number of times to retry
|
31
45
|
# when retrieving credentials.
|
32
46
|
# @option options [String] :ip_address ('169.254.169.254')
|
33
47
|
# @option options [Integer] :port (80)
|
34
|
-
# @option options [Float] :http_open_timeout (
|
35
|
-
# @option options [Float] :http_read_timeout (
|
48
|
+
# @option options [Float] :http_open_timeout (1)
|
49
|
+
# @option options [Float] :http_read_timeout (1)
|
36
50
|
# @option options [Numeric, Proc] :delay By default, failures are retried
|
37
51
|
# with exponential back-off, i.e. `sleep(1.2 ** num_failures)`. You can
|
38
52
|
# pass a number of seconds to sleep between failed attempts, or
|
@@ -40,19 +54,25 @@ module Aws
|
|
40
54
|
# @option options [IO] :http_debug_output (nil) HTTP wire
|
41
55
|
# traces are sent to this object. You can specify something
|
42
56
|
# like $stdout.
|
43
|
-
|
44
|
-
|
57
|
+
# @option options [Integer] :token_ttl Time-to-Live in seconds for EC2
|
58
|
+
# Metadata Token used for fetching Metadata Profile Credentials, defaults
|
59
|
+
# to 21600 seconds
|
60
|
+
def initialize(options = {})
|
61
|
+
@retries = options[:retries] || 1
|
45
62
|
@ip_address = options[:ip_address] || '169.254.169.254'
|
46
63
|
@port = options[:port] || 80
|
47
|
-
@http_open_timeout = options[:http_open_timeout] ||
|
48
|
-
@http_read_timeout = options[:http_read_timeout] ||
|
64
|
+
@http_open_timeout = options[:http_open_timeout] || 1
|
65
|
+
@http_read_timeout = options[:http_read_timeout] || 1
|
49
66
|
@http_debug_output = options[:http_debug_output]
|
50
67
|
@backoff = backoff(options[:backoff])
|
68
|
+
@token_ttl = options[:token_ttl] || 21_600
|
69
|
+
@token = nil
|
51
70
|
super
|
52
71
|
end
|
53
72
|
|
54
|
-
# @return [Integer]
|
55
|
-
#
|
73
|
+
# @return [Integer] Number of times to retry when retrieving credentials
|
74
|
+
# from the instance metadata service. Defaults to 0 when resolving from
|
75
|
+
# the default credential chain ({Aws::CredentialProviderChain}).
|
56
76
|
attr_reader :retries
|
57
77
|
|
58
78
|
private
|
@@ -60,8 +80,8 @@ module Aws
|
|
60
80
|
def backoff(backoff)
|
61
81
|
case backoff
|
62
82
|
when Proc then backoff
|
63
|
-
when Numeric then
|
64
|
-
else
|
83
|
+
when Numeric then ->(_) { sleep(backoff) }
|
84
|
+
else ->(num_failures) { Kernel.sleep(1.2**num_failures) }
|
65
85
|
end
|
66
86
|
end
|
67
87
|
|
@@ -69,33 +89,67 @@ module Aws
|
|
69
89
|
# Retry loading credentials up to 3 times is the instance metadata
|
70
90
|
# service is responding but is returning invalid JSON documents
|
71
91
|
# in response to the GET profile credentials call.
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
92
|
+
begin
|
93
|
+
retry_errors([JSON::ParserError, StandardError], max_retries: 3) do
|
94
|
+
c = JSON.parse(get_credentials.to_s)
|
95
|
+
@credentials = Credentials.new(
|
96
|
+
c['AccessKeyId'],
|
97
|
+
c['SecretAccessKey'],
|
98
|
+
c['Token']
|
99
|
+
)
|
100
|
+
@expiration = c['Expiration'] ? Time.iso8601(c['Expiration']) : nil
|
101
|
+
end
|
102
|
+
rescue JSON::ParserError
|
103
|
+
raise Aws::Errors::MetadataParserError
|
80
104
|
end
|
81
105
|
end
|
82
106
|
|
83
107
|
def get_credentials
|
84
108
|
# Retry loading credentials a configurable number of times if
|
85
109
|
# the instance metadata service is not responding.
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
110
|
+
if _metadata_disabled?
|
111
|
+
'{}'
|
112
|
+
else
|
113
|
+
begin
|
114
|
+
retry_errors(NETWORK_ERRORS, max_retries: @retries) do
|
115
|
+
open_connection do |conn|
|
116
|
+
# attempt to fetch token to start secure flow first
|
117
|
+
# and rescue to failover
|
118
|
+
begin
|
119
|
+
retry_errors(NETWORK_ERRORS, max_retries: @retries) do
|
120
|
+
unless token_set?
|
121
|
+
token_value, ttl = http_put(
|
122
|
+
conn, METADATA_TOKEN_PATH, @token_ttl
|
123
|
+
)
|
124
|
+
@token = Token.new(token_value, ttl) if token_value && ttl
|
125
|
+
end
|
126
|
+
end
|
127
|
+
rescue *NETWORK_ERRORS
|
128
|
+
# token attempt failed, reset token
|
129
|
+
# fallback to non-token mode
|
130
|
+
@token = nil
|
131
|
+
end
|
132
|
+
|
133
|
+
token = @token.value if token_set?
|
134
|
+
metadata = http_get(conn, METADATA_PATH_BASE, token)
|
135
|
+
profile_name = metadata.lines.first.strip
|
136
|
+
http_get(conn, METADATA_PATH_BASE + profile_name, token)
|
137
|
+
end
|
92
138
|
end
|
139
|
+
rescue
|
140
|
+
'{}'
|
93
141
|
end
|
94
|
-
rescue
|
95
|
-
'{}'
|
96
142
|
end
|
97
143
|
end
|
98
144
|
|
145
|
+
def token_set?
|
146
|
+
@token && !@token.expired?
|
147
|
+
end
|
148
|
+
|
149
|
+
def _metadata_disabled?
|
150
|
+
ENV.fetch('AWS_EC2_METADATA_DISABLED', 'false').downcase == 'true'
|
151
|
+
end
|
152
|
+
|
99
153
|
def open_connection
|
100
154
|
http = Net::HTTP.new(@ip_address, @port, nil)
|
101
155
|
http.open_timeout = @http_open_timeout
|
@@ -105,30 +159,67 @@ module Aws
|
|
105
159
|
yield(http).tap { http.finish }
|
106
160
|
end
|
107
161
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
162
|
+
# GET request fetch profile and credentials
|
163
|
+
def http_get(connection, path, token = nil)
|
164
|
+
headers = { 'User-Agent' => "aws-sdk-ruby3/#{CORE_GEM_VERSION}" }
|
165
|
+
headers['x-aws-ec2-metadata-token'] = token if token
|
166
|
+
response = connection.request(Net::HTTP::Get.new(path, headers))
|
167
|
+
raise Non200Response unless response.code.to_i == 200
|
168
|
+
|
169
|
+
response.body
|
170
|
+
end
|
171
|
+
|
172
|
+
# PUT request fetch token with ttl
|
173
|
+
def http_put(connection, path, ttl)
|
174
|
+
headers = {
|
175
|
+
'User-Agent' => "aws-sdk-ruby3/#{CORE_GEM_VERSION}",
|
176
|
+
'x-aws-ec2-metadata-token-ttl-seconds' => ttl.to_s
|
177
|
+
}
|
178
|
+
response = connection.request(Net::HTTP::Put.new(path, headers))
|
179
|
+
case response.code.to_i
|
180
|
+
when 200
|
181
|
+
[
|
182
|
+
response.body,
|
183
|
+
response.header['x-aws-ec2-metadata-token-ttl-seconds'].to_i
|
184
|
+
]
|
185
|
+
when 400
|
186
|
+
raise TokenRetrivalError
|
187
|
+
when 401
|
188
|
+
raise TokenExpiredError
|
112
189
|
else
|
113
190
|
raise Non200Response
|
114
191
|
end
|
115
192
|
end
|
116
193
|
|
117
|
-
def retry_errors(error_classes, options = {}, &
|
194
|
+
def retry_errors(error_classes, options = {}, &_block)
|
118
195
|
max_retries = options[:max_retries]
|
119
196
|
retries = 0
|
120
197
|
begin
|
121
198
|
yield
|
122
|
-
rescue *error_classes
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
raise
|
129
|
-
end
|
199
|
+
rescue *error_classes
|
200
|
+
raise unless retries < max_retries
|
201
|
+
|
202
|
+
@backoff.call(retries)
|
203
|
+
retries += 1
|
204
|
+
retry
|
130
205
|
end
|
131
206
|
end
|
132
207
|
|
208
|
+
# @api private
|
209
|
+
# Token used to fetch IMDS profile and credentials
|
210
|
+
class Token
|
211
|
+
def initialize(value, ttl)
|
212
|
+
@ttl = ttl
|
213
|
+
@value = value
|
214
|
+
@created_time = Time.now
|
215
|
+
end
|
216
|
+
|
217
|
+
# [String] token value
|
218
|
+
attr_reader :value
|
219
|
+
|
220
|
+
def expired?
|
221
|
+
Time.now - @created_time > @ttl
|
222
|
+
end
|
223
|
+
end
|
133
224
|
end
|
134
225
|
end
|