Why is my AWS Beanstalk deployment failing

Issue

New AWS Beanstalk deployments are failing with this exception:

[cloudbees-deployer:elastic-beanstalk] Switching environment 'MyEnv' to application 'MyApp' version 'MyApp-env-xxxx'...
com.cloudbees.plugins.deployer.exceptions.DeployException: The bucket name parameter must be specified when requesting an object (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
at com.cloudbees.plugins.deployer.engines.Engine.process(Engine.java:199)
at com.cloudbees.plugins.deployer.engines.Engine.perform(Engine.java:131)
at com.cloudbees.plugins.deployer.DeployPublisher.perform(DeployPublisher.java:101)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:771)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:731)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:680)
at hudson.model.Run.execute(Run.java:1766)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:381)
Caused by: com.amazonaws.AmazonServiceException: The bucket name parameter must be specified when requesting an object (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1182)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:770)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:489)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:310)
at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.invoke(AWSElasticBeanstalkClient.java:1928)
at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.updateEnvironment(AWSElasticBeanstalkClient.java:1810)
at com.cloudbees.plugins.deployer.impl.amazon.EngineImpl$DeployFileCallable.invoke(EngineImpl.java:434)
at com.cloudbees.plugins.deployer.impl.amazon.EngineImpl$DeployFileCallable.invoke(EngineImpl.java:228)
at com.cloudbees.plugins.deployer.engines.Engine$FingerprintingWrapper.invoke(Engine.java:271)
at com.cloudbees.plugins.deployer.engines.Engine.process(Engine.java:193)
... 11 more

Environment

  • CloudBees Jenkins Enterprise
  • CloudBees AWS Beanstalk Deployment plugin

Resolution

Amazon changed IAM requirements for user deploying to Beanstalk. The required policy to deploy is:

{
  "Effect": "Allow",
  "Action": [
    "s3:ListBucket",
    "s3:GetObject",
    "s3:PutObject",
    "s3:DeleteObject",
    "s3:PutObjectAcl",
    "s3:GetObjectAcl",
    "s3:GetBucketPolicy",
    "s3:Get*"
  ],
  "Resource": [
    "arn:aws:s3:::elasticbeanstalk*"
  ]
}
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.