https://github.com/k1low/awsrm
Simple AWS Resource "READONLY" Mapper for awspec.
https://github.com/k1low/awsrm
aws
Last synced: about 1 year ago
JSON representation
Simple AWS Resource "READONLY" Mapper for awspec.
- Host: GitHub
- URL: https://github.com/k1low/awsrm
- Owner: k1LoW
- License: mit
- Created: 2017-05-31T06:36:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-16T14:41:52.000Z (almost 8 years ago)
- Last Synced: 2025-03-29T05:41:33.693Z (over 1 year ago)
- Topics: aws
- Language: Ruby
- Homepage:
- Size: 63.5 KB
- Stars: 7
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# awsrm [](https://rubygems.org/gems/awsrm) [](https://travis-ci.org/k1LoW/awsrm)
Simple AWS Resource "READONLY" Mapper for awspec.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'awsrm'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install awsrm
## Usage
### ::one
`Awsrm::Resource::one` identify uniquely one resource or raise error. this method not like ActiveRecord `find` .
- identify `1` resource -> return resource
- identify `0` resource -> raise error
- identify `>1` resources -> raise error
```ruby
require 'awspec'
require 'awsrm'
describe route_table(Awsrm::RouteTable.one(name: 'my-route-table', vpc: 'my-vpc').id) do
it { should exist }
it { should belong_to_vpc('my-vpc') }
end
```
### ::all
`Awsrm::Resource::all` return all resources.
- identify `0` resource -> return empty array
- identify `>1` resources -> return resources array
```ruby
require 'awspec'
require 'awsrm'
Awsrm::RouteTable.all(vpc: 'my-vpc').each do | route |
describe route_table(route.id) do
it { should exist }
it { should belong_to_vpc('my-vpc') }
end
end
```
## Support AWS Resources
[Resources](doc/resources.md)
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).