diff --git a/Jenkinsfile b/Jenkinsfile index fbea7de..0e4a468 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,19 +15,13 @@ pipeline { } stage('Authenticate & Configure') { steps { - // Use AWS credentials directly with withCredentials - withCredentials([ - [$class: 'AmazonWebServicesCredentialsBinding', - credentialsId: 'jenkins-codeartifact', - accessKeyVariable: 'AWS_ACCESS_KEY_ID', - secretKeyVariable: 'AWS_SECRET_ACCESS_KEY'] - ]) { + // Use AWS Steps Plugin to pick up your IAM user keys + withAWS(credentials: 'jenkins-codeartifact', region: "${AWS_REGION}") { script { // Fetch a short-lived CodeArtifact token env.CODEART_TOKEN = sh( script: """ aws codeartifact get-authorization-token \\ - --region ${AWS_REGION} \\ --domain ${CODEART_DOMAIN} \\ --domain-owner ${AWS_ACCOUNT_ID} \\ --query authorizationToken --output text