aws-credentials

Get AWS credentials in various ways
0.6.0 Latest release released

aws-credentials

Crystal CI Releases

Get AWS credentials in various ways.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  aws-credentials:
    github: y2k2mt/aws-credentials.cr
  1. Run shards install

Usage

Providers resolves credentials in order from given Provider.

In the example below, at first ,Providers resolves credentials from EnvProvider ('AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY' in env) and then resolves credentials from SharedCredentialFileProvider ('~/.aws/credentials').

require "aws-credentials"

include Aws::Credentials

provider = Providers.new ([
  EnvProvider.new,
  SharedCredentialFileProvider.new
] of Provider)

credentials = provider.credentials
# Aws::Credentials::Credentials(@access_key_id="AKIA...",@expiration=nil,@secret_access_key="mVlf...",@session_token=nil)

Current Provider implementation is as follows:

Contributing

  1. Fork it (https://github.com/y2k2mt/aws-credentials/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • y2k2mt - creator and maintainer
aws-credentials:
  github: y2k2mt/aws-credentials
  version: ~> 0.6.0
License MIT
Crystal 1.0.0

Authors

Dependencies 0

Development Dependencies 2

  • ameba ~> 0.14
    {'github' => 'crystal-ameba/ameba', 'version' => '~> 0.14'}
  • awscr-signer ~> 0.8.1
    {'github' => 'taylorfinnell/awscr-signer', 'version' => '~> 0.8.1'}

Dependents 0

Last synced .
search fire star recently