Last active
April 8, 2016 16:54
-
-
Save tedder/8226d9e5ebf4cc4285bfacb242214ce8 to your computer and use it in GitHub Desktop.
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
// Groovy Version: 2.4.6 JVM: 1.8.0_72-internal Vendor: Oracle Corporation OS: Linux | |
// openjdk version "1.8.0_72-internal" | |
// to run: groovy -Dgroovy.grape.report.downloads=true cred-npe.groovy | |
// running in my env: | |
// docker run -it tedder42/stanson-java8-jre bash | |
// curl -s get.sdkman.io | bash | |
// source "$HOME/.sdkman/bin/sdkman-init.sh" | |
// sdk install groovy | |
@Grab(group='commons-logging', module='commons-logging', version='1.2') | |
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.5') | |
@Grab(group='org.apache.httpcomponents', module='httpcore', version='4.4.2') | |
@Grab(group='com.fasterxml.jackson.core', module='jackson-core', version='2.6.1') | |
@Grab(group='com.fasterxml.jackson.core', module='jackson-databind', version='2.6.1') | |
@Grab(group='com.fasterxml.jackson.core', module='jackson-annotations', version='2.6.1') | |
@Grab(group='com.amazonaws', module='aws-java-sdk', version='1.10.67', transitive=true) | |
@Grab(group='org.apache.commons', module='commons-io', version='1.3.2') | |
import com.amazonaws.auth.AWSCredentials | |
import com.amazonaws.auth.AWSCredentialsProvider | |
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain | |
AWSCredentialsProvider p = new DefaultAWSCredentialsProviderChain() | |
AWSCredentials creds = p.getCredentials() | |
println creds.getAWSAccessKeyId() | |
println creds.getAWSSecretKey() | |
p.refresh() | |
println("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment