inspec/docs/resources/aws_s3_buckets.md.erb
Matthew Dromazos 0df67fc7d0 New Skeletal Resource aws_s3_buckets (#2653)
* Initial commit of skeletal resource aws_s3_buckets
* Add fixes to documents
* Removes property 'creation_date' for there is no use case as of right now
* Rebases on master and moves aws_s3_buckets integration test to the correct location
* Adds test on unit test for false exists

Signed-off-by: Matthew Dromazos <dromazmj@dukes.jmu.edu>
2018-04-05 12:49:30 -04:00

53 lines
1.1 KiB
Text

---
title: About the aws_s3_buckets Resource
---
# aws\_s3\_buckets
Use the `aws_s3_buckets` InSpec audit resource to list all buckets in a single account.
Use the `aws_s3_bucket` InSpec audit resource to perform in-depth auditing of a single S3 bucket.
<br>
## Syntax
An `aws_s3_buckets` resource block takes no arguments
describe aws_s3_buckets do
it { should exist }
end
<br>
## Examples
The following examples show how to use this InSpec audit resource.
As this is the initial release of `aws_s3_buckets`, its limited functionality precludes examples.
<br>
## Matchers
### exists
The control will pass if the resource contains at least one bucket.
# Test if there are any buckets
describe aws_s3_buckets
it { should exist }
end
## Properties
### bucket\_names
Provides an array of strings containing the names of the buckets.
# Examine what buckets have been created.
describe aws_s3_buckets do
its('bucket_names') { should eq ['my_bucket'] }
# OR
its('bucket_names') { should include 'my_bucket' }
end