proxy.golang.org : github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds
Package ec2rolecreds provides the credentials provider implementation for retrieving AWS credentials from Amazon EC2 Instance Roles via Amazon EC2 IMDS. The Provider is not safe to be used concurrently, and does not provide any caching of credentials retrieved. You should wrap the Provider with a `aws.CredentialsCache` to provide concurrency safety, and caching of credentials. The EC2 Instance role credentials provider will automatically be the resolved credential provider in the credential chain if no other credential provider is resolved first. To explicitly instruct the SDK's credentials resolving to use the EC2 Instance role for credentials, you specify a `credentials_source` property in the config profile the SDK will load. Another way to use the EC2 Instance role credentials provider is to create it directly and assign it as the credentials provider for an API client. The following example creates a credentials provider for a command, and wraps it with the CredentialsCache before assigning the provider to the Amazon S3 API client's Credentials option. If you need more control, you can set the configuration options on the credentials provider using the imds.Options type to configure the EC2 IMDS API Client and ExpiryWindow of the retrieved credentials. See the github.com/aws/aws-sdk-go-v2/feature/ec2/imds module for more details on configuring the client, and options available.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds
Keywords:
aws
, aws-sdk
, go
, golang
License: Apache-2.0
Latest release: 25 days ago
Namespace: github.com/aws/aws-sdk-go-v2/credentials
Stars: 2,531 on GitHub
Forks: 612 on GitHub
Total Commits: 2384
Committers: 101
Average commits per author: 23.604
Development Distribution Score (DDS): 0.573
More commit stats: commits.ecosyste.ms
See more repository details: repos.ecosyste.ms
Last synced: 25 days ago