title: Jenkinsfile access aws credentials
body: <p>I am trying to access AWS credentials stored in Jenkins with following in jenkins pipeline (<code>Jenkinsfile</code>)</p>
  
  <pre><code>steps {
              withCredentials([usernamePassword(credentialsId: 'eb1092d1-0f06-4bf9-93c7-32e5f7b9ef76', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY')]) {
                  sh 'echo $AWS_ACCESS_KEY_ID'
                  sh 'echo $AWS_SECRET_ACCESS_KEY'
              }
        }
  </code></pre>
  
  <p>Its erroring with </p>
  
  <pre><code>org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: Could not find credentials entry with ID 'eb1092d1-0f06-4bf9-93c7-32e5f7b9ef76'
  at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:153)
  at org.jenkinsci.plugins.credentialsbinding.impl.UsernamePasswordMultiBinding.bind(UsernamePasswordMultiBinding.java:76)
  at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution.start(BindingStep.java:114)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:270)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:178)
  at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
  at sun.reflect.GeneratedMethodAccessor3000.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
  at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
  at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:155)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:155)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:159)
  at org.kohsuke.groovy.sandbox.impl.Checker.checkedCall(Checker.java:129)
  at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.methodCall(SandboxInvoker.java:17)
  at WorkflowScript.run(WorkflowScript:16)
  </code></pre>
  
  <p>And with </p>
  
  <pre><code>withCredentials([[ $class: 'AmazonWebServicesCredentialsBinding', credentialsId: 'eb1092d1-0f06-4bf9-93c7-32e5f7b9ef76', accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
                  sh "echo this is ${env.AWS_ACCESS_KEY_ID}"
                  sh "echo this is ${env.AWS_SECRET_ACCESS_KEY}"
              }
  </code></pre>
  
  <p>Erroring </p>
  
  <pre><code>org.jenkinsci.plugins.credentialsbinding.impl.CredentialNotFoundException: Could not find credentials entry with ID 'eb1092d1-0f06-4bf9-93c7-32e5f7b9ef76'
  at org.jenkinsci.plugins.credentialsbinding.MultiBinding.getCredentials(MultiBinding.java:153)
  at com.cloudbees.jenkins.plugins.awscredentials.AmazonWebServicesCredentialsBinding.bind(AmazonWebServicesCredentialsBinding.java:97)
  at org.jenkinsci.plugins.credentialsbinding.impl.BindingStep$Execution.start(BindingStep.java:114)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:270)
  at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:178)
  at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
  at sun.reflect.GeneratedMethodAccessor3000.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
  at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
  at org.kohsuke.groovy.sandbox.impl.Checker$1.call(Checker.java:157)
  at org.kohsuke.groovy.sandbox.GroovyInterceptor.onMethodCall(GroovyInterceptor.java:23)
  at 
  </code></pre>
  
  <p>I do have credentials with ID <code>eb1092d1-0f06-4bf9-93c7-32e5f7b9ef76</code></p>
  
  <p>I have installed <strong>CloudBees AWS Credentials Plugin</strong>  Version 1.24</p>
  
  <p>anyone know whats wrong here ?</p>