Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Rusoto
AWS client libraries for Rust
Current state
Alpha. Rust code has been generated from JSON documentation of services from botocore.
Currently implemented
- SQS: list queues, create queue, get queue url, send message, receive message, delete message, delete queue.
- S3: list buckets, create bucket, delete bucket, upload object, download object, delete object.
Installation
Rusoto is available on crates.io.
Semantic versioning
Rusoto complies with semantic versioning 2.0.0. Until reaching 1.0.0 the API is to be considered unstable. See Cargo.toml or rusoto on crates.io for current version.
Contributing
- Install Rust 1.1.0 or later - http://www.rust-lang.org/
- Check out code from github
- Set up AWS credentials: environment variables (export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY), ~/.aws/credentials, or use an IAM instance profile.
cargo build
cargo run
- This will create real AWS resources and you may be charged.
Credentials
Rusoto will search for credentials in this order:
- Environment variables
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
. - AWS Credentials file:
~/.aws/credentials
. It will use the firstaws_access_key_id
andaws_secret_access_key
it finds. Profiles are not yet supported. - IAM instance profile. Rusoto will query the metadata service for an instance profile/role and fetch the access key, secret access key and token to supply those for requests.
If Rusoto exhausts all three options it will panic.
Credential refreshing
Credentials obtained from environment variables and credential files expire ten minutes after being acquired, and are refreshed on subsequent calls to get_credentials()
.
IAM instance profile credentials are refreshed as needed. Upon calling get_credentials()
it will see if they are expired or not. If expired, it attempts to get new credentials from the metadata service. If that fails it will panic. IAM credentials expiration time comes from the IAM metadata response.
Output from cargo run
should resemble:
Existing queue: https://sqs.us-east-1.amazonaws.com/428250473290/test1
Existing queue: https://sqs.us-east-1.amazonaws.com/428250473290/test2
Created queue test_q_1436921723 with url https://sqs.us-east-1.amazonaws.com/428250473290/test_q_1436921723
Verified queue url https://sqs.us-east-1.amazonaws.com/428250473290/test_q_1436921723 for queue name test_q_1436921723
Send message with body 'lorem ipsum dolor sit amet' and created message_id 9315712d-3e6f-4264-95d4-426fe6a6f69f
Received message 'lorem ipsum dolor sit amet' with id 9315712d-3e6f-4264-95d4-426fe6a6f69f
Message deleted by request_id 2866edd9-d7ee-534b-9b43-a3c66653ef6e
Queue https://sqs.us-east-1.amazonaws.com/428250473290/test_q_1436921723 deleted by request_id b51e12e8-03dc-547c-aa7c-5cf7b261d6e1
Everything worked.
Example code in src/bin/main.rs
let sqs = new;
// list existing queues
let response = try!;
for q in response.queue_urls
Code generation
Local integration testing of IAM credentials
Edit the address
location in src/credentials.rs. For local testing, I use moe and set the string to this:
let mut address : String = "http://localhost:8080/latest/meta-data/iam/security-credentials".to_string;