Giter Club home page Giter Club logo

aws-sdk-ruby's Introduction

AWS SDK for Ruby - Version 3

Gem Version Build Status Github forks Github stars

Links of Interest

Installation

The AWS SDK for Ruby is available from RubyGems. With V3 modularization, you should pick the specific AWS service gems to install.

gem 'aws-sdk-s3', '~> 1'
gem 'aws-sdk-ec2', '~> 1'

Alternatively, the aws-sdk gem contains every available AWS service gem. This gem is very large; it is recommended to use it only as a quick way to migrate from V2 or if you depend on many AWS services.

gem 'aws-sdk', '~> 3'

Please use a pessimistic version constraint on the major version when depending on service gems.

Configuration

You will need to configure credentials and a region, either in configuration files or environment variables, to make API calls. It is recommended that you provide these via your environment. This makes it easier to rotate credentials and it keeps your secrets out of source control.

The SDK searches the following locations for credentials:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • The shared credentials ini file at ~/.aws/credentials
    • Credential options supported in this file are:
      • Static Credentials (aws_access_key_id, aws_secret_access_key, aws_session_token)
      • Assume Role Web Identity Credentials (web_identity_token_file, role_arn, source_profile)
      • Assume Role Credentials (role_arn, source_profile)
      • Process Credentials (credential_process)
      • SSO Credentials (sso_session, sso_account_id, sso_role_name, sso_region)
    • Unless ENV['AWS_SDK_CONFIG_OPT_OUT'] is set, the shared configuration ini file at ~/.aws/config will also be parsed for credentials.
  • From an instance profile when running on EC2 or from the ECS credential provider when running in an ECS container with that feature enabled.

Shared configuration is loaded only a single time, and credentials are provided statically at client creation time. Shared credentials do not refresh.

The SDK searches the following locations for a region:

  • ENV['AWS_REGION']
  • ENV['AMAZON_REGION']
  • ENV['AWS_DEFAULT_REGION']
  • Unless ENV['AWS_SDK_CONFIG_OPT_OUT'] is set, the shared configuration files (~/.aws/credentials and ~/.aws/config) will also be checked for a region selection.

The region is used to construct an SSL endpoint. If you need to connect to a non-standard endpoint, you may specify the :endpoint option.

Configuration Options

You can also configure default credentials and the region via the Aws.config hash. The Aws.config hash takes precedence over environment variables.

require 'aws-sdk-core'

Aws.config.update(
  region: 'us-west-2',
  credentials: Aws::Credentials.new('akid', 'secret')
)

Valid region and credentials options are:

You may also pass configuration options directly to Client and Resource constructors. These options take precedence over the environment and Aws.config defaults. A :profile Client option can also be used to choose a specific profile defined in your configuration file.

# using a credentials object
ec2 = Aws::EC2::Client.new(region: 'us-west-2', credentials: credentials)

# using a profile name
ec2 = Aws::EC2::Client.new(profile: 'my_profile')

Please take care to never commit credentials to source control. We strongly recommended loading credentials from an external source.

require 'aws-sdk'
require 'json'

creds = JSON.load(File.read('secrets.json'))
Aws.config[:credentials] = Aws::Credentials.new(
  creds['AccessKeyId'],
  creds['SecretAccessKey']
)

For more information on how to configure credentials, see the developer guide for configuring AWS SDK for Ruby.

API Clients

Construct a service client to make API calls. Each client provides a 1-to-1 mapping of methods to API operations. Refer to the API documentation for a complete list of available methods.

# list buckets in Amazon S3
s3 = Aws::S3::Client.new
resp = s3.list_buckets
resp.buckets.map(&:name)
#=> ["bucket-1", "bucket-2", ...]

API methods accept a hash of additional request parameters and return structured response data.

# list the first two objects in a bucket
resp = s3.list_objects(bucket: 'aws-sdk', max_keys: 2)
resp.contents.each do |object|
  puts "#{object.key} => #{object.etag}"
end

Paging Responses

Many AWS operations limit the number of results returned with each response. To make it easy to get the next page of results, every AWS response object is enumerable:

# yields one response object per API call made, this will enumerate
# EVERY object in the named bucket
s3.list_objects(bucket:'aws-sdk').each do |response|
  puts response.contents.map(&:key)
end

If you prefer to control paging yourself, response objects have helper methods that control paging:

# make a request that returns a truncated response
resp = s3.list_objects(bucket: 'aws-sdk')

resp.last_page? #=> false
resp.next_page? #=> true
resp = resp.next_page # send a request for the next response page
resp = resp.next_page until resp.last_page?

Waiters

Waiters are utility methods that poll for a particular state. To invoke a waiter, call #wait_until on a client:

begin
  ec2.wait_until(:instance_running, instance_ids:['i-12345678'])
  puts "instance running"
rescue Aws::Waiters::Errors::WaiterFailed => error
  puts "failed waiting for instance running: #{error.message}"
end

Waiters have sensible default polling intervals and maximum attempts. You can configure these per call to #wait_until. You can also register callbacks that are triggered before each polling attempt and before waiting. See the API documentation for more examples and for a list of supported waiters per service.

Resource Interfaces

Resource interfaces are object oriented classes that represent actual resources in AWS. Resource interfaces built on top of API clients and provide additional functionality.

Only a few services implement a resource interface. They are defined by hand in JSON and have limitations. Please use the Client API instead.

s3 = Aws::S3::Resource.new

# reference an existing bucket by name
bucket = s3.bucket('aws-sdk')

# enumerate every object in a bucket
bucket.objects.each do |obj|
  puts "#{obj.key} => #{obj.etag}"
end

# batch operations, delete objects in batches of 1k
bucket.objects(prefix: '/tmp-files/').delete

# single object operations
obj = bucket.object('hello')
obj.put(body:'Hello World!')
obj.etag
obj.delete

REPL - AWS Interactive Console

The aws-sdk gem ships with a REPL that provides a simple way to test the Ruby SDK. You can access the REPL by running aws-v3.rb from the command line.

$ aws-v3.rb
[1] pry(Aws)> ec2.describe_instances.reservations.first.instances.first
[Aws::EC2::Client 200 0.216615 0 retries] describe_instances()
<struct
 instance_id="i-1234567",
 image_id="ami-7654321",
 state=<struct  code=16, name="running">,
 ...>

You can enable HTTP wire logging by setting the verbose flag:

$ aws-v3.rb -v

In the REPL, every service class has a helper that returns a new client object. Simply downcase the service module name for the helper:

  • s3 => #<Aws::S3::Client>
  • ec2 => #<Aws::EC2::Client>
  • etc

Functionality requiring AWS Common Runtime (CRT)

The AWS SDK for Ruby has optional functionality that requires the AWS Common Runtime (CRT) bindings to be included as a dependency with your application. This functionality includes:

If the required AWS Common Runtime dependency is not installed you will receive an error indicating that the required dependency is missing to use the associated functionality. To install this dependency follow the provided instructions.

Installing the AWS Common Runtime (CRT) Dependency

AWS CRT bindings are in developer preview and are available in the the aws-crt gem. You can install them by adding the aws-crt gem to your Gemfile.

Sigv4a is an extension to Sigv4 that allows signatures that are valid in more than one region. Sigv4a is required to use some services/operations such as S3 Multi-Region Access Points and Amazon EventBridge Global Endpoints. Currently sigv4a requires the aws-crt gem. The aws-sigv4 signers will automatically use the CRT provided signers with support for sigv4a when the aws-crt gem is available.

gem 'aws-sdk-s3', '~> 1'
gem 'aws-sigv4', '1.4.1.crt'

Getting Help

Please use any of these resources for getting help:

Maintenance and support for SDK major versions

For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the AWS SDKs and Tools Shared Configuration and Credentials Reference Guide:

Opening Issues

If you encounter a bug or have a feature request, we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue.

The GitHub issues are intended for bug reports and feature requests. For help and questions with using aws-sdk-ruby please make use of the resources listed in the Getting Help section.

Versioning

This project uses semantic versioning. You can safely express a dependency on a major version and expect all minor and patch versions to be backwards compatible.

A CHANGELOG can be found at each gem's root path (i.e. aws-sdk-s3 can be found at gems/aws-sdk-s3/CHANGELOG.md). The CHANGELOG is also accessible via the RubyGems.org page under "LINKS" section.

Supported Services

Service Name Service Module gem_name API Version
AWS ARC - Zonal Shift Aws::ARCZonalShift aws-sdk-arczonalshift 2022-10-30
AWS Account Aws::Account aws-sdk-account 2021-02-01
AWS Amplify Aws::Amplify aws-sdk-amplify 2017-07-25
AWS Amplify UI Builder Aws::AmplifyUIBuilder aws-sdk-amplifyuibuilder 2021-08-11
AWS App Mesh Aws::AppMesh aws-sdk-appmesh 2019-01-25
AWS App Runner Aws::AppRunner aws-sdk-apprunner 2020-05-15
AWS AppConfig Data Aws::AppConfigData aws-sdk-appconfigdata 2021-11-11
AWS AppSync Aws::AppSync aws-sdk-appsync 2017-07-25
AWS Application Cost Profiler Aws::ApplicationCostProfiler aws-sdk-applicationcostprofiler 2020-09-10
AWS Application Discovery Service Aws::ApplicationDiscoveryService aws-sdk-applicationdiscoveryservice 2015-11-01
AWS Artifact Aws::Artifact aws-sdk-artifact 2018-05-10
AWS Audit Manager Aws::AuditManager aws-sdk-auditmanager 2017-07-25
AWS Auto Scaling Plans Aws::AutoScalingPlans aws-sdk-autoscalingplans 2018-01-06
AWS B2B Data Interchange Aws::B2bi aws-sdk-b2bi 2022-06-23
AWS Backup Aws::Backup aws-sdk-backup 2018-11-15
AWS Backup Gateway Aws::BackupGateway aws-sdk-backupgateway 2021-01-01
AWS Backup Storage Aws::BackupStorage aws-sdk-backupstorage 2018-04-10
AWS Batch Aws::Batch aws-sdk-batch 2016-08-10
AWS Billing and Cost Management Data Exports Aws::BCMDataExports aws-sdk-bcmdataexports 2023-11-26
AWS Budgets Aws::Budgets aws-sdk-budgets 2016-10-20
AWS Certificate Manager Aws::ACM aws-sdk-acm 2015-12-08
AWS Certificate Manager Private Certificate Authority Aws::ACMPCA aws-sdk-acmpca 2017-08-22
AWS Chatbot Aws::Chatbot aws-sdk-chatbot 2017-10-11
AWS Clean Rooms ML Aws::CleanRoomsML aws-sdk-cleanroomsml 2023-09-06
AWS Clean Rooms Service Aws::CleanRooms aws-sdk-cleanrooms 2022-02-17
AWS Cloud Control API Aws::CloudControlApi aws-sdk-cloudcontrolapi 2021-09-30
AWS Cloud Map Aws::ServiceDiscovery aws-sdk-servicediscovery 2017-03-14
AWS Cloud9 Aws::Cloud9 aws-sdk-cloud9 2017-09-23
AWS CloudFormation Aws::CloudFormation aws-sdk-cloudformation 2010-05-15
AWS CloudHSM V2 Aws::CloudHSMV2 aws-sdk-cloudhsmv2 2017-04-28
AWS CloudTrail Aws::CloudTrail aws-sdk-cloudtrail 2013-11-01
AWS CloudTrail Data Service Aws::CloudTrailData aws-sdk-cloudtraildata 2021-08-11
AWS CodeBuild Aws::CodeBuild aws-sdk-codebuild 2016-10-06
AWS CodeCommit Aws::CodeCommit aws-sdk-codecommit 2015-04-13
AWS CodeConnections Aws::CodeConnections aws-sdk-codeconnections 2023-12-01
AWS CodeDeploy Aws::CodeDeploy aws-sdk-codedeploy 2014-10-06
AWS CodePipeline Aws::CodePipeline aws-sdk-codepipeline 2015-07-09
AWS CodeStar Aws::CodeStar aws-sdk-codestar 2017-04-19
AWS CodeStar Notifications Aws::CodeStarNotifications aws-sdk-codestarnotifications 2019-10-15
AWS CodeStar connections Aws::CodeStarconnections aws-sdk-codestarconnections 2019-12-01
AWS Comprehend Medical Aws::ComprehendMedical aws-sdk-comprehendmedical 2018-10-30
AWS Compute Optimizer Aws::ComputeOptimizer aws-sdk-computeoptimizer 2019-11-01
AWS Config Aws::ConfigService aws-sdk-configservice 2014-11-12
AWS Control Catalog Aws::ControlCatalog aws-sdk-controlcatalog 2018-05-10
AWS Control Tower Aws::ControlTower aws-sdk-controltower 2018-05-10
AWS Cost Explorer Service Aws::CostExplorer aws-sdk-costexplorer 2017-10-25
AWS Cost and Usage Report Service Aws::CostandUsageReportService aws-sdk-costandusagereportservice 2017-01-06
AWS Data Exchange Aws::DataExchange aws-sdk-dataexchange 2017-07-25
AWS Data Pipeline Aws::DataPipeline aws-sdk-datapipeline 2012-10-29
AWS DataSync Aws::DataSync aws-sdk-datasync 2018-11-09
AWS Database Migration Service Aws::DatabaseMigrationService aws-sdk-databasemigrationservice 2016-01-01
AWS Device Farm Aws::DeviceFarm aws-sdk-devicefarm 2015-06-23
AWS Direct Connect Aws::DirectConnect aws-sdk-directconnect 2012-10-25
AWS Directory Service Aws::DirectoryService aws-sdk-directoryservice 2015-04-16
AWS EC2 Instance Connect Aws::EC2InstanceConnect aws-sdk-ec2instanceconnect 2018-04-02
AWS Elastic Beanstalk Aws::ElasticBeanstalk aws-sdk-elasticbeanstalk 2010-12-01
AWS Elemental MediaConvert Aws::MediaConvert aws-sdk-mediaconvert 2017-08-29
AWS Elemental MediaLive Aws::MediaLive aws-sdk-medialive 2017-10-14
AWS Elemental MediaPackage Aws::MediaPackage aws-sdk-mediapackage 2017-10-12
AWS Elemental MediaPackage VOD Aws::MediaPackageVod aws-sdk-mediapackagevod 2018-11-07
AWS Elemental MediaPackage v2 Aws::MediaPackageV2 aws-sdk-mediapackagev2 2022-12-25
AWS Elemental MediaStore Aws::MediaStore aws-sdk-mediastore 2017-09-01
AWS Elemental MediaStore Data Plane Aws::MediaStoreData aws-sdk-mediastoredata 2017-09-01
AWS EntityResolution Aws::EntityResolution aws-sdk-entityresolution 2018-05-10
AWS Fault Injection Simulator Aws::FIS aws-sdk-fis 2020-12-01
AWS Free Tier Aws::FreeTier aws-sdk-freetier 2023-09-07
AWS Global Accelerator Aws::GlobalAccelerator aws-sdk-globalaccelerator 2018-08-08
AWS Glue Aws::Glue aws-sdk-glue 2017-03-31
AWS Glue DataBrew Aws::GlueDataBrew aws-sdk-gluedatabrew 2017-07-25
AWS Greengrass Aws::Greengrass aws-sdk-greengrass 2017-06-07
AWS Ground Station Aws::GroundStation aws-sdk-groundstation 2019-05-23
AWS Health APIs and Notifications Aws::Health aws-sdk-health 2016-08-04
AWS Health Imaging Aws::MedicalImaging aws-sdk-medicalimaging 2023-07-19
AWS Identity and Access Management Aws::IAM aws-sdk-iam 2010-05-08
AWS Import/Export Aws::ImportExport aws-sdk-importexport 2010-06-01
AWS IoT Aws::IoT aws-sdk-iot 2015-05-28
AWS IoT 1-Click Devices Service Aws::IoT1ClickDevicesService aws-sdk-iot1clickdevicesservice 2018-05-14
AWS IoT 1-Click Projects Service Aws::IoT1ClickProjects aws-sdk-iot1clickprojects 2018-05-14
AWS IoT Analytics Aws::IoTAnalytics aws-sdk-iotanalytics 2017-11-27
AWS IoT Core Device Advisor Aws::IoTDeviceAdvisor aws-sdk-iotdeviceadvisor 2020-09-18
AWS IoT Data Plane Aws::IoTDataPlane aws-sdk-iotdataplane 2015-05-28
AWS IoT Events Aws::IoTEvents aws-sdk-iotevents 2018-07-27
AWS IoT Events Data Aws::IoTEventsData aws-sdk-ioteventsdata 2018-10-23
AWS IoT Fleet Hub Aws::IoTFleetHub aws-sdk-iotfleethub 2020-11-03
AWS IoT FleetWise Aws::IoTFleetWise aws-sdk-iotfleetwise 2021-06-17
AWS IoT Greengrass V2 Aws::GreengrassV2 aws-sdk-greengrassv2 2020-11-30
AWS IoT Jobs Data Plane Aws::IoTJobsDataPlane aws-sdk-iotjobsdataplane 2017-09-29
AWS IoT Secure Tunneling Aws::IoTSecureTunneling aws-sdk-iotsecuretunneling 2018-10-05
AWS IoT SiteWise Aws::IoTSiteWise aws-sdk-iotsitewise 2019-12-02
AWS IoT Things Graph Aws::IoTThingsGraph aws-sdk-iotthingsgraph 2018-09-06
AWS IoT TwinMaker Aws::IoTTwinMaker aws-sdk-iottwinmaker 2021-11-29
AWS IoT Wireless Aws::IoTWireless aws-sdk-iotwireless 2020-11-22
AWS Key Management Service Aws::KMS aws-sdk-kms 2014-11-01
AWS Lake Formation Aws::LakeFormation aws-sdk-lakeformation 2017-03-31
AWS Lambda Aws::Lambda aws-sdk-lambda 2015-03-31
AWS Lambda Aws::LambdaPreview aws-sdk-lambdapreview 2014-11-11
AWS Launch Wizard Aws::LaunchWizard aws-sdk-launchwizard 2018-05-10
AWS License Manager Aws::LicenseManager aws-sdk-licensemanager 2018-08-01
AWS License Manager Linux Subscriptions Aws::LicenseManagerLinuxSubscriptions aws-sdk-licensemanagerlinuxsubscriptions 2018-05-10
AWS License Manager User Subscriptions Aws::LicenseManagerUserSubscriptions aws-sdk-licensemanagerusersubscriptions 2018-05-10
AWS Marketplace Agreement Service Aws::MarketplaceAgreement aws-sdk-marketplaceagreement 2020-03-01
AWS Marketplace Catalog Service Aws::MarketplaceCatalog aws-sdk-marketplacecatalog 2018-09-17
AWS Marketplace Commerce Analytics Aws::MarketplaceCommerceAnalytics aws-sdk-marketplacecommerceanalytics 2015-07-01
AWS Marketplace Deployment Service Aws::MarketplaceDeployment aws-sdk-marketplacedeployment 2023-01-25
AWS Marketplace Entitlement Service Aws::MarketplaceEntitlementService aws-sdk-marketplaceentitlementservice 2017-01-11
AWS MediaConnect Aws::MediaConnect aws-sdk-mediaconnect 2018-11-14
AWS MediaTailor Aws::MediaTailor aws-sdk-mediatailor 2018-04-23
AWS Migration Hub Aws::MigrationHub aws-sdk-migrationhub 2017-05-31
AWS Migration Hub Config Aws::MigrationHubConfig aws-sdk-migrationhubconfig 2019-06-30
AWS Migration Hub Orchestrator Aws::MigrationHubOrchestrator aws-sdk-migrationhuborchestrator 2021-08-28
AWS Migration Hub Refactor Spaces Aws::MigrationHubRefactorSpaces aws-sdk-migrationhubrefactorspaces 2021-10-26
AWS Mobile Aws::Mobile aws-sdk-mobile 2017-07-01
AWS Network Firewall Aws::NetworkFirewall aws-sdk-networkfirewall 2020-11-12
AWS Network Manager Aws::NetworkManager aws-sdk-networkmanager 2019-07-05
AWS OpsWorks Aws::OpsWorks aws-sdk-opsworks 2013-02-18
AWS OpsWorks CM Aws::OpsWorksCM aws-sdk-opsworkscm 2016-11-01
AWS Organizations Aws::Organizations aws-sdk-organizations 2016-11-28
AWS Outposts Aws::Outposts aws-sdk-outposts 2019-12-03
AWS Panorama Aws::Panorama aws-sdk-panorama 2019-07-24
AWS Performance Insights Aws::PI aws-sdk-pi 2018-02-27
AWS Price List Service Aws::Pricing aws-sdk-pricing 2017-10-15
AWS Private 5G Aws::PrivateNetworks aws-sdk-privatenetworks 2021-12-03
AWS Proton Aws::Proton aws-sdk-proton 2020-07-20
AWS RDS DataService Aws::RDSDataService aws-sdk-rdsdataservice 2018-08-01
AWS Resilience Hub Aws::ResilienceHub aws-sdk-resiliencehub 2020-04-30
AWS Resource Access Manager Aws::RAM aws-sdk-ram 2018-01-04
AWS Resource Explorer Aws::ResourceExplorer2 aws-sdk-resourceexplorer2 2022-07-28
AWS Resource Groups Aws::ResourceGroups aws-sdk-resourcegroups 2017-11-27
AWS Resource Groups Tagging API Aws::ResourceGroupsTaggingAPI aws-sdk-resourcegroupstaggingapi 2017-01-26
AWS RoboMaker Aws::RoboMaker aws-sdk-robomaker 2018-06-29
AWS Route53 Recovery Control Config Aws::Route53RecoveryControlConfig aws-sdk-route53recoverycontrolconfig 2020-11-02
AWS Route53 Recovery Readiness Aws::Route53RecoveryReadiness aws-sdk-route53recoveryreadiness 2019-12-02
AWS S3 Control Aws::S3Control aws-sdk-s3control 2018-08-20
AWS SSO Identity Store Aws::IdentityStore aws-sdk-identitystore 2020-06-15
AWS SSO OIDC Aws::SSOOIDC aws-sdk-core 2019-06-10
AWS Savings Plans Aws::SavingsPlans aws-sdk-savingsplans 2019-06-28
AWS Secrets Manager Aws::SecretsManager aws-sdk-secretsmanager 2017-10-17
AWS Security Token Service Aws::STS aws-sdk-core 2011-06-15
AWS SecurityHub Aws::SecurityHub aws-sdk-securityhub 2018-10-26
AWS Server Migration Service Aws::SMS aws-sdk-sms 2016-10-24
AWS Service Catalog Aws::ServiceCatalog aws-sdk-servicecatalog 2015-12-10
AWS Service Catalog App Registry Aws::AppRegistry aws-sdk-appregistry 2020-06-24
AWS Shield Aws::Shield aws-sdk-shield 2016-06-02
AWS Signer Aws::Signer aws-sdk-signer 2017-08-25
AWS SimSpace Weaver Aws::SimSpaceWeaver aws-sdk-simspaceweaver 2022-10-28
AWS Single Sign-On Aws::SSO aws-sdk-core 2019-06-10
AWS Single Sign-On Admin Aws::SSOAdmin aws-sdk-ssoadmin 2020-07-20
AWS Snow Device Management Aws::SnowDeviceManagement aws-sdk-snowdevicemanagement 2021-08-04
AWS Step Functions Aws::States aws-sdk-states 2016-11-23
AWS Storage Gateway Aws::StorageGateway aws-sdk-storagegateway 2013-06-30
AWS Supply Chain Aws::SupplyChain aws-sdk-supplychain 2024-01-01
AWS Support Aws::Support aws-sdk-support 2013-04-15
AWS Support App Aws::SupportApp aws-sdk-supportapp 2021-08-20
AWS Systems Manager Incident Manager Aws::SSMIncidents aws-sdk-ssmincidents 2018-05-10
AWS Systems Manager Incident Manager Contacts Aws::SSMContacts aws-sdk-ssmcontacts 2021-05-03
AWS Systems Manager for SAP Aws::SsmSap aws-sdk-ssmsap 2018-05-10
AWS Telco Network Builder Aws::Tnb aws-sdk-tnb 2008-10-21
AWS Transfer Family Aws::Transfer aws-sdk-transfer 2018-11-05
AWS WAF Aws::WAF aws-sdk-waf 2015-08-24
AWS WAF Regional Aws::WAFRegional aws-sdk-wafregional 2016-11-28
AWS WAFV2 Aws::WAFV2 aws-sdk-wafv2 2019-07-29
AWS Well-Architected Tool Aws::WellArchitected aws-sdk-wellarchitected 2020-03-31
AWS X-Ray Aws::XRay aws-sdk-xray 2016-04-12
AWS re:Post Private Aws::Repostspace aws-sdk-repostspace 2022-05-13
AWSBillingConductor Aws::BillingConductor aws-sdk-billingconductor 2021-07-30
AWSDeadlineCloud Aws::Deadline aws-sdk-deadline 2023-10-12
AWSKendraFrontendService Aws::Kendra aws-sdk-kendra 2019-02-03
AWSMainframeModernization Aws::MainframeModernization aws-sdk-mainframemodernization 2021-04-28
AWSMarketplace Metering Aws::MarketplaceMetering aws-sdk-marketplacemetering 2016-01-14
AWSServerlessApplicationRepository Aws::ServerlessApplicationRepository aws-sdk-serverlessapplicationrepository 2017-09-08
Access Analyzer Aws::AccessAnalyzer aws-sdk-accessanalyzer 2019-11-01
Agents for Amazon Bedrock Aws::BedrockAgent aws-sdk-bedrockagent 2023-06-05
Agents for Amazon Bedrock Runtime Aws::BedrockAgentRuntime aws-sdk-bedrockagentruntime 2023-07-26
Alexa For Business Aws::AlexaForBusiness aws-sdk-alexaforbusiness 2017-11-09
Amazon API Gateway Aws::APIGateway aws-sdk-apigateway 2015-07-09
Amazon AppConfig Aws::AppConfig aws-sdk-appconfig 2019-10-09
Amazon AppIntegrations Service Aws::AppIntegrationsService aws-sdk-appintegrationsservice 2020-07-29
Amazon AppStream Aws::AppStream aws-sdk-appstream 2016-12-01
Amazon Appflow Aws::Appflow aws-sdk-appflow 2020-08-23
Amazon Athena Aws::Athena aws-sdk-athena 2017-05-18
Amazon Augmented AI Runtime Aws::AugmentedAIRuntime aws-sdk-augmentedairuntime 2019-11-07
Amazon Bedrock Aws::Bedrock aws-sdk-bedrock 2023-04-20
Amazon Bedrock Runtime Aws::BedrockRuntime aws-sdk-bedrockruntime 2023-09-30
Amazon Chime Aws::Chime aws-sdk-chime 2018-05-01
Amazon Chime SDK Identity Aws::ChimeSDKIdentity aws-sdk-chimesdkidentity 2021-04-20
Amazon Chime SDK Media Pipelines Aws::ChimeSDKMediaPipelines aws-sdk-chimesdkmediapipelines 2021-07-15
Amazon Chime SDK Meetings Aws::ChimeSDKMeetings aws-sdk-chimesdkmeetings 2021-07-15
Amazon Chime SDK Messaging Aws::ChimeSDKMessaging aws-sdk-chimesdkmessaging 2021-05-15
Amazon Chime SDK Voice Aws::ChimeSDKVoice aws-sdk-chimesdkvoice 2022-08-03
Amazon CloudDirectory Aws::CloudDirectory aws-sdk-clouddirectory 2017-01-11
Amazon CloudFront Aws::CloudFront aws-sdk-cloudfront 2020-05-31
Amazon CloudFront KeyValueStore Aws::CloudFrontKeyValueStore aws-sdk-cloudfrontkeyvaluestore 2022-07-26
Amazon CloudHSM Aws::CloudHSM aws-sdk-cloudhsm 2014-05-30
Amazon CloudSearch Aws::CloudSearch aws-sdk-cloudsearch 2013-01-01
Amazon CloudSearch Domain Aws::CloudSearchDomain aws-sdk-cloudsearchdomain 2013-01-01
Amazon CloudWatch Aws::CloudWatch aws-sdk-cloudwatch 2010-08-01
Amazon CloudWatch Application Insights Aws::ApplicationInsights aws-sdk-applicationinsights 2018-11-25
Amazon CloudWatch Events Aws::CloudWatchEvents aws-sdk-cloudwatchevents 2015-10-07
Amazon CloudWatch Evidently Aws::CloudWatchEvidently aws-sdk-cloudwatchevidently 2021-02-01
Amazon CloudWatch Internet Monitor Aws::InternetMonitor aws-sdk-internetmonitor 2021-06-03
Amazon CloudWatch Logs Aws::CloudWatchLogs aws-sdk-cloudwatchlogs 2014-03-28
Amazon CloudWatch Network Monitor Aws::NetworkMonitor aws-sdk-networkmonitor 2023-08-01
Amazon CodeCatalyst Aws::CodeCatalyst aws-sdk-codecatalyst 2022-09-28
Amazon CodeGuru Profiler Aws::CodeGuruProfiler aws-sdk-codeguruprofiler 2019-07-18
Amazon CodeGuru Reviewer Aws::CodeGuruReviewer aws-sdk-codegurureviewer 2019-09-19
Amazon CodeGuru Security Aws::CodeGuruSecurity aws-sdk-codegurusecurity 2018-05-10
Amazon Cognito Identity Aws::CognitoIdentity aws-sdk-cognitoidentity 2014-06-30
Amazon Cognito Identity Provider Aws::CognitoIdentityProvider aws-sdk-cognitoidentityprovider 2016-04-18
Amazon Cognito Sync Aws::CognitoSync aws-sdk-cognitosync 2014-06-30
Amazon Comprehend Aws::Comprehend aws-sdk-comprehend 2017-11-27
Amazon Connect Cases Aws::ConnectCases aws-sdk-connectcases 2022-10-03
Amazon Connect Contact Lens Aws::ConnectContactLens aws-sdk-connectcontactlens 2020-08-21
Amazon Connect Customer Profiles Aws::CustomerProfiles aws-sdk-customerprofiles 2020-08-15
Amazon Connect Participant Service Aws::ConnectParticipant aws-sdk-connectparticipant 2018-09-07
Amazon Connect Service Aws::Connect aws-sdk-connect 2017-08-08
Amazon Connect Wisdom Service Aws::ConnectWisdomService aws-sdk-connectwisdomservice 2020-10-19
Amazon Data Lifecycle Manager Aws::DLM aws-sdk-dlm 2018-01-12
Amazon DataZone Aws::DataZone aws-sdk-datazone 2018-05-10
Amazon Detective Aws::Detective aws-sdk-detective 2018-10-26
Amazon DevOps Guru Aws::DevOpsGuru aws-sdk-devopsguru 2020-12-01
Amazon DocumentDB Elastic Clusters Aws::DocDBElastic aws-sdk-docdbelastic 2022-11-28
Amazon DocumentDB with MongoDB compatibility Aws::DocDB aws-sdk-docdb 2014-10-31
Amazon DynamoDB Aws::DynamoDB aws-sdk-dynamodb 2012-08-10
Amazon DynamoDB Accelerator (DAX) Aws::DAX aws-sdk-dax 2017-04-19
Amazon DynamoDB Streams Aws::DynamoDBStreams aws-sdk-dynamodbstreams 2012-08-10
Amazon EC2 Container Registry Aws::ECR aws-sdk-ecr 2015-09-21
Amazon EC2 Container Service Aws::ECS aws-sdk-ecs 2014-11-13
Amazon EKS Auth Aws::EKSAuth aws-sdk-eksauth 2023-11-26
Amazon EMR Aws::EMR aws-sdk-emr 2009-03-31
Amazon EMR Containers Aws::EMRContainers aws-sdk-emrcontainers 2020-10-01
Amazon ElastiCache Aws::ElastiCache aws-sdk-elasticache 2015-02-02
Amazon Elastic Inference Aws::ElasticInference aws-sdk-elasticinference 2017-07-25
Amazon Elastic Block Store Aws::EBS aws-sdk-ebs 2019-11-02
Amazon Elastic Compute Cloud Aws::EC2 aws-sdk-ec2 2016-11-15
Amazon Elastic Container Registry Public Aws::ECRPublic aws-sdk-ecrpublic 2020-10-30
Amazon Elastic File System Aws::EFS aws-sdk-efs 2015-02-01
Amazon Elastic Kubernetes Service Aws::EKS aws-sdk-eks 2017-11-01
Amazon Elastic Transcoder Aws::ElasticTranscoder aws-sdk-elastictranscoder 2012-09-25
Amazon Elasticsearch Service Aws::ElasticsearchService aws-sdk-elasticsearchservice 2015-01-01
Amazon EventBridge Aws::EventBridge aws-sdk-eventbridge 2015-10-07
Amazon EventBridge Pipes Aws::Pipes aws-sdk-pipes 2015-10-07
Amazon EventBridge Scheduler Aws::Scheduler aws-sdk-scheduler 2021-06-30
Amazon FSx Aws::FSx aws-sdk-fsx 2018-03-01
Amazon Forecast Query Service Aws::ForecastQueryService aws-sdk-forecastqueryservice 2018-06-26
Amazon Forecast Service Aws::ForecastService aws-sdk-forecastservice 2018-06-26
Amazon Fraud Detector Aws::FraudDetector aws-sdk-frauddetector 2019-11-15
Amazon GameLift Aws::GameLift aws-sdk-gamelift 2015-10-01
Amazon Glacier Aws::Glacier aws-sdk-glacier 2012-06-01
Amazon GuardDuty Aws::GuardDuty aws-sdk-guardduty 2017-11-28
Amazon HealthLake Aws::HealthLake aws-sdk-healthlake 2017-07-01
Amazon Honeycode Aws::Honeycode aws-sdk-honeycode 2020-03-01
Amazon Import/Export Snowball Aws::Snowball aws-sdk-snowball 2016-06-30
Amazon Inspector Aws::Inspector aws-sdk-inspector 2016-02-16
Amazon Interactive Video Service Aws::IVS aws-sdk-ivs 2020-07-14
Amazon Interactive Video Service Chat Aws::Ivschat aws-sdk-ivschat 2020-07-14
Amazon Interactive Video Service RealTime Aws::IVSRealTime aws-sdk-ivsrealtime 2020-07-14
Amazon Kendra Intelligent Ranking Aws::KendraRanking aws-sdk-kendraranking 2022-10-19
Amazon Keyspaces Aws::Keyspaces aws-sdk-keyspaces 2022-02-10
Amazon Kinesis Aws::Kinesis aws-sdk-kinesis 2013-12-02
Amazon Kinesis Analytics Aws::KinesisAnalytics aws-sdk-kinesisanalytics 2015-08-14
Amazon Kinesis Analytics Aws::KinesisAnalyticsV2 aws-sdk-kinesisanalyticsv2 2018-05-23
Amazon Kinesis Firehose Aws::Firehose aws-sdk-firehose 2015-08-04
Amazon Kinesis Video Signaling Channels Aws::KinesisVideoSignalingChannels aws-sdk-kinesisvideosignalingchannels 2019-12-04
Amazon Kinesis Video Streams Aws::KinesisVideo aws-sdk-kinesisvideo 2017-09-30
Amazon Kinesis Video Streams Archived Media Aws::KinesisVideoArchivedMedia aws-sdk-kinesisvideoarchivedmedia 2017-09-30
Amazon Kinesis Video Streams Media Aws::KinesisVideoMedia aws-sdk-kinesisvideomedia 2017-09-30
Amazon Kinesis Video WebRTC Storage Aws::KinesisVideoWebRTCStorage aws-sdk-kinesisvideowebrtcstorage 2018-05-10
Amazon Lex Model Building Service Aws::LexModelBuildingService aws-sdk-lexmodelbuildingservice 2017-04-19
Amazon Lex Model Building V2 Aws::LexModelsV2 aws-sdk-lexmodelsv2 2020-08-07
Amazon Lex Runtime Service Aws::Lex aws-sdk-lex 2016-11-28
Amazon Lex Runtime V2 Aws::LexRuntimeV2 aws-sdk-lexruntimev2 2020-08-07
Amazon Lightsail Aws::Lightsail aws-sdk-lightsail 2016-11-28
Amazon Location Service Aws::LocationService aws-sdk-locationservice 2020-11-19
Amazon Lookout for Equipment Aws::LookoutEquipment aws-sdk-lookoutequipment 2020-12-15
Amazon Lookout for Metrics Aws::LookoutMetrics aws-sdk-lookoutmetrics 2017-07-25
Amazon Lookout for Vision Aws::LookoutforVision aws-sdk-lookoutforvision 2020-11-20
Amazon Machine Learning Aws::MachineLearning aws-sdk-machinelearning 2014-12-12
Amazon Macie 2 Aws::Macie2 aws-sdk-macie2 2020-01-01
Amazon Managed Blockchain Aws::ManagedBlockchain aws-sdk-managedblockchain 2018-09-24
Amazon Managed Blockchain Query Aws::ManagedBlockchainQuery aws-sdk-managedblockchainquery 2023-05-04
Amazon Managed Grafana Aws::ManagedGrafana aws-sdk-managedgrafana 2020-08-18
Amazon Mechanical Turk Aws::MTurk aws-sdk-mturk 2017-01-17
Amazon MemoryDB Aws::MemoryDB aws-sdk-memorydb 2021-01-01
Amazon Neptune Aws::Neptune aws-sdk-neptune 2014-10-31
Amazon Neptune Graph Aws::NeptuneGraph aws-sdk-neptunegraph 2023-11-29
Amazon NeptuneData Aws::Neptunedata aws-sdk-neptunedata 2023-08-01
Amazon Omics Aws::Omics aws-sdk-omics 2022-11-28
Amazon OpenSearch Ingestion Aws::OSIS aws-sdk-osis 2022-01-01
Amazon OpenSearch Service Aws::OpenSearchService aws-sdk-opensearchservice 2021-01-01
Amazon Personalize Aws::Personalize aws-sdk-personalize 2018-05-22
Amazon Personalize Events Aws::PersonalizeEvents aws-sdk-personalizeevents 2018-03-22
Amazon Personalize Runtime Aws::PersonalizeRuntime aws-sdk-personalizeruntime 2018-05-22
Amazon Pinpoint Aws::Pinpoint aws-sdk-pinpoint 2016-12-01
Amazon Pinpoint Email Service Aws::PinpointEmail aws-sdk-pinpointemail 2018-07-26
Amazon Pinpoint SMS Voice V2 Aws::PinpointSMSVoiceV2 aws-sdk-pinpointsmsvoicev2 2022-03-31
Amazon Pinpoint SMS and Voice Service Aws::PinpointSMSVoice aws-sdk-pinpointsmsvoice 2018-09-05
Amazon Polly Aws::Polly aws-sdk-polly 2016-06-10
Amazon Prometheus Service Aws::PrometheusService aws-sdk-prometheusservice 2020-08-01
Amazon Q Connect Aws::QConnect aws-sdk-qconnect 2020-10-19
Amazon QLDB Aws::QLDB aws-sdk-qldb 2019-01-02
Amazon QLDB Session Aws::QLDBSession aws-sdk-qldbsession 2019-07-11
Amazon QuickSight Aws::QuickSight aws-sdk-quicksight 2018-04-01
Amazon Recycle Bin Aws::RecycleBin aws-sdk-recyclebin 2021-06-15
Amazon Redshift Aws::Redshift aws-sdk-redshift 2012-12-01
Amazon Rekognition Aws::Rekognition aws-sdk-rekognition 2016-06-27
Amazon Relational Database Service Aws::RDS aws-sdk-rds 2014-10-31
Amazon Route 53 Aws::Route53 aws-sdk-route53 2013-04-01
Amazon Route 53 Domains Aws::Route53Domains aws-sdk-route53domains 2014-05-15
Amazon Route 53 Resolver Aws::Route53Resolver aws-sdk-route53resolver 2018-04-01
Amazon S3 on Outposts Aws::S3Outposts aws-sdk-s3outposts 2017-07-25
Amazon SageMaker Feature Store Runtime Aws::SageMakerFeatureStoreRuntime aws-sdk-sagemakerfeaturestoreruntime 2020-07-01
Amazon SageMaker Metrics Service Aws::SageMakerMetrics aws-sdk-sagemakermetrics 2022-09-30
Amazon SageMaker Runtime Aws::SageMakerRuntime aws-sdk-sagemakerruntime 2017-05-13
Amazon SageMaker Service Aws::SageMaker aws-sdk-sagemaker 2017-07-24
Amazon SageMaker geospatial capabilities Aws::SageMakerGeospatial aws-sdk-sagemakergeospatial 2020-05-27
Amazon Sagemaker Edge Manager Aws::SagemakerEdgeManager aws-sdk-sagemakeredgemanager 2020-09-23
Amazon Security Lake Aws::SecurityLake aws-sdk-securitylake 2018-05-10
Amazon Simple Email Service Aws::SES aws-sdk-ses 2010-12-01
Amazon Simple Email Service Aws::SESV2 aws-sdk-sesv2 2019-09-27
Amazon Simple Notification Service Aws::SNS aws-sdk-sns 2010-03-31
Amazon Simple Queue Service Aws::SQS aws-sdk-sqs 2012-11-05
Amazon Simple Storage Service Aws::S3 aws-sdk-s3 2006-03-01
Amazon Simple Systems Manager (SSM) Aws::SSM aws-sdk-ssm 2014-11-06
Amazon Simple Workflow Service Aws::SWF aws-sdk-swf 2012-01-25
Amazon SimpleDB Aws::SimpleDB aws-sdk-simpledb 2009-04-15
Amazon Textract Aws::Textract aws-sdk-textract 2018-06-27
Amazon Timestream Query Aws::TimestreamQuery aws-sdk-timestreamquery 2018-11-01
Amazon Timestream Write Aws::TimestreamWrite aws-sdk-timestreamwrite 2018-11-01
Amazon Transcribe Service Aws::TranscribeService aws-sdk-transcribeservice 2017-10-26
Amazon Transcribe Streaming Service Aws::TranscribeStreamingService aws-sdk-transcribestreamingservice 2017-10-26
Amazon Translate Aws::Translate aws-sdk-translate 2017-07-01
Amazon VPC Lattice Aws::VPCLattice aws-sdk-vpclattice 2022-11-30
Amazon Verified Permissions Aws::VerifiedPermissions aws-sdk-verifiedpermissions 2021-12-01
Amazon Voice ID Aws::VoiceID aws-sdk-voiceid 2021-09-27
Amazon WorkDocs Aws::WorkDocs aws-sdk-workdocs 2016-05-01
Amazon WorkLink Aws::WorkLink aws-sdk-worklink 2018-09-25
Amazon WorkMail Aws::WorkMail aws-sdk-workmail 2017-10-01
Amazon WorkMail Message Flow Aws::WorkMailMessageFlow aws-sdk-workmailmessageflow 2019-05-01
Amazon WorkSpaces Aws::WorkSpaces aws-sdk-workspaces 2015-04-08
Amazon WorkSpaces Thin Client Aws::WorkSpacesThinClient aws-sdk-workspacesthinclient 2023-08-22
Amazon WorkSpaces Web Aws::WorkSpacesWeb aws-sdk-workspacesweb 2020-07-08
AmazonApiGatewayManagementApi Aws::ApiGatewayManagementApi aws-sdk-apigatewaymanagementapi 2018-11-29
AmazonApiGatewayV2 Aws::ApiGatewayV2 aws-sdk-apigatewayv2 2018-11-29
AmazonConnectCampaignService Aws::ConnectCampaignService aws-sdk-connectcampaignservice 2021-01-30
AmazonMQ Aws::MQ aws-sdk-mq 2017-11-27
AmazonMWAA Aws::MWAA aws-sdk-mwaa 2020-07-01
AmazonNimbleStudio Aws::NimbleStudio aws-sdk-nimblestudio 2020-08-01
AmplifyBackend Aws::AmplifyBackend aws-sdk-amplifybackend 2020-08-11
AppFabric Aws::AppFabric aws-sdk-appfabric 2023-05-19
Application Auto Scaling Aws::ApplicationAutoScaling aws-sdk-applicationautoscaling 2016-02-06
Application Migration Service Aws::Mgn aws-sdk-mgn 2020-02-26
Auto Scaling Aws::AutoScaling aws-sdk-autoscaling 2011-01-01
Braket Aws::Braket aws-sdk-braket 2019-09-01
CloudWatch Observability Access Manager Aws::OAM aws-sdk-oam 2022-06-10
CloudWatch RUM Aws::CloudWatchRUM aws-sdk-cloudwatchrum 2018-05-10
CodeArtifact Aws::CodeArtifact aws-sdk-codeartifact 2018-09-22
Cost Optimization Hub Aws::CostOptimizationHub aws-sdk-costoptimizationhub 2022-07-26
EC2 Image Builder Aws::Imagebuilder aws-sdk-imagebuilder 2019-12-02
EMR Serverless Aws::EMRServerless aws-sdk-emrserverless 2021-07-13
Elastic Disaster Recovery Service Aws::Drs aws-sdk-drs 2020-02-26
Elastic Load Balancing Aws::ElasticLoadBalancing aws-sdk-elasticloadbalancing 2012-06-01
Elastic Load Balancing Aws::ElasticLoadBalancingV2 aws-sdk-elasticloadbalancingv2 2015-12-01
FinSpace Public API Aws::FinSpaceData aws-sdk-finspacedata 2020-07-13
FinSpace User Environment Management service Aws::Finspace aws-sdk-finspace 2021-03-12
Firewall Management Service Aws::FMS aws-sdk-fms 2018-01-01
IAM Roles Anywhere Aws::RolesAnywhere aws-sdk-rolesanywhere 2018-05-10
Inspector Scan Aws::InspectorScan aws-sdk-inspectorscan 2023-08-08
Inspector2 Aws::Inspector2 aws-sdk-inspector2 2020-06-08
Managed Streaming for Kafka Aws::Kafka aws-sdk-kafka 2018-11-14
Managed Streaming for Kafka Connect Aws::KafkaConnect aws-sdk-kafkaconnect 2021-09-14
Migration Hub Strategy Recommendations Aws::MigrationHubStrategyRecommendations aws-sdk-migrationhubstrategyrecommendations 2020-02-19
OpenSearch Service Serverless Aws::OpenSearchServerless aws-sdk-opensearchserverless 2021-11-01
Payment Cryptography Control Plane Aws::PaymentCryptography aws-sdk-paymentcryptography 2021-09-14
Payment Cryptography Data Plane Aws::PaymentCryptographyData aws-sdk-paymentcryptographydata 2022-02-03
PcaConnectorAd Aws::PcaConnectorAd aws-sdk-pcaconnectorad 2018-05-10
QBusiness Aws::QBusiness aws-sdk-qbusiness 2023-11-27
Redshift Data API Service Aws::RedshiftDataAPIService aws-sdk-redshiftdataapiservice 2019-12-20
Redshift Serverless Aws::RedshiftServerless aws-sdk-redshiftserverless 2021-04-21
Route 53 Profiles Aws::Route53Profiles aws-sdk-route53profiles 2018-05-10
Route53 Recovery Cluster Aws::Route53RecoveryCluster aws-sdk-route53recoverycluster 2019-12-02
Schemas Aws::Schemas aws-sdk-schemas 2019-12-02
Service Quotas Aws::ServiceQuotas aws-sdk-servicequotas 2019-06-24
Synthetics Aws::Synthetics aws-sdk-synthetics 2017-10-11
Timestream InfluxDB Aws::TimestreamInfluxDB aws-sdk-timestreaminfluxdb 2023-01-27
TrustedAdvisor Public API Aws::TrustedAdvisor aws-sdk-trustedadvisor 2022-09-15

License

This library is distributed under the Apache License, version 2.0

copyright 2013. amazon web services, inc. all rights reserved.

licensed under the apache license, version 2.0 (the "license");
you may not use this file except in compliance with the license.
you may obtain a copy of the license at

    http://www.apache.org/licenses/license-2.0

unless required by applicable law or agreed to in writing, software
distributed under the license is distributed on an "as is" basis,
without warranties or conditions of any kind, either express or implied.
see the license for the specific language governing permissions and
limitations under the license.

aws-sdk-ruby's People

Contributors

ajredniwja avatar alextwoods avatar alkesh26 avatar awood45 avatar aws-sdk-ruby-automation avatar casperisfine avatar cjyclaire avatar danielredoak avatar danielsiwiec avatar dependabot[bot] avatar djcp avatar doug-aws avatar eniskonuk avatar fonsan avatar iamatypeofwalrus avatar ioquatix avatar janko avatar jterapin avatar kddnewton avatar ksss avatar ktheory avatar lsegal avatar mpata avatar mullermp avatar omockler avatar rcrews avatar srchase avatar tawan avatar trevorrowe avatar yashosharma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-sdk-ruby's Issues

Fails to follow 307 redirects and throws exception with new buckets in Tokyo

When I create a brand new S3 bucket in the Tokyo region and try to upload to it, aws-sdk blows up with the following:

AWS::S3::Errors::TemporaryRedirect: Please re-send this request to the specified temporary endpoint. Continue to use the original request endpoint for future requests.

This appears to be because aws-sdk is making no effort at all to follow 307 redirects. Here is a trace. This is on a Tokyo-based bucket ~1 hr old, from an EC2 instance also in Tokyo:

AWS.config(:access_key_id => aws_key, :secret_access_key => aws_secret, :logger => Logger.new($stdout), :log_level => :debug, :http_wire_trace=>true)
AWS::S3.new.buckets['typingpool-tokyo-test-ffa60'].objects('test.txt').write('HELLO', :acl => :public_read)

Output (including trace):

opening connection to typingpool-tokyo-test-ffa60.s3.amazonaws.com...
opened
<- "PUT /test.txt HTTP/1.1\r\nContent-Type: \r\nContent-Length: 5\r\nX-Amz-Acl: public-read\r\nUser-Agent: aws-sdk-ruby/1.8.0 ruby/1.9.3 x86_64-linux\r\nDate: Mon, 21 Jan 2013 00:13:09 +0000\r\nAuthorization: AWS AKIAIADF6XL2KMK6JFCQ:W6bM5h+Mo+arstXa8IYc5rfOGmc=\r\nAccept: /\r\nHost: typingpool-tokyo-test-ffa60.s3.amazonaws.com\r\n\r\n"
<- "HELLO"
-> "HTTP/1.1 307 Temporary Redirect\r\n"
-> "x-amz-request-id: 15E321CDC2E98864\r\n"
-> "x-amz-id-2: TPFdkx/qSnkAp2h9kcP1A5Y08ylDtGl9xGsCfHRWKlDVhjjLtCqRCEYTtABKI0I6\r\n"
-> "Location: https://typingpool-tokyo-test-ffa60.s3-ap-northeast-1.amazonaws.com/test.txt\r\n"
-> "Content-Type: application/xml\r\n"
-> "Transfer-Encoding: chunked\r\n"
-> "Date: Mon, 21 Jan 2013 00:13:09 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: AmazonS3\r\n"
-> "\r\n"
-> "1de\r\n"
reading 478 bytes...
-> "Glt;?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>TemporaryRedirect</Code><Message>Please re-send this request to the specified temporary endpoint. Continue to use the original request endpoint for future requests.</Message><RequestId>15E321CDC2E98864</RequestId><Bucket>typingpool-tokyo-test-ffa60</Bucket><HostId>TPFdkx/qSnkAp2h9kcP1A5Y08ylDtGl9xGsCfHRWKlDVhjjLtCqRCEYTtABKI0I6</HostId><Endpoint>typingpool-tokyo-test-ffa60.s3-ap-northeast-1.amazonaws.com</Endpoint></Error>"
read 478 bytes
reading 2 bytes...
-> "\r\n"
read 2 bytes
-> "0\r\n"
-> "\r\n"
Conn close
D, [2013-01-21T00:13:10.037404 #4805] DEBUG -- : [AWS S3 307 0.872387 0 retries] put_object(:acl=>:public_read,:bucket_name=>"typingpool-tokyo-test-ffa60",:content_length=>5,:data=>#<StringIO:0x000000020dd048>,:key=>"test.txt") AWS::S3::Errors::TemporaryRedirect Please re-send this request to the specified temporary endpoint. Continue to use the original request endpoint for future requests.

AWS::S3::Errors::TemporaryRedirect: Please re-send this request to the specified temporary endpoint. Continue to use the original request endpoint for future requests.
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:318:in return_or_raise' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:inclient_request'
from (eval):3:in put_object' from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/aws-sdk-1.8.0/lib/aws/s3/s3_object.rb:1655:inwrite_with_put_object'
from /home/ubuntu/.rvm/gems/ruby-1.9.3-p374/gems/aws-sdk-1.8.0/lib/aws/s3/s3_object.rb:600:in write' from (irb):7 from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p374/bin/irb:13:inmain>'

Amazon itself says all S3 clients must ("must") follow 307 redirects: "IMPORTANT:
Every Amazon S3 program must be designed to handle redirect responses." http://docs.aws.amazon.com/AmazonS3/latest/dev/Redirects.html

As such, I'm confused as to why aws-sdk for ruby seems to be making no attempt at all to follow these redirects.

This is particularly vexing for me as my software can (and is) used in various S3 regions, and I have no way of determining or specifying ahead of time which region a given user will be in. Thus, I cannot simply tell aws-sdk explicity to put things in their particular region. This particular bug cropped up for a user in Hawaii who was apparently assigned to the Tokyo region when creating his bucket via my software.

Would you be open to a patch to follow 307 redirects correctly? Have you/Amazon explored adding this to the SDK?

(FWIW, at about 1hr 15min the DNS propagation apparently kicked in and the errors stopped. But waiting 1hr 15min after bucket creation really isn't feasible for me.)

AbstractBase case sensitivity

In our use case, we do something like this:

class Widget < AWS::Record::HashModel
  string_attr :payload
end

We then create a Widget like so:

widget = Widget.create!(payload: payload )

We then share the id, say f6868ab3-dba4-4812-a98b-3bf818fcacfa, with an external party, and when the external party gives us back the an id, we look it up. But, they might send us F6868AB3-DBA4-4812-A98B-3BF818FCACFA because of something their system does. In our case, we would like the Widget.find call to work. It seems like it should be an option to do enable/disable case sensitivity.

Let me know if this is of interest to you, and it might have the cycles to work on it...

DynamoDB, ItemCollection#query makes additional get_item request.

Does the additional request really necessary?

Thanks.

table.items.query(:hash_value => "1", :range_value => "22") do |item|
    puts item.attributes.to_hash
end


[AWS DynamoDB 200 0.324019 0 retries] query(:attributes_to_get=>["id","date"],:hash_key_value=>{:s=>"1"},:range_key_condition=>{:attribute_value_list=>[{:s=>"22"}],:comparison_operator=>"EQ"},:table_name=>"books")  

[AWS DynamoDB 200 0.082005 0 retries] get_item(:key=>{:hash_key_element=>{:s=>"1"},:range_key_element=>{:s=>"22"}},:table_name=>"books") 

Minor regression regarding accessing SQS queues by url

This used to work:

sqs = AWS::SQS.new
sqs.queues['https://sqs.eu-west-1.amazonaws.com/...'].visible_messages

But the newest version of the SDK with v4 signing for SQS does not allow this and you'll get the error:

AWS::SQS::Errors::SignatureDoesNotMatch: Credential should be scoped to a valid region, not 'us-east-1'. 

You're now required to config the endpoint:

sqs = AWS::SQS.new(sqs_endpoint: 'sqs.eu-west-1.amazonaws.com')
sqs.queues['https://sqs.eu-west-1.amazonaws.com/...'].visible_messages

This is of course a minor issue but I wanted to let you know anyway (maybe someone else has the same problem).

On a related note, are any plans to support a simple :region parameter? Or even inferring the region from the IAM-instance-profile? Based on the region the endpoints for all the services can be configured. This would save a ton of endpoints to be configured if you're using a lot of services.

AWS::S3::Errors::MalformedXML in AWS::S3::Client#delete_objects

I just got this when attempting to process a batch of object deletes directly in the S3 client:

/home/ubuntu/.rvm/gems/ruby-1.9.3-p362/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:318:in `return_or_raise': The XML you provided was not well-formed or did not validate against our published schema (AWS::S3::Errors::MalformedXML)
        from /home/ubuntu/.rvm/gems/ruby-1.9.3-p362/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:in `client_request'
        from (eval):3:in `delete_objects'
        from ./s3_delete_random_objects.rb:95:in `process_deletions'
        from ./s3_delete_random_objects.rb:70:in `block (2 levels) in run'

The code itself is fairly uninteresting:

 93   # Handle batch deletions
 94   def process_deletions(s3, bucket, batch)
 95     response = s3.client.delete_objects({
 96       :bucket_name => bucket,
 97       :keys        => batch
 98     })
 99 
100     prefix = response.successful? ? '' : 'FAILED '
101     batch.each { |k| puts prefix + k[:key] }
102   end

Importantly though, this deletion is happening in its own thread, with its own instance of AWS::S3.

I'm happy to provide more information that might help get to the core of this issue.

Allow EMR creation to support IAM Roles

According to this documentation:

http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/emr-iam-roles.html

EMR supports IAM Roles. The API field is

&JobFlowRole=MyRole

which in Ruby should translate to something like

 @options[:job_flow_role] = 'MyRole'

but when I tried that, I got

unexpected option job_flow_role

I would add a PR for this, but looking though the code, I cannot see where valid options are defined. If someone can point me in the right direction, I would be happy to do the work.

RequestExpired using IAM credentials on a long-running process

We have a long-running ruby process that runs forever, waking up every hour or so to check various properties of our AWS environment. It uses a single persistent AWS::EC2 object to do so.

Recently, we switched it from using an access key and secret key to using IAM credentials. When we did, everything would start failing after some interval with RequestExpired exceptions.

Is this expected? Are we supposed to be refreshing credentials by hand, or using a new client every time (preemptively doing a ec2.client.credential_provider.refresh seems to resolve the issue)? Or is this a bug?

Does not handle redirects when doing a PUT Object request to S3

When doing a PUT Object to S3, it's possible that your request may be redirected. We have seen this at Zencoder on older buckets in Europe, but if #133 is the same bug then apparently it can happen on new buckets in regions outside of US-East.

The requirement to handle redirects is specified in the first "Note" section of the S3 documentation for PUT Object: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html

The RightAWS library handles this correctly: https://github.com/rightscale/right_aws/blob/master/lib/s3/right_s3_interface.rb#L438-L452 but the Fog library doesn't. In older versions of the RightAWS library and the current version of Fog, this manifests as a broken pipe error. The library continues to try to write to the socket despite the fact that the S3 endpoint has written its redirect and closed the socket on their end.

I haven't actually recreated the problem in this library, but I know enough about the problem now that I can identify it in code, and it seems clear to me that this is not being handled. Since we deal with so many different buckets in different regions, this is a deal-breaker for us.

S3 Requests are not sending GTM date/time in header

The "Date" Header should contain a date and time in GMT (rfc2616). When issueing requests form a non utc timezone they have a date header with a value like "Date: Thu, 31 Jan 2013 17:37:37 +0100", instead of "Date: Thu, 31 Jan 2013 16:37:37 GMT"

This does not seem to be problematic with requests to aws, but other s3-api compatible servers like radosgw to not like this.

DynamoDB#batch_get unspec'd & throwing error?

The last line of DynamoDB#batch_get is throwing an exception for us. I added a puts to that method and then ran the specs, and it doesn't appear to ever be exercised by the specs.

S3Object.head return content-encoding with response

We store a mix of compressed and uncompressed objects in S3. It would be extremely helpful to return the content-encoding value along with the content-type/length when doing a head request. The only way I've found to get this value is a bit convoluted via:

s3.client.head_object({:bucket_name => bucket_name, :key => key}).http_response.header('content-encoding')

Tag 1.8.1.3?

Hi there,
Any chance of a current tag & gem? There's a particular issue fixed that didn't quite make it to 1.8.1.2 (assume role functionality).
Thanks.

Regression in block_device_mappings

Since I upgraded to 1.8.1.3 I get the following error when accessing the block_device_mappings of an image:

[15] pry(main)> ami = ec2.images["ami-807cefe9"]
=> <AWS::EC2::Image id:ami-807cefe9>
[16] pry(main)> ami.block_device_mappings
NoMethodError: undefined method `ebs' for {:device_name=>"/dev/sdb", :virtual_name=>"ephemeral0"}:Hash
from /home/menglund/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/aws-sdk-1.8.1.3/lib/aws/core/data.rb:101:in `method_missing'

AWS::IAM::User should have an `exists?` method

To be consistent with other AWS classes, I would argue that AWS::IAM::User should have an exists? method to determine whether or not the user exists.

Other classes (such as AWS::EC2::Instance, AWS::IAM::Group, etc.) have this method to determine if the resource exists on AWS, and it would be helpful to have this method in the User class.

As it currently stands, there is no way (short of enumerating all IAM users) to determine whether or not a user exists on AWS.

Adding :expiration_time to AWS::S3::BucketLifecycleConfiguration update results in invalid call

Code based on the AWs sample at http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/S3/BucketLifecycleConfiguration.html:

 s3.buckets[node_bucket].lifecycle_configuration.update do
   add_rule rule_path, :expiration_time => 365
 end

results in an invalid call:

[AWS S3 400 0.094007 0 retries] set_bucket_lifecycle_configuration(:bucket_name=>"...",:lifecycle_configuration=>"<LifecycleConfiguration></Rule>\n  <Rule>\n    <ID>49484718-254d-45f1-ad70-fabe7c276800</ID>\n    <Prefix>Test</Prefix>\n    <Status>Enabled</Status>\n    <Expiration>\n      <Days expiration_time=\"365\"/>\n    </Expiration>\n  </Rule>\n</LifecycleConfiguration>")

AWS::S3::Errors::InvalidArgument 'Days' in the expiration action must be a non-zero positive integer greater than that in the transition action.

Changing the code to:

 s3.buckets[node_bucket].lifecycle_configuration.update do
   add_rule rule_path, 365
 end

is succesful:

[AWS S3 200 0.153972 0 retries] set_bucket_lifecycle_configuration(:bucket_name=>"...",:lifecycle_configuration=>"<LifecycleConfiguration>\n  <Rule>\n    <ID>92300414-9740-4589-8d16-ffd9a6a858c2</ID>\n    <Prefix>Test</Prefix>\n    <Status>Enabled</Status>\n    <Expiration>\n      <Days>365</Days>\n    </Expiration>\n  </Rule>\n</LifecycleConfiguration>")

SWF enhancements

Are there any plans to add something similar to the flow framework that is available in the AWS SDK for java version of SWF? It is quite cumbersome to build all the plumbing, and would be amazing if we had a rubyish framework similar to the flow framework.

thanks!

Implement 'persist_as'

Inside an AWS Record, persist_as is documented, but not implemented. The feature allows something like this inside your model

string_attr :width, :persist_as => 'Exif.Photo.PixelXDimension'

AWS::ElasticTranscoder::Client.create_preset bug?

Hey guys,

I have found a potential bug in AWS::ElasticTranscoder::Client.create_preset - but haven't dug far enough into it to pinpoint it. I am running:

Ruby 1.9.3p194
Rails 3.2.11
aws-sdk 1.8.2

When trying to create a preset using the SDK I am getting the following error:

NoMethodError: undefined method validate_map' for #<AWS::Core::Options::Validator:0x007fbab35cc1d0> from /Users/cdanzig/.rvm/gems/ruby-1.9.3-p194/gems/aws-sdk-1.8.2/lib/aws/core/options/validator.rb:75:invalidate_value'

This is being thrown because the Validator class is being initialized with the following rules object (note the type :map for the CodecOptions which I think should be :hash).

{:codec=>{:name=>"Codec", :type=>:string},
     :codec_options=>
      {:name=>"CodecOptions",
       :type=>:map,
       :keys=>{:name=>"key", :type=>:string},
       :members=>{:name=>"value", :type=>:string}},
     :keyframes_max_dist=>{:name=>"KeyframesMaxDist", :type=>:string},
     :fixed_gop=>{:name=>"FixedGOP", :type=>:string},
     :bit_rate=>{:name=>"BitRate", :type=>:string},
     :frame_rate=>{:name=>"FrameRate", :type=>:string},
     :resolution=>{:name=>"Resolution", :type=>:string},
     :aspect_ratio=>{:name=>"AspectRatio", :type=>:string}}},

Any thoughts on how / why the Validator would be being initialized with the wrong rule?

Thanks,
Chris

API Documentation for ElasticBeanstalk is misleading

All of the other top level services (e.g. S3) make it clear in the documentation that most instance methods for accessing the service are under X.client. A lot of instance methods are listed under AWS::ElasticBeanstalk that are actually instance methods on AWS::ElasticBeanstalk::Client and this is quite misleading.

'can't convert nil into String' when attempting to retrieve S3 expire date

Have an s3 Directory set to expire objects after 1 day. But when I attempt to retrieve the expire_date from a object in the directory i get this exception 'can't convert nil into String'. Double checking in the S3 management console and expiry date is set.

s3 = AWS::S3.new 
o = s3.buckets[bucket].objects.with_prefix(dir)
o.each do |f|
  f.expiration_date # => 'can't convert nil into String'
end

Stack-trace

 aws-sdk (1.8.0) lib/aws/s3/client.rb:922:in `parse'
 aws-sdk (1.8.0) lib/aws/s3/client.rb:922:in `block (2 levels) in <class:Client>'
 aws-sdk (1.8.0) lib/aws/core/client.rb:455:in `block (3 levels) in client_request'
 aws-sdk (1.8.0) lib/aws/core/async_handle.rb:40:in `call'
 aws-sdk (1.8.0) lib/aws/core/async_handle.rb:40:in `on_success'
 aws-sdk (1.8.0) lib/aws/core/client.rb:454:in `block (2 levels) in client_request'
 aws-sdk (1.8.0) lib/aws/core/client.rb:334:in `log_client_request'
 aws-sdk (1.8.0) lib/aws/core/client.rb:420:in `block in client_request'
 aws-sdk (1.8.0) lib/aws/core/client.rb:316:in `return_or_raise'
 aws-sdk (1.8.0) lib/aws/core/client.rb:419:in `client_request'
 (eval):3:in `head_object'
 aws-sdk (1.8.0) lib/aws/s3/s3_object.rb:294:in `head'
 aws-sdk (1.8.0) lib/aws/s3/s3_object.rb:331:in `expiration_date'
 aws-sdk (1.8.0) lib/aws/core/collection.rb:50:in `each'
 aws-sdk (1.8.0) lib/aws/core/collection.rb:50:in `block in each'
 aws-sdk (1.8.0) lib/aws/core/collection/with_limit_and_next_token.rb:61:in `_each_batch'
 aws-sdk (1.8.0) lib/aws/core/collection.rb:82:in `each_batch'
 aws-sdk (1.8.0) lib/aws/core/collection.rb:49:in `each'
 aws-sdk (1.8.0) lib/aws/s3/object_collection.rb:282:in `each'
 actionpack (3.0.17) lib/action_view/template.rb:135:in `block in render'
 activesupport (3.0.17) lib/active_support/notifications.rb:54:in `instrument'
 actionpack (3.0.17) lib/action_view/template.rb:127:in `render'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:117:in `block in      render_with_newrelic'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:116:in `render_with_newrelic'
 actionpack (3.0.17) lib/action_view/render/rendering.rb:59:in `block in _render_template'
 activesupport (3.0.17) lib/active_support/notifications.rb:52:in `block in instrument'
 activesupport (3.0.17) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
 activesupport (3.0.17) lib/active_support/notifications.rb:52:in `instrument'
 actionpack (3.0.17) lib/action_view/render/rendering.rb:56:in `_render_template'
 actionpack (3.0.17) lib/action_view/render/rendering.rb:26:in `render'
 actionpack (3.0.17) lib/abstract_controller/rendering.rb:115:in `_render_template'
 actionpack (3.0.17) lib/abstract_controller/rendering.rb:109:in `render_to_body'
 actionpack (3.0.17) lib/action_controller/metal/renderers.rb:47:in `render_to_body'
 actionpack (3.0.17) lib/action_controller/metal/compatibility.rb:55:in `render_to_body'
 actionpack (3.0.17) lib/abstract_controller/rendering.rb:102:in `render_to_string'
 actionpack (3.0.17) lib/abstract_controller/rendering.rb:93:in `render'
 actionpack (3.0.17) lib/action_controller/metal/rendering.rb:17:in `render'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
 activesupport (3.0.17) lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
 /Users/jmckinney/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
 activesupport (3.0.17) lib/active_support/core_ext/benchmark.rb:5:in `ms'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:40:in `block in render'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
 activerecord (3.0.17) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:39:in `render'
 actionpack (3.0.17) lib/action_controller/metal/mime_responds.rb:192:in `call'
 actionpack (3.0.17) lib/action_controller/metal/mime_responds.rb:192:in `respond_to'
 actionpack (3.0.17) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 actionpack (3.0.17) lib/abstract_controller/base.rb:150:in `process_action'
 actionpack (3.0.17) lib/action_controller/metal/rendering.rb:11:in `process_action'
 actionpack (3.0.17) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
 activesupport (3.0.17) lib/active_support/callbacks.rb:471:in      `_run__2669925054399588106__process_action__629379060444922707__callbacks'
 activesupport (3.0.17) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
 activesupport (3.0.17) lib/active_support/callbacks.rb:94:in `run_callbacks'
 actionpack (3.0.17) lib/abstract_controller/callbacks.rb:17:in `process_action'
 actionpack (3.0.17) lib/action_controller/metal/rescue.rb:17:in `process_action'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
 activesupport (3.0.17) lib/active_support/notifications.rb:52:in `block in instrument'
 activesupport (3.0.17) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
 activesupport (3.0.17) lib/active_support/notifications.rb:52:in `instrument'
 actionpack (3.0.17) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in `block in      perform_action_with_newrelic_trace'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
 newrelic_rpm (3.5.4.34) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
 actionpack (3.0.17) lib/abstract_controller/base.rb:119:in `process'
 actionpack (3.0.17) lib/abstract_controller/rendering.rb:41:in `process'
 actionpack (3.0.17) lib/action_controller/metal.rb:138:in `dispatch'
 actionpack (3.0.17) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
 actionpack (3.0.17) lib/action_controller/metal.rb:178:in `block in action'
 actionpack (3.0.17) lib/action_dispatch/routing/route_set.rb:68:in `call'
 actionpack (3.0.17) lib/action_dispatch/routing/route_set.rb:68:in `dispatch'
 actionpack (3.0.17) lib/action_dispatch/routing/route_set.rb:33:in `call'
 rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call'
 rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize'
 rack-mount (0.6.14) lib/rack/mount/code_generation.rb:117:in `optimized_each'
 rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
 rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
 actionpack (3.0.17) lib/action_dispatch/routing/route_set.rb:499:in `call'
 newrelic_rpm (3.5.4.34) lib/new_relic/rack/error_collector.rb:8:in `call'
 newrelic_rpm (3.5.4.34) lib/new_relic/rack/browser_monitoring.rb:12:in `call'
 rack-timeout (0.0.3) lib/rack/timeout.rb:16:in `block in call'
 /Users/jmckinney/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
 rack-timeout (0.0.3) lib/rack/timeout.rb:16:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/head.rb:14:in `call'
 rack (1.2.5) lib/rack/methodoverride.rb:24:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/flash.rb:182:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/cookies.rb:302:in `call'
 activerecord (3.0.17) lib/active_record/query_cache.rb:32:in `block in call'
 activerecord (3.0.17) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
 activerecord (3.0.17) lib/active_record/query_cache.rb:12:in `cache'
 activerecord (3.0.17) lib/active_record/query_cache.rb:31:in `call'
 activerecord (3.0.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call'
 activesupport (3.0.17) lib/active_support/callbacks.rb:416:in `_run_call_callbacks'
 actionpack (3.0.17) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
 rack (1.2.5) lib/rack/sendfile.rb:106:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
 railties (3.0.17) lib/rails/rack/logger.rb:13:in `call'
 rack (1.2.5) lib/rack/runtime.rb:17:in `call'
 activesupport (3.0.17) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
 actionpack (3.0.17) lib/action_dispatch/middleware/static.rb:30:in `call'
 railties (3.0.17) lib/rails/application.rb:168:in `call'
 railties (3.0.17) lib/rails/application.rb:77:in `method_missing'
 rack-fiber_pool (0.9.2) lib/rack/fiber_pool.rb:21:in `block in call'
 rack-fiber_pool (0.9.2) lib/fiber_pool.rb:48:in `call'
 rack-fiber_pool (0.9.2) lib/fiber_pool.rb:48:in `block (3 levels) in initialize'
 rack-fiber_pool (0.9.2) lib/fiber_pool.rb:47:in `loop'
 rack-fiber_pool (0.9.2) lib/fiber_pool.rb:47:in `block (2 levels) in initialize'

AWS::Core::Data::List is not an array, and doesn't act like one

Your docs on AWS::EC2::InstanceCollection:

http://docs.amazonwebservices.com/AWSRubySDK/latest/AWS/EC2/InstanceCollection.html#create-instance_method

Here's some code that demonstrates the issue:

https://gist.github.com/1c393c51784a6f684b8f

And here's the catalyst for the problem:

https://github.com/aws/aws-sdk-ruby/blob/master/lib/aws/core/data.rb#L89

Just... yeah. I'd submit a patch to gut this whole file but I suspect you have some reason to keep it around, even though what you're using it for is a really bad idea.

Either way, at least fix the docs so I can brace myself for maximum cleverness. Thanks!

Creating a CloudFront distribution: InvalidOrigin error when distribution_config.origins.items.s3_origin_config isn't present

I've been testing an automated process where I create a S3 bucket and then a CloudFront distribution. Executing my script would give the following error:

aws-sdk-1.8.1.1/lib/aws/core/client.rb:318:in `return_or_raise': The origin server does not exist or is not valid. (AWS::CloudFront::Errors::InvalidOrigin)

Code:

require 'rubygems'
require 'aws-sdk'

cf = AWS::CloudFront.new

cloudfront_config = {
    :distribution_config => {
        :caller_reference => Time.now.nsec.to_s,
        :aliases => {
            :quantity => 0
        },
        :default_root_object => "index.html",
        :origins => {
            :quantity => 1,
            :items => [
                {
                    :id => "BUCKETNAME",
                    :domain_name => "BUCKETNAME.s3.amazonaws.com"
                }
            ]
        },
        :default_cache_behavior => {
            :target_origin_id => "#{d}",
            :forwarded_values => {
                :query_string => false
            },
            :trusted_signers => {
                :enabled => false,
                :quantity => 0
            },
            :viewer_protocol_policy => "allow-all",
            :min_ttl => 900
        },
        :cache_behaviors => {
            :quantity => 0
        },
        :comment => "A new CloudFront distribution has been created for BUCKETNAME.",
        :logging => {
            :enabled => false,
            :bucket => "",
            :prefix => ""
        },
        :enabled => true
    }
}

cloudfront_distribution = cf.client.create_distribution(cloudfront_config)

That kept giving the InvalidOrigin error until I stumbled upon this: https://bitbucket.org/jmurty/jets3t/issue/150/update-to-api-version-2012-05-05. So, I made it work by modifying distribution_config.origins.items to look like this:

:items => [ 
    {
        :id => "BUCKETNAME",
        :domain_name => "BUCKETNAME.s3.amazonaws.com",
        :s3_origin_config => {
            :origin_access_identity => ""
        }
    }
]

I'm bringing this up, because the documentation indicated "s3_origin_config" as optional (see here: http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/CloudFront/Client.html#create_distribution-instance_method), so I left it off and then had quite a time trying to figure out what was wrong.

Too many open file

Hi

I use Paperclip to store image with S3

If I upload a lot of image (>300) in same process, it's raise "too many open file" error.

If I check the file open by ruby process while my script (lsof -p PID) I get lot of MYSERVER:35462->s3-3-w.amazonaws.com:https (CLOSE_WAIT)
and "can't identify protocol" (It's opening socket). So connection is like a file...

So I think is a aws-sdk related

And a workaround has been found (but not work with me) -> Call image.file.s3_interface.config.http_handler.pool.empty! if image.file.respond_to? :s3_interface
after each image uploaded.

Unable to add multi byte strings to the Simple DB

Unable to add multi byte strings(for example, Japanese language) to the Simple DB.

.../gems/aws-sdk-1.0.0/lib/aws/base_client.rb:316:in `return_or_raise': The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. (AWS::SimpleDB::Errors::SignatureDoesNotMatch)

Unable to create login profile for IAM users

I'm trying to create a set of IAM users in a Ruby program. My other AWS requests are working fine, as are my other IAM requests.

I can create the users, but then I get an error when attempting to give them a login profile. In the code below, the second line succeeds and the user is indeed created. However, I get an error on the third line:

puts "Creating user '#{@username}' with password #{@password}"
@user = @iam.users.create(@username)
@user.login_profile.password = @password

The error I get is as follows:

Creating user 'wjang' with password AbCd1234#
/Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/option_grammar.rb:93:in `validate': expected string value for option user_name (AWS::Core::OptionGrammar::FormatError)
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/option_grammar.rb:587:in `block in validate'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/option_grammar.rb:583:in `each'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/option_grammar.rb:583:in `validate'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/option_grammar.rb:598:in `request_params'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/query_request_builder.rb:37:in `populate_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:614:in `block (2 levels) in define_client_method'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:503:in `build_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:434:in `block (3 levels) in client_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/response.rb:180:in `call'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/response.rb:180:in `build_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/response.rb:108:in `initialize'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:183:in `new'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:183:in `new_response'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:433:in `block (2 levels) in client_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:334:in `log_client_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:420:in `block in client_request'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:316:in `return_or_raise'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:in `client_request'

Rearranging the code a bit to see if it would work, I tried this:

puts "Creating user '#{@username}' with password #{@password}"
@iam.users.create(@username)
@iam.users[@username].login_profile.password = @password

However, I got another error about the login profile not existing, even though the documentation states the password= method "sets a new password for the login profile, creating the profile if no profile currently exists for the user."

Creating user 'wjang' with password AbCd1234#
/Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:318:in `return_or_raise': <ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> (AWS::Errors::Base)
  <Error>
    <Type>Sender</Type>
    <Code>NoSuchEntity</Code>
    <Message>Cannot find Login Profile for User egray25</Message>
  </Error>
  <RequestId>3a3a5589-60d8-11e2-8b53-9f7965f0f1bd</RequestId>
</ErrorResponse>
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:in `client_request'
    from (eval):3:in `update_login_profile'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/iam/login_profile.rb:53:in `password='
    from /Users/jeff/dl/Dropbox/doc/teaching/2012/fall/cs2212a-fall2012/ec2/lib/create_user_command.rb:19:in `block in initialize'
    from /Users/jeff/dl/Dropbox/doc/teaching/2012/fall/cs2212a-fall2012/ec2/lib/command.rb:11:in `call'
    from /Users/jeff/dl/Dropbox/doc/teaching/2012/fall/cs2212a-fall2012/ec2/lib/command.rb:11:in `execute'
    from bin/create-iam-users:180:in `block in <main>'
    from bin/create-iam-users:179:in `each'
    from bin/create-iam-users:179:in `<main>'

Cannot read file from S3 using blocks

bucket.objects['foo'].write('bar')
bucket.objects['foo'].read do |chunk| # Prints nothing
  $stdout.write(chunk)
end
$stdout.write(bucket.objects['foo'].read()) # Prints bar

When looking through s3/client.rb you seem to ignore the fact that I passed a block in get_object.

errors thrown when sending emails within multiple threads

tested using ruby 1.9.3-p327

require 'aws-sdk'
pool = Array.new(10) do |i|
  Thread.new do
    AWS::SimpleEmailService.new(:access_key_id => '1234567890', :secret_access_key => '1234567890').send_email(
      :subject => 'subject',
      :body_html => 'body_html',
      :body_text => 'body_text',
      :to => '[email protected]',
      :from => '[email protected]',
    )
  end
end

pool.each(&:join)

~/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/aws-sdk-1.7.1/lib/aws/core/client.rb:499:in build_request': undefined methodadd_authorization!' for #AWS::SimpleEmailService::Request:0x007feac892bd90 (NoMethodError)

~/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/aws-sdk-1.7.1/lib/aws/simple_email_service.rb:281:in send_email': undefined methodsend_email' for #AWS::SimpleEmailService::Client:0x007fdf7c1465c8 (NoMethodError)

Optimization: Add dirty tracking to Tags

As far as I can tell, there is not dirty tracking in Tag collections or Resource Tag Collections. This means:

instance.tags['Name'] = 'MyName'
instance.tags['Name'] = 'MyName'

Will create the same key twice, instead of ignoring the second call since the value is the same.

This would be really nice to have when using the OO API methods.

DynamoDB AttributeCollection should support #to_hash

It is possible to turn an AttributeCollection into a standard Ruby hash using the to_h method. However, the naming of this method is nonstandard—most built in classes in Ruby use to_hash for the same functionality. It would be nice to adopt this convention, because it's convenient to replace an item's attributes collection with a known hash for specs. For example:

In spec:

@itemA.should_receive(:attributes).any_number_of_times.and_return({'views' => 4, 'asset1:c' => '3', 'mykey' => '123'})

In code:

@table.items.query(:hash_value=>"2") do |item|
        item.attributes.to_h.each_pair { |key, value|
        case key
        when "id+tc", "id", "day"
          # nothing
        else
          hours[key] = value.to_i
        end
      }
   end

This spec will fail because we are stubbing the AttributeCollection out as a standard hash, and to_hash, not to_h is defined on the Ruby hash class.

AWS::IAM::LoginProfile#exists? throws an exception when a login profile does not exist

If a user's login profile exists, then the method works just fine:

ruby-1.9.2-p290 :050 > u = iam.users["testuser"]
 => <AWS::IAM::User name:testuser> 
ruby-1.9.2-p290 :051 > u.login_profile.exists?
 => true 

However, if the user exists but does not have a login profile, then the method throws an exception, rather than returning false:

ruby-1.9.2-p290 :053 > u = iam.users["testuser2"]
 => <AWS::IAM::User name:testuser2> 
ruby-1.9.2-p290 :054 > u.login_profile.exists?
AWS::Errors::Base: <ErrorResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
  <Error>
    <Type>Sender</Type>
    <Code>NoSuchEntity</Code>
    <Message>Cannot find Login Profile for User testuser2</Message>
  </Error>
  <RequestId>4469b2e7-60de-11e2-bca3-3fb71850350a</RequestId>
</ErrorResponse>

    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:318:in `return_or_raise'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/core/client.rb:419:in `client_request'
    from (eval):3:in `get_login_profile'
    from /Users/jeff/.rvm/gems/ruby-1.9.2-p290@2212/gems/aws-sdk-1.8.0/lib/aws/iam/login_profile.rb:80:in `exists?'
    from (irb):54
    from /Users/jeff/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

This behaviour occurs with version 1.8.0 of the gem.

SQS connectivity issues produce weak exception.

For the past 3 days, intermittently, we've been getting exceptions when trying to write to various SQS queues using the AWS SDK for Ruby. About 70% of our attempts are successful, and the queues are numerous and vary greatly in the messages they receive.

The error actually occurs when we attempt to lookup the queue before the write using code similar to this:

    queue = AWS::SQS.new.queues.with_prefix(domain).first

We cannot see the response in the log (probably because the exception ;) , which is problematic because according to http://status.aws.amazon.com/ all is peachy with SQS. A more verbose exception would be much appreciated.

Exception:

 expected string value for option queue_url
  /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/option_grammar.rb:94:in `validate' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/option_grammar.rb:571:in `block in validate' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/option_grammar.rb:567:in `each' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/option_grammar.rb:567:in `validate' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/option_grammar.rb:582:in `request_params' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client/query_xml.rb:82:in `block (2 levels) in define_client_method' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:449:in `build_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:389:in `block (3 levels) in client_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/response.rb:160:in `call' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/response.rb:160:in `rebuild_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/response.rb:104:in `initialize' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:166:in `new' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:166:in `new_response' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:389:in `block (2 levels) in client_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:293:in `log_client_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:377:in `block in client_request' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:275:in `return_or_raise' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/core/client.rb:376:in `client_request' (eval):3:in `send_message' /app/.bundle/gems/ruby/1.9.1/gems/aws-sdk-1.5.7/lib/aws/sqs/queue.rb:111:in `send_message' /app/vendor/gems/vtx_payments-1.2.2/app/models/msp_comment_queue.rb:7:in `send_message' /app/vendor/gems/msp_webpay-2.1.2/app/models/loan_payment.rb:121:in `send_new_payment_comment' /app/vendor/gems/vtx_payments-1.2.2/app/models/basic_msp_payment.rb:208:in `save' /app/vendor/gems/msp_webpay-2.1.2/app/controllers/payments_controller.rb:61:in `block in create' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/mime_responds.rb:264:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/mime_responds.rb:264:in `retrieve_response_from_mimes' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/mime_responds.rb:191:in `respond_to' /app/vendor/gems/msp_webpay-2.1.2/app/controllers/payments_controller.rb:53:in `create' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/implicit_render.rb:4:in `send_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/abstract_controller/base.rb:150:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/rendering.rb:11:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/abstract_controller/callbacks.rb:18:in `block in process_action' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/callbacks.rb:487:in `_run__2335845847369952677__process_action__4066962682823091991__callbacks' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/callbacks.rb:94:in `run_callbacks' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/abstract_controller/callbacks.rb:17:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/rescue.rb:17:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/notifications.rb:52:in `block in instrument' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/notifications/instrumenter.rb:21:in `instrument' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/notifications.rb:52:in `instrument' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/instrumentation.rb:29:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:257:in `block in perform_action_with_newrelic_trace' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:252:in `perform_action_with_newrelic_trace' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/abstract_controller/base.rb:119:in `process' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/abstract_controller/rendering.rb:41:in `process' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal.rb:138:in `dispatch' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_controller/metal.rb:178:in `block in action' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/routing/route_set.rb:68:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/routing/route_set.rb:68:in `dispatch' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/routing/route_set.rb:33:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:148:in `block in call' /app/.bundle/gems/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:93:in `block in recognize' /app/.bundle/gems/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:75:in `optimized_each' /app/.bundle/gems/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/code_generation.rb:92:in `recognize' /app/.bundle/gems/ruby/1.9.1/gems/rack-mount-0.6.14/lib/rack/mount/route_set.rb:139:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/routing/route_set.rb:499:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `block in call' /usr/ruby1.9.2/lib/ruby/1.9.1/timeout.rb:57:in `timeout' /app/.bundle/gems/ruby/1.9.1/gems/rack-timeout-0.0.3/lib/rack/timeout.rb:16:in `call' /app/.bundle/gems/ruby/1.9.1/gems/newrelic_rpm-3.4.0.1/lib/new_relic/rack/browser_monitoring.rb:12:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/head.rb:14:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.5/lib/rack/methodoverride.rb:24:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/params_parser.rb:21:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/flash.rb:182:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/cookies.rb:302:in `call' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.15/lib/active_record/query_cache.rb:32:in `block in call' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.15/lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.15/lib/active_record/query_cache.rb:12:in `cache' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.15/lib/active_record/query_cache.rb:31:in `call' /app/.bundle/gems/ruby/1.9.1/gems/activerecord-3.0.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/callbacks.rb:46:in `block in call' /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.15/lib/active_support/callbacks.rb:416:in `_run_call_callbacks' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/callbacks.rb:44:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.5/lib/rack/sendfile.rb:106:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/remote_ip.rb:48:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.15/lib/rails/rack/logger.rb:13:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.5/lib/rack/runtime.rb:17:in `call' /app/.bundle/gems/ruby/1.9.1/gems/actionpack-3.0.15/lib/action_dispatch/middleware/static.rb:30:in `call' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.15/lib/rails/application.rb:168:in `call' /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.15/lib/rails/application.rb:77:in `method_missing' /app/.bundle/gems/ruby/1.9.1/gems/rack-fiber_pool-0.9.2/lib/rack/fiber_pool.rb:21:in `block in call' /app/.bundle/gems/ruby/1.9.1/gems/rack-fiber_pool-0.9.2/lib/fiber_pool.rb:48:in `call' /app/.bundle/gems/ruby/1.9.1/gems/rack-fiber_pool-0.9.2/lib/fiber_pool.rb:48:in `block (3 levels) in initialize' /app/.bundle/gems/ruby/1.9.1/gems/rack-fiber_pool-0.9.2/lib/fiber_pool.rb:47:in `loop' /app/.bundle/gems/ruby/1.9.1/gems/rack-fiber_pool-0.9.2/lib/fiber_pool.rb:47:in `block (2 levels) in initialize'

S3: Object ACL gets reset to :private when updating metadata

Updating metadata on an object does a copy in the background, and the copy command sets a :private ACL on the new object by default. That a fine behavior for copy, but when doing something like object.metadata['cache-control'] = 'max-age=315360000', the ACL getting reset is surprising.

s3_url expire option ignore ActiveSupport::Duration

Rails' well-known time duration shorthand syntax like 10.minutes uses a special class, ActiveSupport::Duration. This class tries to acts as a Fixnum.

Unfortunately, AWS::S3::S3Object#expiration_timestamp uses the case statement to check the class of the expire option, which means that it falls back to the default case and gives the URL an expiry of 1 hour, regardless of the given value:

Time.at(bucket.objects['test'].url_for(:read).to_s[/Expires=(\d+)/, 1].to_i) - Time.now
 => 3599.035428 
Time.at(bucket.objects['test'].url_for(:read, :expires => 10.minutes).to_s[/Expires=(\d+)/, 1].to_i) - Time.now
 => 3599.388125 
Time.at(bucket.objects['test'].url_for(:read, :expires => 1.day).to_s[/Expires=(\d+)/, 1].to_i) - Time.now
 => 3599.458669 

Since it is so common in Rails, and so hard to spot, I think the method should be smarter and deal with the problem. One way would be to normalize it with to_i if it is_a? Integer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.