MistAws
Uses the ruby aws-sdk v2 Resource Interface to create some use specific higher level functionality.
NOTE: Currently the only object implemented is Iam for creating / deleting instance roles and an Ec2 for working with Security Groups
Installation
Install the Gem
Add this line to your application's Gemfile:
gem 'mist_aws'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mist_aws
Generate Yard Docs
$ rake yard
$ open doc/index.html
Usage
- Get the handle to the MistAws::Iam object
- Credentials will come from the
my_profile_name
profile in ~/.aws/credentials as per Providing AWS Credentials in the AWS SDK for Ruby
mist_aws = ::MistAws::Iam.new(profile_name: "my_profile_name", region: "us-east-1")
- Credentials will come from the
- Create an IAM Role
- role_policy_document is a JSON text file that is an AWS IAM policy
- This method will create:
- Role
- Role Policy
- Instance profile
- Connect them all together
- Returns a Role Resource instance
role = mist_aws.create_iam_role(role_name, role_policy_name, role_policy_document, instance_profile_name)
See yard docs for more info.
Contributing
I would be very interested in feedback on things that could be done better. Also would be interested in how to better do the rspec tests. I felt like there was WAY too much mocking. I did find it useful for finding bugs and broken assumptions though.
- Fork it ( https://github.com/[my-github-username]/mist_aws/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request