k1LoW / awspec

RSpec tests for your AWS resources.
MIT License
1.17k stars 192 forks source link

s3 bucket tests expect display_name attribute on acl #275

Open edmundcraske opened 7 years ago

edmundcraske commented 7 years ago

when testing the acl_owner attribute of an s3 bucket, it is assumed that the API will return a display_name. This only works for older AWS regions, and does not work for newer ones such as eu-west-2, eu-central-1.

As such, it is impossible to test the acl owner of a bucket in these regions. Perhaps it needs to be possible to test on ID as well as display name?

k1LoW commented 7 years ago

Hi @edmundcraske . Thank you for your report! I'll check it.

k1LoW commented 7 years ago

Hi @edmundcraske !

This only works for older AWS regions, and does not work for newer ones such as eu-west-2, eu-central-1.

I create s3_bucket at eu-west-2. Certainly, the return value of get_bucket_acl 's display_name was nil

I think about the policy of acl_owner as follows,

describe s3_bucket('eu-bucket-name'), region: 'eu-west-2' do
  it { should exist }
  its('acl.owner.id') { should eq 'xxxxxXXXXXxxxxxXXXXXX' }
end