aws-credentials
Version, currently 0.1.18 versions
github.com/y2k2mt/aws-credentials.cr
Get AWS credentials in various ways.
6 stars
0 dependents
License: MIT
Nothing has been indexed for 0.1.1 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
aws-credentials:
github: y2k2mt/aws-credentials.cr
version: ~> 0.1.1Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.1. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
# aws-credentials
[](https://github.com/y2k2mt/aws-credentials.cr/actions)
[](https://github.com/y2k2mt/aws-credentials.cr/releases)
Get AWS credentials in various ways.
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
aws-credentials:
github: y2k2mt/aws-credentials.cr
```
2. 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').
```crystal
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:
- [EnvProvider](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html)
- [SharedCredentialFileProvider](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)
- [InstanceMetadataProvider](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html)
- [ContainerCredentialProvider](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html)
- [AssumeRoleProvider](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)
- Usage: Please watch `spec/it/assume_role_with_sts_spec.cr`
- [AssumeRoleWithWebIdentityProvider](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html)
- Usage: Please watch `spec/it/assume_role_with_sts_spec.cr`
- SimpleCredentials (Simply holds given credentials)
## 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](https://github.com/y2k2mt) - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.1- Tagged
- Mar 10, 2025
- Commit
48d9f5135a09- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/y2k2mt/aws-credentials.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 8