Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Trevor Rowe
@trevorrowe
@danielberlinger It forces SSL everywhere by default. The only mechanism to disable SSL is to provide a url as :endpoint that uses the http scheme instead of https.
flushentitypacket
@flushentitypacket
Anyone know if batch sending SQS via #batch_send charges per message, or if that counts as a single request?
I'm also curious to know how it works internally, but I'm having trouble viewing the source for #send_message_batch.
Nitin
@nitinmohan87
i am noticing minor discrepancies between EC2.api.json and the AWS EC2 API docs
For example, when creating a SecurityGroup the AWS docs shows GroupName and GroupDescription as the required parameters. But the EC2.api.json metadata and therefore the ruby client expects GroupName and Description (instead of GroupDescription)
Why do we see such differences between the docs and the metadata?
Nitin
@nitinmohan87
For CreatePlacementGroup call should the identifier target be Name instead of Id? https://github.com/aws/aws-sdk-ruby/blob/master/aws-sdk-core/apis/EC2.resources.json#L68
I think the identifiers for the PlacementGroups are Name
Nitin
@nitinmohan87
I also find that the RouteTable is missing the DeleteRouteTable action in the EC2.resources.json
 "actions": {
  "Delete": {
    "request": {
      "operation": "DeleteRouteTable",
        "params": [
          { "target": "RouteTableId", "source": "identifier", "name": "Id" }
        ]
     }
  }
}
if you think the CreatePlacementGroup and the missing RouteTable Delete action are valid bugs I can definitely put in a pull request to fix them
Trevor Rowe
@trevorrowe
@flushentitypacket The Amazon SQS pricing page indicates you are billed per reqeust, not per message: http://aws.amazon.com/sqs/pricing/ - The Aws::SQS::Client#send_message_batch method allows you to send up to 10 messages in a single request. The 10 limit is imposed by the service, not the client. There is also a maximum payload size of 256KB per request. So if your messages are larger, you may not be able to send 10 in a single request without exceeding that size limit.

@nitinmohan87 I’ll try to answer these in order. The AWS EC2 documentation is documenting the wire-protocol, the format of the query string parameters as they are marshalled onto an HTTP request as a GET querystring or via a POST body. That representation is an implementation detail. The AWS SDKs, all of the, share a model of the API that gives friendlier, context sensitive names for many things. Some of these names will provide a pluralized name for a list where the wire procotol uses a singular name. Some will removed prefixes where it can be inferred from the context.

When using the Ruby SDK, you should be referencing its API documentation, not service protocol API docs.

Trevor Rowe
@trevorrowe
You are correct, the create placement group call should use the “Name” for the identifier, not “Id”. That is a bug and should be changed. If you could please submit a PR, that would be helpful.
I wouldn’t call a missing action a bug, just a missing feature. :) Yes, please do submit a pull request for adding Delete to RouteTable.
I have a work-in-progress model validator that should catch bugs like the incorrect identifier. My intention is to wire this up to our model builders so these are caught by an automated tool, instead of by users.
Nitin
@nitinmohan87
thanks for the explanation..
i will send a PR for to fix the CreatePlacementGroup and add a new feature to add Delete action to RouteTable ;)
is it ok if i send one PR that includes both changes?
Trevor Rowe
@trevorrowe
@nitinmohan87 One is fine.
Nitin
@nitinmohan87
Here it is - aws/aws-sdk-ruby#737 .. Thanks
Daniel Berlinger
@danielberlinger
@trevorrowe Thanks. And thanks for all the work on on this gem.
Brent Wheeldon
@BrentWheeldon
Hi there. We're using the aws-sdk ruby gem and have just upgraded from v1 to v2. I know that this is a breaking change, but I can't seem to find any documentation on what the breaking changes are, and how to fix them. Does such a doc exist, or is there one in the works? Thanks!
Trevor Rowe
@trevorrowe

@BrentWheeldon There is not an upgrading document currently. I hope to put together an upgrading guide soon. You can use v1 and v2 in the same application.

# in your Gemfile
gem 'aws-sdk’, '~> 2'
gem 'aws-sdk-v1'

# in your app
require 'aws-sdk'
require 'aws-sdk-v1’

AWS # v1 namespace
Aws # v2 namespace

This allows you to upgrade gradually.

Brent Wheeldon
@BrentWheeldon
Thanks, @trevorrowe. We'll just lock to 1 now. We don't have much code using it, so it won't take us long to upgrade once we know where to start.
Trevor Rowe
@trevorrowe
@BrentWheeldon I can definetly answer specific questions. If you are using v1 clients, almost nothing has changed. Most of what is different is basic configuration and some of the objet-oriented interfcaes on services.
Brent Wheeldon
@BrentWheeldon

@trevorrowe our main use case is something like:

s3 = AWS::S3.new(access_key_id: key_id, secret_access_key: access_key)
bucket = s3.buckets[bucket_name]
bucket.objects["file_name"].write(contents)

Seems like we now need to use AWS::S3::Client, specify the region as well as our credentials, and then use the put_object method rather than everything being a hash?

Trevor Rowe
@trevorrowe

@BrentWheeldon The client class is optional. You can use Aws::S3::Resource. That said, there is no longer a default region. The old default was ‘us-east-1’, so that should still work:

s3 = Aws::S3::Resource.new(
  access_key_id: key_id,
  secret_access_key: access_key,
  region: ‘us-east-1’)

Using the s3 resource object, you can upload an object in one of two ways. You can use the #put method, or you can use the #upload_file method. Using put will upload the entire object in a single request, but it is not recomended for large objects. If you prefer to upload a file from disk, use the #upload_file method.

obj = s3.bucket(bucket_name).object('file_name')

# single request, up to 5GB, contents can be a string or an IO object
obj.put(body:contents)

# managed upload, intelligently uses the multipart API for larger objects. Better reliability and performance
obj.upload_file('/path/to/source/file')
Brent Wheeldon
@BrentWheeldon
Nice, thanks for that info!
William Wilson
@millenniumbrain
Excuse me, I was wondering how to format the options in the upload_file method in order to grant public read access. I am having trouble finding the string it wants.
Trevor Rowe
@trevorrowe
Same options as Client#put_object, for example upload_file('source', acl: 'public-read')
William Wilson
@millenniumbrain
Ah, thanks!
Will Weaver
@funkymonkeymonk
Hey all, I'm trying to scope out how much effort it would take to add in the ability to use managed policies. Has there been any previous work done with this? Does anyone have any suggestions as to the scope of the change?
Trevor Rowe
@trevorrowe
@funkymonkeymonk If you are talking about adding the resource abstractions for managed policies, I’ve got good news for you. A user of the preview-release of boto3 already did the leg work. The Ruby SDK, Boto3, PHP, .NET and Java SDKs share these definitions, so once this gets merged upstream, I can add these to the Ruby SDK:
boto/boto3#71
Will Weaver
@funkymonkeymonk
You make me very happy. Thanks @trevorrowe
Trevor Rowe
@trevorrowe
@funkymonkeymonk No problem!
Jacob Rothstein
@jbr
anyone around that can answer an v1->v2 upgrade question?
s3_bucket.presigned_post(key: …) in v1 gives a fancy object with fields and url that accepts a multipart post. is there an equivalent in v2? s3_bucket.object(key).presigned_url(:put) gives a string url that stores the body as the object, which isn't ideal
Nitin
@nitinmohan87

will there be any feature additions to the CloudFormation.resources.json? I am finding some of the actions (like GetTemplate, GetStackPolicy, etc) are missing. Some of the resource schema do not have path information.

For example,

 "Stacks": {
  "request": { "operation": "DescribeStacks" },
    "resource": {
      "type": "Stack",
      "identifiers": [
        { "target": "Name", "source": "response", "path": "Stacks[].StackName" }
      ]
  }
Trevor Rowe
@trevorrowe
@nitinmohan87 The existing cloudformation resource document was submitted by a user. If it is incomplete, then we can definetly ammend it to add the missing functionality, especially adding actions, or paths.
Nitin
@nitinmohan87
i see.. thanks for the info.. also I am not finding a resources file for ElasticLoadBalancing. is it being actively worked on?
Trevor Rowe
@trevorrowe
@nitinmohan87 Not that I am aware of.
Nitin
@nitinmohan87
why are the attributes in EC2.resources.json are upper camel-cased - https://github.com/aws/aws-sdk-ruby/blob/master/aws-sdk-core/apis/EC2.resources.json#L39
while the EC2 API returns the attributes in response in lower-camel cased (e.g. keyName)?
it may not matter for ruby SDK since it transforms everything to snake_case. But wouldn't it be nice if the resources.json files could mimic the AWS response casing as much as possible?
Trevor Rowe
@trevorrowe

@nitinmohan87 The casing of attributes as they appear in the EC2.resources.json document is consistent with the names as they appear in the EC2.api.json document. They do not reference the names as they appear on the wire. This is standard with all of the various AWS protocols. ALL of the AWS SDKs, Java, .Net, PHP, Ruby, Python, CLI, JavaScript, and Go, use the member names as they appear in the API instead of the wire format name. For example, when working with Amazon EC2, if you describe instances, you get back over the wire something like (nested in the response):

<reservationSet>
  <item>
    <instanceSet>
      <item>
        <instanceId>i-1234578</instanceId></item>
    </instanceSet>
  </item>
</reservationSet>

None of our SDKs represent the “item” in the reservation list, or in the instance list. Also, none of our SDKs returns these two lists as “reservationSet” or “instanceSet”. They all use the names “Reservations” and “Instances”. This information is how it is documented in the EC2.api.json document. These deltas are not limited to Amazon EC2 either. These changes appear in many/most of the APIs.

Essentially, the API document describes a webservice’s public interface, with just enough information to marshall and unmarshall requests and responses given information such as the protocol, and the shape and shape reference traits.

For consistency, the resource models all references the API names, not the wire format names.

Nitin
@nitinmohan87
that makes sense.. thanks for the explanation
Trevor Rowe
@trevorrowe
@nitinmohan87 I’d be curious at some point, if possible to see what you are building with the resource definitions. Purly a curiosity of mine, and definetly not necessary. If you ever feel like showing it off, I’d be interested in meeting up in a Google hangout some time.
Nitin
@nitinmohan87
we are building a proxy that exposes a standardized json interface and a REST-ful interface.. i am part of a team working with @tve
Trevor Rowe
@trevorrowe
@nitinmohan87 I recall that. I’d be curious to see how you are using it and talk to you about your use case in more depth, especially as it pertains to the resource models.
Nitin
@nitinmohan87
sure.. let me discuss with our team and try to get the proper information
Federico Gonzalez
@fedegl
Can anyone help me to fetch SQS messages with the new sdk?
there is no documentation or examples on how to do it
This message was deleted
This message was deleted
resp = sqs.receive_message(
  queue_url: "...",
  attribute_names: ["All"],
  #message_attribute_names: ["MessageAttributeName", '...'],
  max_number_of_messages: 10,
  visibility_timeout: 1,
  wait_time_seconds: 1,
)
Trevor Rowe
@trevorrowe

@fedegl I just merged today a pull-request that adds a QueuePoller utility. You can read the examles on the pull-request for more information: aws/aws-sdk-ruby#740

This will go out with the next stable release, I expect some time this week.