Giter Club home page Giter Club logo

aws-beanstalk-publisher-plugin's Introduction

Amazon Web Services Elastic Beanstalk Publisher

Master status:

Build Status

This plugin allows for publishing to an Elastic Beanstalk application as either a Build or Post Build step.

Amazon credentials are set in the global configuration.
IAM credentials need to be able to read and upload to S3, and to read and configure Elastic Beanstalk.

Example Credentials

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "elasticbeanstalk:*",
        "s3:*"
      ],
      "Resource": "*"
    }
  ]
}

After adding the Access Key ID and Secret Key in to the Jenkins master configuration, click Advanced and choose a region to see what applications your credentials actually see.

The Access Key and Secret Key are optional. Credentials can be placed in the master configuration, in a .aws config file, or as environment variables.

If Jenkins is itself running inside AWS (for example on an EC2 instance) you can instead leave the Access Key ID and Secret Key blank, and the IAM instance role of the jenkins server will be used for authentication.

More about AWS credentials can be found here.

####Screenshot:

Global Configuration

Global Config

Job Configuration

![Job Config](job config.png)

Updates

-> 1.4.1

  • Remove env lookups from the additional behaviors.

-> 1.4

  • Changed the environment lookup to be an extension.
  • Added a way to look up environments inside an application by url, eg. some-env.elasticbeanstalk.com

-> 1.3

  • Fixed logic for printing log statements.
  • Fixed issue where failed updates would never actually give up.

-> 1.2

  • Added a print statement for events returned from AWS : BROKEN don't use

-> 1.0

  • Multithreading the update environment process, in case there are multiple environments to be updated.
  • Added test buttons to see which applications your credentials can see, both in the global and job config.
  • Added a test button to see currently available environment names for the given application.
  • Verify that environment completed updating.
  • Bug fixes regarding duplicate AWS credentials.

Attribution

This is a fork of Aldrin Leal's Elastic Beanstalk Deployment plugin

aws-beanstalk-publisher-plugin's People

Contributors

alex4108 avatar ashleymercer avatar basil avatar daniel-beck-bot avatar davidtanner avatar dependabot[bot] avatar djdenv avatar encyphered avatar felipe-vvoosh avatar joelsonoda avatar tchdp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-beanstalk-publisher-plugin's Issues

Deployment fails when bucket region is not set

I upgraded to 1.7.1 and my deployment now fails with the following stack trace:

FATAL: java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:25)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBBuilder.perform(AWSEBBuilder.java:65)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:405)
at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:347)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1720)
at hudson.model.Run.run(Run.java:1679)
at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:286)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.lang.NullPointerException
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBS3Uploader.uploadArchive(AWSEBS3Uploader.java:77)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.perform(AWSEBEnvironmentUpdater.java:66)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup.perform(AWSEBElasticBeanstalkSetup.java:174)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:21)
... 9 more

I have tracked this down to the following lines:

   if(this.bucketRegion.isEmpty())     //this is where the NPE occurs (because bucketRegion is null)
          s3 = AWSEBUtils.getS3(credentials, awsRegion);
   } else {
          s3 = AWSEBUtils.getS3(credentials, Regions.fromName(bucketRegion));
   }

I assume that because the bucket region is a new field it is not yet specified in my config and although there is a check for it being empty, there is no check for it being null.

This if(this.bucketRegion.isEmpty()) needs to change to if(this.bucketRegion == null || this.bucketRegion.isEmpty())

AWS credential not populating

java.io.IOException: Deployment Failure
00:59:04 at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:197)
00:59:04 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
00:59:04 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
00:59:04 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
00:59:04 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.build(MavenModuleSetBuild.java:945)
00:59:04 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:896)
00:59:04 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
00:59:04 at hudson.model.Run.execute(Run.java:1737)
00:59:04 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
00:59:04 at hudson.model.ResourceController.execute(ResourceController.java:97)
00:59:04 at hudson.model.Executor.run(Executor.java:421)
00:59:04 Caused by: javax.security.auth.login.CredentialNotFoundException: aws_key_data
00:59:04 at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSClientFactory.lookupNamedCredential(AWSClientFactory.java:116)
00:59:04 at br.com.ingenieux.jenkins.plugins.awsebdeployment.DeployerRunner.perform(DeployerRunner.java:64)
00:59:04 at br.com.ingenieux.jenkins.plugins.awsebdeployment.AWSEBDeploymentBuilder.perform(AWSEBDeploymentBuilder.java:193)
00:59:04 ... 10 more
00:59:05 Started calculate disk usage of build
00:59:05 Finished Calculation of disk usage of build in 0 seconds
00:59:05 Started calculate disk usage of workspace
00:59:06 Finished Calculation of disk usage of workspace in 1 second
00:59:06 Finished: FAILURE

Regions

Hi,

I want to deploy the same application in different regions. It is possible to replace/add the dropdown list with a input area that i can insert the region via a parameter? e.g. AWS Region ${Region} ?

Not listing credentials

After adding my AWS credentials in Jenkins, I tried to add the step to my configuration, but the dropdown for credentials contains no items. I've tried restarting Jenkins and reloading the configuration from disk, but to no avail.

how can I use this plugin in post build Actions

@DavidTanner I've successfully configured this plugin and able to deploy the application using build process. I've few questions

  1. I want to use this plugin in the Post Build Actions, I'm unable to see the plugin in the Post Build Action options. how can I get AWS Elastic Bean into Post Build Actions.
  2. I would like to use this plugin in the Pipeline jobs. how can I use this?
  3. I want configure the plugin using groovy scripts. can you guide how can we integrate it?

Version Label Format is unclear

When clicking on the jelly next to the 'Version Label Format', the following instructions appear:

How to set the version label? For instance, for "${GIT_COMMIT}-${BUILD_TAG}", and with "Key Prefix" set to "myapp/builds/myapp-prod-env/", the S3 Object Key is set to myapp/builds/myapp-prod-env/4b5f7669b3376a1ce504bf7ef8bf7aeee9d21746-myjob-41.zip and the version Label will be 4b5f7669b3376a1ce504bf7ef8bf7aeee9d21746-myjob-41 on AWS EB Application Versions

The first problem I'm finding is that ${BUILD_NUMBER} is not interpolated; rather, it's injected in literally:

Environment found (environment id='X-XXXXXXXXXX', name='my-application').
Attempting to update environment to version label '${BUILD_NUMBER}'
'my-application': Attempt 0/5
'my-application': Problem:
com.amazonaws.AmazonServiceException: No Application Version named '"${BUILD_NUMBER}"' found.
(Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID:
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

The error implies that I need to enter the name of an existing version, rather than a new one, yet the field is called "format", which makes me think I need to provide some sort of pattern.

Check for Green Health status

Hi,

I think it would be interesting to add a checkbox in order to also check for a "Green" health status.
This information is available in the result of "describeEnvironments" api.

Can you add it. If you don't have time at all I may send a PR when I get some time.

Thanks for your reply.

Tetra

sleep interrupted

Hi,

my last few jobs failed due to sleep interrupted exception

ERROR: Build step failed with exception
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.run(AWSEBEnvironmentUpdaterThread.java:220)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.call(AWSEBEnvironmentUpdaterThread.java:185)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.call(AWSEBEnvironmentUpdaterThread.java:21)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException: java.lang.InterruptedException
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:25)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBBuilder.perform(AWSEBBuilder.java:65)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1741)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
Caused by: java.lang.InterruptedException
at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:404)
at java.util.concurrent.FutureTask.get(FutureTask.java:191)
at java.util.concurrent.AbstractExecutorService.invokeAll(AbstractExecutorService.java:244)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.updateEnvironments(AWSEBEnvironmentUpdater.java:105)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.perform(AWSEBEnvironmentUpdater.java:70)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup.perform(AWSEBElasticBeanstalkSetup.java:174)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:21)
... 14 more
Build step 'Conditional step (single)' marked build as failure

did someone had those issues also?

Credentials Not Storing in Job

When I create credentials in setup, then select them in my job, then hit "Get Available Applications", it comes back with the message "Missing valid credentials". If I just enter all of my information anyway and try to run the job, it tells me that I have no credentials stored in there. The request to get applications doesn't populate any information other than "awsRegion" in the form.

screen shot 2015-07-28 at 4 10 45 pm

The "Get Available Applications" button works just fine in Jenkins Configuration. I know the creds are valid.

screen shot 2015-07-28 at 4 14 21 pm

"No credentials provided for build!!!" since v1.8.0

Hi all,

Shortly after upgrading the aws-beanstalk-publisher-plugin on our Jenkins masters (v1.7.4 to v1.8.0), we noticed a build failing with the No credentials provided for build!!! error message.

After rolling the plugin back to v1.7.4, a new build of the affected job successfully completed.

Build results snippet for v1.7.4:

+ zip -9 -q -r application.zip .
Root File Object is a file. We assume its a zip file, which is okay.
Uploading file awseb-[...].zip as s3://[...].zip
Upload took 8.260 s
Creating application version frontend-dev1-162 for application frontend for path s3://[...].zip
Environment found (environment id='[...]', name='frontend-dev1'). Attempting to update environment to version label 'frontend-dev1-162'

Build results snippet for v1.8.0:

+ zip -9 -q -r application.zip .
No credentials provided for build!!!
No credentials provided for build!!!
Root File Object is a file. We assume its a zip file, which is okay.
Uploading file awseb-[...].zip as s3://[...].zip
ERROR: Build step failed with exception
com.amazonaws.services.s3.model.AmazonS3Exception: Access Denied (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: [...]

Going through the comparison of both release commits, I could not find a change that would cause this issue. To be fair, I'm not at all familiar with the source code, it has been a while since I wrote any Java as well.

AWS credentials are configured in "Configure System" --> "Deploy into AWS Elastic Beanstalk".

Are we missing something? Perhaps we should adapt our job/Jenkins configuration to the new version of the plugin?

Thanks in advance for reading this far.

Deploying using Instance Profile not working

If I leave the credentials blank in the plugin to use the instance profile, when I run the job, I get a NullPointerException - Stack trace is below. Looks like the S3 Client is not using the instance profile.

No credentials provided for build!!!
No credentials provided for build!!!
ERROR: Build step failed with exception
java.lang.RuntimeException: java.lang.NullPointerException
    at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:25)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBBuilder.perform(AWSEBBuilder.java:65)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
    at hudson.model.Build$BuildExecution.build(Build.java:203)
    at hudson.model.Build$BuildExecution.doRun(Build.java:160)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:536)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.lang.NullPointerException
    at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBUtils.getS3(AWSEBUtils.java:52)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBS3Uploader.uploadArchive(AWSEBS3Uploader.java:74)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.perform(AWSEBEnvironmentUpdater.java:66)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup.perform(AWSEBElasticBeanstalkSetup.java:174)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:21)
    ... 10 more
Build step 'Deploy into AWS Elastic Beanstalk' marked build as failure

Deployment with a docker file

Hi there,

I've set up Elastic Beanstalk at the AWS Console providing a Dockerfile.

I wonder how I can use the plugin to schedule a redeploy if a new build has been done. Is there any way? If yes, how?

Cannot use this plugin when i dont have access to CREATE s3 bucket

My IAM policy restricts creating s3 buckets,but i can put objects in existing buckets. When trying to deploy the code, i get a the following error
com.amazonaws.services.elasticbeanstalk.model.InsufficientPrivilegesException:You do not have permission to perform the 's3:CreateBucket' action. Verify that your S3 policies and your ACLs allow you to perform these actions. (Service: AWSElasticBeanstalk; Status Code: 403; Error Code: InsufficientPrivilegesException; Request ID: 175c4f6d-0c3e-11e6-bb6f-e18e70ceaeaa) at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:1307) at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:894) at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:597) at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:363) at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:329) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:308) at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.invoke(AWSElasticBeanstalkClient.java:2039) at com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient.updateEnvironment(AWSElasticBeanstalkClient.java:1924) at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.updateEnv(AWSEBEnvironmentUpdaterThread.java:82) at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.run(AWSEBEnvironmentUpdaterThread.java:215) at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.call(AWSEBEnvironmentUpdaterThread.java:185) at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdaterThread.call(AWSEBEnvironmentUpdaterThread.java:21) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

Does this error occurs because the plugin tries to insert the code to some temporary s3 bucket.
In short ,i need to use this plugin even though i don't have createbucket privilege

Region eu-west-3 missing

The region eu-west-3 is missing from the region list.
You ask us to tell you when one is missing so here I am.

Thank you for all your great work.

S3 Upload fails when it's in a different region from EB application

How to reproduce:

S3 Bucket region: us-east-1
EB application: us-west-2

If you run the job, the aws sdk is going to throw something similar to it.

ERROR: Build step failed with exception
java.lang.RuntimeException: com.amazonaws.services.s3.model.AmazonS3Exception: Moved Permanently (Service: Amazon S3; Status Code: 301; Error Code: 301 Moved Permanently; Request ID: BD230A63AD88EF98), S3 Extended Request ID: Y6ihqgpjMibEytdFn/3qzyBXgx0ieawKWfNLIznSZro/uL8c4qbJnZdgSBlStqpOeiBmZDU5bkk=
    at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:25)
    at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBPublisher.perform(AWSEBPublisher.java:73)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
    at hudson.model.Run.execute(Run.java:1745)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:404)

The reason for that is because aws-beanstalk-publisher-plugin assumes that both EB application and S3 bucket are located within the same region.

Draft of deployment specific IAM Policy

I have put together a draft IAM policy in an attempt to try and lock down the account used to deploy compared to just granting * on all services involved. My hope is that this policy could be referenced in the README after some review and updates?

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "EBDeployApplication",
            "Effect": "Allow",
            "Action": [
                "autoscaling:DescribeAutoScalingGroups",
                "autoscaling:DescribeScalingActivities",
                "autoscaling:ResumeProcesses",
                "autoscaling:SuspendProcesses",
                "cloudformation:DescribeStackResource",
                "cloudformation:DescribeStackResources",
                "cloudformation:GetTemplate",
                "elasticbeanstalk:CheckDNSAvailability",
                "elasticbeanstalk:CreatePlatformVersion",
                "elasticbeanstalk:CreateStorageLocation",
                "elasticbeanstalk:DeletePlatformVersion",
                "elasticbeanstalk:DescribePlatformVersion",
                "elasticbeanstalk:ListPlatformVersions",
                "elasticbeanstalk:UpdateApplicationResourceLifecycle",
                "elasticloadbalancing:DeregisterTargets",
                "elasticloadbalancing:DescribeTargetGroups",
                "elasticloadbalancing:DescribeTargetHealth",
                "elasticloadbalancing:RegisterTargets",
                "s3:HeadBucket",
                "s3:ListAllMyBuckets",
                "sns:CreateTopic",
                "sns:GetTopicAttributes",
                "sns:ListSubscriptionsByTopic"
            ],
            "Resource": "*"
        },
        {
            "Sid": "S3UploadArtifact",
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::<insert your S3 bucket name here>",
                "arn:aws:s3:::<insert your S3 bucket name here>/*"
            ]
        },
        {
            "Sid": "EBModifyApplication",
            "Effect": "Allow",
            "Action": "elasticbeanstalk:*",
            "Resource": [
                "arn:aws:elasticbeanstalk:<insert region here>:<insert account id here>:application/<insert application name here>",
                "arn:aws:elasticbeanstalk:<insert region here>:<insert account id here>:configurationtemplate/<insert application name here>/*",
                "arn:aws:elasticbeanstalk:<insert region here>:<insert account id here>:environment/<insert application name here>/*",
                "arn:aws:elasticbeanstalk:<insert region here>:<insert account id here>:applicationversion/<insert application name here>/*",
                "arn:aws:elasticbeanstalk:<insert region here>:<insert account id here>:solutionstack/*"
            ]
        }
    ]
}

When environment is unset, ALL environments are updated

This is the opposite of the expected behavior. If I don't set any environments, THe version should be uploaded but not be deployed to any environment.

I just annoyed a bunch of people - I was testing something in Jenkins, and I thought I was putting the safety on by unsetting the environment. Instead, every environment in that Application got clobbered.

AWS Credentials lookup by name not working

Hello, I need to use the "AWS Credentials lookup by name" feature because I have one AWS account per environment which makes me need one Credential per env, but I don't want to create one job or one block of deployment for each environment, which is very annoying right?

This feature would be perfect for me but it's not working, keeps saying:
No credentials provided for build!!!
No credentials provided for build!!!

Can someone help?

I tried using ${env} = parameter or just "test" as env name (as I have a credential called "test" on the global config) but no luck...

Thanks!

remove prepared zip files

Hi,

i see that the plugin prepare the zip file into the tmp folder. There is any way to remove those files after a while or after beanstalk deploy?

bests
Walter

build failing randomly

I've been using this jenkins plugin for over 6 months to push to my elastic beanstalk applications and it has been working flawlessly until recently.

Here is the error I have been getting.


ERROR: Build step failed with exception
java.lang.RuntimeException: java.lang.NullPointerException
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:25)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBBuilder.perform(AWSEBBuilder.java:65)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.lang.NullPointerException
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBS3Uploader.uploadArchive(AWSEBS3Uploader.java:77)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.perform(AWSEBEnvironmentUpdater.java:66)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup.perform(AWSEBElasticBeanstalkSetup.java:174)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:21)
... 10 more
Build step 'Deploy into AWS Elastic Beanstalk' marked build as failure


I first got the following error about a month ago and I could not deploy to my elastic beanstalk application. But a few hours later, when I deployed again without making changes, it was able to be deployed successfully.

About 3 weeks later, I got this error again but for another job. Like before, it started working fine a few hours later.

Because it started working on again without any changes, I thought it was maybe an issue on the AWS S3 end so I contacted the aws support but unfortunately they could not identify any problems...

Today, another job failed while deploying to elastic beanstalk. This time, I decided to debug deeper to see if I can find the root cause of this. I ended up cloning the failed job and then tried to deploy with the cloned job but failed due to the version name conflict. After changing the name of the version, it was able to deploy successfully.

I went back to my original job and tried to deploy without making any changes, but like before, it failed again. I then changed the version name and re-deployed and this time, it was successful.

Do you know how and why that fixed this issue? I just thought i'd create an issue here just in case anyone has come across this issue before.

IllegalAccessError on Jenkins v2.320 and up

Version report

Jenkins and plugins versions report:

Jenkins v2.320+ and AWS Elastic Beanstalk Publisher v1.8.1

  • What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

  • Package code into zip file
  • Push to AWS Elastic Beanstalk via plugin

Results

Expected result:

  • Successful deploy to AWS

Actual result:

  • Jenkins job fails and the following exception is seen in the console log:

ERROR: Step ‘Deploy into AWS Elastic Beanstalk’ aborted due to exception:
java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V from class org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBS3Uploader
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBS3Uploader.uploadArchive(AWSEBS3Uploader.java:129)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBEnvironmentUpdater.perform(AWSEBEnvironmentUpdater.java:66)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBElasticBeanstalkSetup.perform(AWSEBElasticBeanstalkSetup.java:181)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.AWSEBSetup.perform(AWSEBSetup.java:22)
at org.jenkinsci.plugins.awsbeanstalkpublisher.AWSEBPublisher.perform(AWSEBPublisher.java:73)

I believe this is caused by Jenkins v2.320 upgrade (See 'What's new in 2.320' on https://www.jenkins.io/changelog/):

  • Upgrade the Guava library from 11.0.1 (released on January 9, 2012) to 31.0.1 (released on September 27, 2021).

Get Available Environments with Instance Role Credentials

The "Get Available Environments" button in the config page returns an error when using IAM instance roles for credentials.

Stack Trace produced when clicking on the the "ERROR" link:

...
Caused by: java.lang.NullPointerException
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.envlookup.ByName$DescriptorImpl.getEnvironmentsListAsString(ByName.java:93)
at org.jenkinsci.plugins.awsbeanstalkpublisher.extensions.envlookup.ByName$DescriptorImpl.doLoadEnvironments(ByName.java:88)
...

Plugin Version: 1.5.5

Skip version creation if version exists

Hi David,

I've set up a nice Jenkins pipeline that eventually deploys to Beanstalk using your plugin.
The thing is that when trying to deploy a previous version, Beanstalk fails with the following error because the version already exists.

java.lang.RuntimeException: com.amazonaws.AmazonServiceException: Application Version breeze_7 already exists. (Service: AWSElasticBeanstalk; Status Code: 400; Error Code: InvalidParameterValue; Request ID: d33c06b5-8590-11e6-8184-a350bc8b5a45)

I guess it would make sense to add a (n optional) check whether the version already exists, and if so, only runs the update-environment command to roll back to this previous version.

Would this be feasible?

Thank you,
Hildebrand

Null pointer when looking up Region

Region.fromName() is throwing null pointer exceptions when the text field is blank. Should change to handle all exceptions instead of just IllegalArgumentException.

AWS Credentials not saving in job config

I have just upgraded the AWS Beanstalk publisher plugin to version 1.5.3 and have noticed an issue that didn't exist before. Previously inside the job configuration I would select from the drop-down menu the "AWS Credentials" that I wanted to use but unfortunately now it looks like the selection will not get saved.

When i click on the drop-down menu I can see the credentials and I am able to select the desired one. Then i click on "Get Available Applications" and "Get available Environments" and everything works fine, I get the correct list returned. If I then click on save, change page, and then come back to the job configuration, the aws credential i had previously selected is gone. This reflects on the jenkins job failing by giving me error:

"No credentials provided for build!!!
ERROR: Build step failed with exception
java.lang.RuntimeException: java.lang.NullPointerException"

The workaround for this is typing in manually the credential in the "AWS Credentials lookup by name". By placing there the full name and credential then it works fine.

Environment name never saving

Every time I save the job config, and try to execute, I get this:

image

When re-opening the job configuration, I can see that that environment name never gets saved, no matter how many times i add or look it up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.