如何将AWS凭证与Jenkins一起使用以部署到Elastic Beanstalk?

克洛伊

我已经在Jenkins中在处输入了AWS凭证/credentials,但是它们没有出现在AWS Elastic Beanstalk插件中的“构建后”步骤的下拉列表中。

在此处输入图片说明

如果单击“验证凭据”,则会收到此奇怪的错误。

在此处输入图片说明

Failure com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain: [EnvironmentVariableCredentialsProvider: Unable to load AWS credentials from environment variables (AWS_ACCESS_KEY_ID (or AWS_ACCESS_KEY) and AWS_SECRET_KEY (or AWS_SECRET_ACCESS_KEY)), SystemPropertiesCredentialsProvider: Unable to load AWS credentials from Java system properties (aws.accessKeyId and aws.secretKey), com.amazonaws.auth.profile.ProfileCredentialsProvider@5c932b96: profile file cannot be null, com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper@32abba7: The requested metadata is not found at http://169.254.169.254/latest/meta-data/iam/security-credentials/] at com.amazonaws.auth.AWSCredentialsProviderChain.getCredentials(AWSCredentialsProviderChain.java:136)

I don't know where it got that IP address. When I search for that IP in the Jenkins directory, I turn up with

-bash-4.2$ grep -r 169.254.169.254 *
plugins/ec2/AMI-Scripts/ubuntu-init.py:conn = httplib.HTTPConnection("169.254.169.254")

The contents of that file is here: https://pastebin.com/3ShanSSw


There are actually 2 different Amazon Elastic Beanstalk plugins.

Neither of them work. Neither will display the credentials in the drop down list. Since updating Jenkins, I am unable to even show "Deploy to Elastic Beanstalk" as a post-build step for the first one (v0.3.19) even though it is the only one installed.

For the 2nd plugin (v1.7.4), I see this screen shot:

在此处输入图片说明

When I fill in what I can, and run it, it gives the error

No credentials provided for build!!!
Environment found (environment id='e-yfwqnurxh6', name='appenvironment'). Attempting to update environment to version label 'sprint5-13'
'appenvironment': Attempt 0/5
'appenvironment': Problem:
com.amazonaws.services.elasticbeanstalk.model.AWSElasticBeanstalkException: No Application Version named 'sprint5-13' found. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: af9eae4f-ad56-426e-8fe4-4ae75548f3b1)

I tried to add an S3 sub-task to the Elastic Beanstalk deployment, but it failed with an exception.

No credentials provided for build!!!
Root File Object is a file. We assume its a zip file, which is okay.
Uploading file awseb-4831053374102655095.zip as s3://appname-sprint5-15.zip
ERROR: Build step failed with exception
com.amazonaws.services.s3.model.AmazonS3Exception: The XML you provided was not well-formed or did not validate against our published schema (Service: Amazon S3; Status Code: 400; Error Code: MalformedXML; Request ID: 7C4734153DB2BC36; S3 Extended Request ID: x7B5HflSeiIw++NGosos08zO5DxP3WIzrUPkZOjjbBv856os69QRBVgic62nW3GpMtBj1IxW7tc=), S3 Extended Request ID: x7B5HflSeiIw++NGosos08zO5DxP3WIzrUPkZOjjbBv856os69QRBVgic62nW3GpMtBj1IxW7tc=

Chloe

詹金斯绝望地过时了,无法维持。我添加了Post Build Task插件,用户身份安装了eb工具jenkinseb init在job目录中运行,进行了编辑.elasticbeanstalk/config.yml以添加行

deploy:
  artifact: target/AppName-Sprint5-SNAPSHOT-bin.zip

然后在shell命令中输入以部署构建。

/var/lib/jenkins/.local/bin/eb deploy -l sprint5-${BUILD_NUMBER}

在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

AWS Elastic Beanstalk缓存?

如何仅增加AWS EC2上的根磁盘大小以与Elastic Beanstalk一起使用?

如何从Jenkins将Python应用程序部署到Amazon Elastic Beanstalk?

仅将指定的文件部署到AWS Elastic Beanstalk

使用AWS Elastic Beanstalk的FTP

将Meteor App部署到Elastic Beanstalk

自动将GitHub分支部署到AWS Elastic Beanstalk

部署到AWS Elastic Beanstalk时ConnectionString转换

AWS Elastic Beanstalk问题

将Docker与AWS Elastic Beanstalk一起使用有什么优势?

AWS Lambda与Elastic Beanstalk

Elastic Beanstalk部署:UndefinedModelAttributeError

AWS Elastic BeanStalk SignatureDoesNotMatch

AWS CDK代码管道如何部署到Elastic Beanstalk?

React Application具有过渡环境并在AWS Elastic BeanStalk上与Docker一起部署

使用Elastic Beanstalk登录

使用AWS Elastic Beanstalk,图如何与多个实例一起使用

如何将Spring Boot应用程序大战部署到AWS Elastic Beanstalk?

AWS Elastic Beanstalk调度部署

如何将我的云代码部署到AWS Elastic Beanstalk?(解析服务器)

AWS Elastic Beanstalk部署顺序

如何使用 Elastic Beanstalk 设置 aws-sdk 凭证?

将 Java 网站部署到 AWS Elastic Beanstalk

Azure DevOps 将 .net core 部署到 AWS elastic beanstalk

如何使用 CircleCI 将 Java 11 应用程序部署到 AWS Elastic Beanstalk?

在 AWS Elastic Beanstalk 上部署时无法通过映像名称引用与 docker 一起使用的 RabbitMQ

将 MongoDB 与部署在 Elastic Beanstalk 上的 NodeJS 应用程序一起使用的推荐方法是什么?

使用 Jenkins Pipeline 將 web 應用程序部署到 AWS Elastic Beanstalk

将 Rails 6.1 部署到 AWS Elastic Beanstalk 的问题