Last active
February 17, 2017 19:04
-
-
Save alexrudd/fe439c26898e26845511133fa507bfdc to your computer and use it in GitHub Desktop.
Default AWS credentials chain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws/defaults" | |
) | |
func main() { | |
creds := defaults.CredChain(defaults.Config(), defaults.Handlers()) | |
// Validate credentials | |
if _, err := creds.Get(); err != nil { | |
// We couldn't get any credentials | |
fmt.Println(err) | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment