Sha256: 55900d13f0b63902fcb8aa98f8314b881db2b535983c1a4b5c0bf2f74b306382
Contents?: true
Size: 1.64 KB
Versions: 1
Compression:
Stored size: 1.64 KB
Contents
### exist ```ruby describe s3_bucket('my-bucket') do it { should exist } end ``` ### have_acl_grant ```ruby describe s3_bucket('my-bucket') do its(:acl_owner) { should eq 'my-bucket-owner' } its(:acl_grants_count) { should eq 3 } it { should have_acl_grant(grantee: 'my-bucket-owner', permission: 'FULL_CONTROL') } it { should have_acl_grant(grantee: 'http://acs.amazonaws.com/groups/s3/LogDelivery', permission: 'WRITE') } it { should have_acl_grant(grantee: '68f4bb06b094152df53893bfba57760e', permission: 'READ') } end ``` ### have_cors_rule ```ruby describe s3_bucket('my-bucket') do it do should have_cors_rule( allowed_methods: ['GET'], allowed_origins: ['*'] ) end it do should have_cors_rule( allowed_headers: ['*'], allowed_methods: ['GET'], allowed_origins: ['https://example.org', 'https://example.com'], expose_headers: ['X-Custom-Header'], max_age_seconds: 3600 ) end end ``` ### have_policy ```ruby describe s3_bucket('my-bucket') do should have_policy <<-POLICY { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowPublicRead", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::my-bucket/*" } ] } POLICY end end ``` ### have_object ```ruby describe s3_bucket('my-bucket') do it { should have_object('path/to/object') } end ``` ### advanced `s3_bucket` can use `Aws::S3::Bucket` resource (see http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Bucket.html). ```ruby describe s3_bucket('my-bucket') do its('acl.owner.display_name') { should eq 'my-bucket-owner' } end ```
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
awspec-0.26.0 | doc/_resource_types/s3_bucket.md |