I am trying to download the whole s3 bucket. I am using aws steps package. Here is my pipeline:
pipeline {
agent any
stages {
stage('S3download') {
steps {
withAWS(credentials:'bd11adef-4cf1-4a93-886e-ba6a177a9a21') {
s3Download(file: 'pic-min.jpg', bucket: 'lambda-triggertest', path: 'pic-min.jpg',force:true)
}
}
}
}
}
This gives me a 403 forbidden. I have given s3 full access to the iam user whose credentials are going in.Now, after a little research i found out that s3 returns a 403 even if the key doesnt exist.
These are my logs:
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/pipeline-s3
[Pipeline] {
[Pipeline] stage
[Pipeline] { (S3download)
[Pipeline] withAWS
Constructing AWS Credentials[Pipeline] {
[Pipeline] s3Download
Downloading s3://lambda-triggertest/pic-min.jpg to file:/var/lib/jenkins/workspace/pipeline-s3/pic-min.jpg
[Pipeline] }
[Pipeline] // withAWS
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden (Service: Amazon S3;
Status Code: 403; Error Code: 403 Forbidden; Request ID: C4WQHWREBBCKS6H6; S3 Extended Request ID: GDLqM3cpIROW4jxoYPKQUYt05W6wIxZlVquKoJpN7UmF3+R32yBqjwoXThCkZBWC0Yx0geWbCXw=; Proxy: null)
, S3 Extended Request ID: GDLqM3cpIROW4jxoYPKQUYt05W6wIxZlVquKoJpN7UmF3+R32yBqjwoXThCkZBWC0Yx0geWbCXw=
Please let me know what am i missing here.