詹金斯 s3 存储桶下载

时间:2021-07-02 13:02:31

标签: amazon-web-services jenkins amazon-s3 jenkins-pipeline aws-steps

我正在尝试下载整个 s3 存储桶。我正在使用 aws 步骤包。 这是我的管道:

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)
                }
            }
        }
    }
}

这给了我一个 403 禁止。我已授予 s3 对其凭据进入的 iam 用户的完全访问权限。现在,经过一些研究,我发现即使密钥不存在,s3 也会返回 403。

这些是我的日志:

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=

请让我知道我在这里遗漏了什么。

0 个答案:

没有答案