Giter Site home page Giter Site logo

aws-lambda-jenkins-plugin's People

Contributors

anthonyikeda avatar cast avatar ee99ee avatar escoem avatar kiddouk avatar samverschueren avatar tschutte avatar

Stargazers

 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-lambda-jenkins-plugin's Issues

Support Role Based Authentication

Hi! Great plugin, however it does not support the ability to support authentication through IAM roles. It requires the secret key and access key instead.

PublishConfig is not serializable

Hi,

I have job a that has 2 build steps:

  1. "Copy artifacts from another project"
  2. "AWS Lambda publish new version and update alias"

When launching the job, the second step fails with the following error:

java.io.NotSerializableException: com.xti.jenkins.plugin.awslambda.publish.PublishConfig
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at hudson.remoting.UserRequest._serialize(UserRequest.java:190)
	at hudson.remoting.UserRequest.serialize(UserRequest.java:199)
Caused: java.io.IOException: Unable to serialize com.xti.jenkins.plugin.awslambda.callable.PublishCallable@15383af4
	at hudson.remoting.UserRequest.serialize(UserRequest.java:201)
	at hudson.remoting.UserRequest.<init>(UserRequest.java:64)
	at hudson.remoting.Channel.call(Channel.java:828)
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:57)
Caused: java.lang.RuntimeException
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:65)
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:45)

It seems that the POJO com.xti.jenkins.plugin.awslambda.publish.PublishConfig does not implements Serializable.

I'm using the version 0.5.8 of the plugin (with Jenkins 2.47)

/Julien

Cannot change 'Update Mode' value

We cannot select a value for the "Update Mode" as it has no options. This only happens in a specific Jenkins Job, not in every job.

Please see attached image
captura de pantalla 2018-04-11 a las 5 31 01 p m

Plugin Version: 0.5.10
Jenkins Version: 2.110

Support multiple aliases

It would be a nice feature if we could add multiple aliases to a version. It could be added by allowing a comma separated list to the input box of the aliases.

I mentioned it in #31 as well but I guess this might be easier to start with.

Use Case

The reason I'm asking this is because I add multiple tags to my released versions. The production alias is always pointing to the latests versioned release. I also add a v0 (or v1, v2, ...) depending on the semver of my code. This way, when calling a lambda function from another function, I know for sure that the v1 alias doesn't introduce breaking changes. It allows me to keep upgrading lambda A without the need to upgrade lambda B (which calls lambda A at v1) at the same time because lambda A introduced a breaking change.

So ideally, the input box allows multiple aliases with the option to pass in environment variables

production, ${MAJOR}

where ${MAJOR} points to v1 or something.

Any thoughts on this?

Use of aws-credentials plugin

Leaving this here to point out that in the near future you will be able to use the aws-credential plugin for IAM access key and secret key storage.

This means that the core dependency will be increased to 1.596.1

Java Heap Space error when deploying lambda function

I am getting below error while deploying lambda function using AWS lambda plugin. I am specifying artifacts location inside as jenkins "target" directory instead of S3 location.

Stacktrace:
15:29:46 {FunctionName: my_lambda,Runtime: java8,Role: LambdaExecutionRole,Handler: com.mycompany.MyHandler::starter,Code: {ZipFile: java.nio.HeapByteBuffer[pos=0 lim=40959835 cap=40959835],},Description: Deployed with AWS lambda Plugin :7,Timeout: 40,MemorySize: 384,Publish: false,}
15:29:46
15:29:46 com.amazonaws.AmazonClientException: Unable to marshall request to JSON: Java heap space
15:29:46 at com.amazonaws.services.lambda.model.transform.CreateFunctionRequestMarshaller.marshall(CreateFunctionRequestMarshaller.java:191)
15:29:46 at com.amazonaws.services.lambda.AWSLambdaClient.createFunction(AWSLambdaClient.java:703)
15:29:46 at com.xti.jenkins.plugin.awslambda.service.LambdaDeployService.createLambdaFunction(LambdaDeployService.java:171)
15:29:46 at com.xti.jenkins.plugin.awslambda.service.LambdaDeployService.deployLambda(LambdaDeployService.java:83)
15:29:46 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploader.upload(LambdaUploader.java:51)
15:29:46 at com.xti.jenkins.plugin.awslambda.callable.DeployCallable.call(DeployCallable.java:46)
15:29:46 at com.xti.jenkins.plugin.awslambda.callable.DeployCallable.call(DeployCallable.java:23)
15:29:46 at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
15:29:46 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploadPublisher.perform(LambdaUploadPublisher.java:93)
15:29:46 at com.xti.jenkins.plugin.awslambda.upload.LambdaUploadPublisher.perform(LambdaUploadPublisher.java:69)
15:29:46 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
15:29:46 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
15:29:46 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
15:29:46 at hudson.model.Build$BuildExecution.post2(Build.java:185)
15:29:46 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
15:29:46 at hudson.model.Run.execute(Run.java:1766)
15:29:46 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
15:29:46 at hudson.model.ResourceController.execute(ResourceController.java:98)
15:29:46 at hudson.model.Executor.run(Executor.java:410)
15:29:46 Caused by: java.lang.OutOfMemoryError: Java heap space
15:29:46 at javax.xml.bind.DatatypeConverterImpl._printBase64Binary(Unknown Source)
15:29:46 at javax.xml.bind.DatatypeConverterImpl._printBase64Binary(Unknown Source)
15:29:46 at javax.xml.bind.DatatypeConverterImpl.printBase64Binary(Unknown Source)
15:29:46 at javax.xml.bind.DatatypeConverter.printBase64Binary(Unknown Source)
15:29:46 at com.amazonaws.util.Base64.encodeAsString(Base64.java:39)
15:29:46 at com.amazonaws.util.BinaryUtils.toBase64(BinaryUtils.java:59)
15:29:46 at com.amazonaws.util.json.JSONWriter.value(JSONWriter.java:347)
15:29:46 at com.amazonaws.services.lambda.model.transform.CreateFunctionRequestMarshaller.marshall(CreateFunctionRequestMarshaller.java:122)
15:29:46 ... 18 more

subnets and security group

Hi there,
I'm trying to upload a lambda function with VPC access through Jenkins.
I saw that you updated this awesome plugin in order to select subnets and security group but I have a question: which should be the input of the two fields?

I tried with the format subnet-XXXXXXX or only XXXXXXX but don't seem to work.

Cheers
Mirko

Support for temporary credentials

Currently we need to give 'AWS Access key ID' and 'AWS Secret Access Key' in the jenkins.
I want to use temporary credentials only. For that
I could not find a way to enter 'AWS session Token' in the plugin.
Please add support for that or let me know if there is some existing way to enter temporary credentials.

Support for Region eu-west-2 (London)

It's look like plugin use old version of AWS SDK that not support London region.

Started by timer Building in workspace /var/lib/jenkins/workspace/lambda_create_ami ERROR: Build step failed with exception java.lang.IllegalArgumentException: Cannot create enum from eu-west-2 value! at com.amazonaws.regions.Regions.fromName(Regions.java:76) at com.xti.jenkins.plugin.awslambda.util.LambdaClientConfig.getClient(LambdaClientConfig.java:35) at com.xti.jenkins.plugin.awslambda.callable.InvokeCallable.call(InvokeCallable.java:41) at com.xti.jenkins.plugin.awslambda.callable.InvokeCallable.call(InvokeCallable.java:25) at hudson.remoting.LocalChannel.call(LocalChannel.java:45) at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokeBuildStep.perform(LambdaInvokeBuildStep.java:77) Caused: java.lang.RuntimeException at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokeBuildStep.perform(LambdaInvokeBuildStep.java:87) at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokeBuildStep.perform(LambdaInvokeBuildStep.java:65) at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1727) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'AWS Lambda invocation' marked build as failure Finished: FAILURE

Plugin version: 0.5.10

Is the temporary zip file ever cleaned up?

It seems that after the zip file is upload, there's no need to keep the temp file around and we could delete it, or provide an option to delete it.
Some jenkins installations use a temp folder that is actually not cleaned up automatically. Usually this is not an issue, but the temp file generated by this plugin can easily be dozens of MBs in size.

JS Error is causing the Project Configuration page to malfunction

Re-raising JIRA issue here since it is not clear from plugin description which issue tracker is the main one.

https://issues.jenkins-ci.org/browse/JENKINS-43627

AWS Lambda Plugin Update mode blank on 17th plus deployments in a single job

I have a Jenkins job, that deploys 16 lambdas. When you add the 17th, you no longer can select Update mode. In the chrome console you see the below error.

Uncaught TypeError: vg.rowVisibilityGroup.makeInnerVisisble is not a function
at updateAwsLambdaOptionalBlock (https://jci1.knowland.com:8080/plugin/aws-lambda/js/awslambda.js:14:27)
at https://jci1.knowland.com:8080/plugin/aws-lambda/js/awslambda.js:49:9
at Array.forEach (native)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:111:30
at Array.forEach (native)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:107:27
at Array.forEach (native)
at Object.applySubtree (https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:93:17)
at Object.apply (https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:76:14)
at https://jci1.knowland.com:8080/static/5a40f66c/scripts/behavior.js:71:14

The only work around it to create a second job that only deploys the 17th and above lambdas.

Missing "Update Mode" dropdown, when configuring >1 deployment

We have a lambda that we'd like to deploy to multiple lambda instances. This seems to work for the most part, but when configuring the second instance, the values in the "Update Mode" dropdown are missing. We only want to (and only have permissions to) update the code, but are unable to select that option.

Can you confirm if this is an issue or if we are doing something incorrectly?

Update AWS Verison

Hello,

I am currently getting "Cannot create enum from eu-west-2 value!" error.
In December 2016 AWS region eu-west-2 got introduced.

Would it be possible to get the AWS Version (pom.xml) updated.
It looks like the earliest version this got introduced as 1.11.67 (https://github.com/aws/aws-sdk-java/blob/1.11.67/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Regions.java), with the latest being 1.11.160 (https://github.com/aws/aws-sdk-java/blob/1.11.160/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Regions.java).

Regards,
Lewis Freeman

Configuration update does not update runtime

With the new nodejs4.3 runtime I looked into updating all the runtimes to 4.3. I just changed my jenkins configuration and deployed my code again. It seems that the runtime isn't updated.

Lambda update configuration request:
{FunctionName: fnName,Role: arn:aws:iam::123456789012:role/lambda_role,Handler: index.handler,Description: test,Timeout: 10,MemorySize: 128,}

It seems these lines are the reason why it doesn't work. It does net set the runtime.

Will do a PR.

Blue Ocean: Error when configuring Lambda Deploy

When trying to configure an AWS Lambda deployment via the Blue Ocean pipeline editor, instead of the form described in the readme, only a single field LambdaUploadBuildStepVariables is shown.

In addition to that, the browser console shows an error:

Error

Any suggestions on how to resolve this?

LambdaPublishServiceResponse is not serializable

Using 0.5.10 version of this plugin. When invoking publish new version and update alias procedure, I get the following error.

java.lang.RuntimeException: java.io.IOException: Unable to serialize com.xti.jenkins.plugin.awslambda.publish.LambdaPublishServiceResponse@35fc939e
at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:66)
at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:46)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:78)
at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:65)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
at hudson.security.ACL.impersonate(ACL.java:260)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)
Caused by: java.io.IOException: Unable to serialize com.xti.jenkins.plugin.awslambda.publish.LambdaPublishServiceResponse@35fc939e
at hudson.remoting.UserRequest.serialize(UserRequest.java:201)
at hudson.remoting.UserRequest.perform(UserRequest.java:161)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
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)
at ......remote call to Enterprise Linux Slave 3(Native Method)
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
at hudson.remoting.Channel.call(Channel.java:830)
at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishBuildStep.perform(LambdaPublishBuildStep.java:58)
... 11 more
Caused by: java.io.NotSerializableException: com.xti.jenkins.plugin.awslambda.publish.LambdaPublishServiceResponse
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
at hudson.remoting.UserRequest._serialize(UserRequest.java:190)
at hudson.remoting.UserRequest.serialize(UserRequest.java:199)
at hudson.remoting.UserRequest.perform(UserRequest.java:161)
at hudson.remoting.UserRequest.perform(UserRequest.java:50)
at hudson.remoting.Request$2.run(Request.java:336)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
... 4 more

EnvironmentVariablesFeature is not supported in cn-north-1 region

Hi there,

Recently trying to implement this awesome plugin into my Jenkins but an error occurred as such:
EnvironmentVariablesFeature is not supported in cn-north-1 region

After some digging I found that this plugin try to send an empty environment variable object rather than ignore it, shown in log: Environment: {Variables: {}}

As located in Beijing and also urge to use this plugin rather than just writing aws cli commands, is it possible not to send the empty object if nothing set ?

Thanks.

Build fail on lambda fail

i would like the build to fail when the lambda function fails. right now my build succeeds even when the lambda functions returns a stack-trace.

Try to deploy environment variables from Jenkins but in vain

I set the config like below
swipeguide-tracker_config__jenkins_

And the request message I saw from console is only like this:

Lambda update code request:
{FunctionName: Tracker,ZipFile: java.nio.HeapByteBuffer[pos=0 lim=3450022 cap=3450022],Publish: false}

There's no environment variables in the request. Should be

{FunctionName: Tracker,ZipFile: java.nio.HeapByteBuffer[pos=0 lim=3450022 cap=3450022],Publish: false,Environment: {Variables: {REDSHIFT_CONNECTION_STRING=blabla, GA_CONTAINER_ID=blablabla, REDSHIFT_DATABASE_SCHEMA=blabla}, }, }

Shall I set Update Mode to Code and configuration? Or how can I fix it?

Lambda executor doesn't find request handler class when uploading zip file artifact from workspace

The plugin outputs as if my build was successfully, although when I run the lambda function my handler class is not found.

16:28:51 Lambda update code request: 16:28:51 {FunctionName: sc-assoc-units-worker,ZipFile: java.nio.HeapByteBuffer[pos=0 lim=15350954 cap=15350954],Publish: false}

This was working a couple days ago just fine and now, with no changes to the job it suddenly stopped working. Still wondering if that is a plugin issue or an AWS change in the service.

Let me know if everything is still working fine for you please.
Thank you

Suport for Python and Java?

Hi,

Great plugin for AWS Lambda but can you please add the two new runtimes that are now supported on Lambda: Python and Java?

Thanks!

SubnetIds and SecurityIds must coexist or be both empty lists

Since about 30 minutes I started receiving these errors when Jenkins tries to deploy my build.

com.amazonaws.services.lambda.model.InvalidParameterValueException: SubnetIds and SecurityIds must coexist or be both empty list. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: b17cab79-d3f3-11e6-9bee-e7fb56d0a4ae)

I checked the documentation and I believe this has something to do with the VpcConfig parameter inside createFunction. I used the JavaScript docs to check that because the Java docs doesn't work for me :p. They aren't marked as required yet but probably they changed that which is odd IMO.

AWS Response

Using an AWS Lambda build action with any JSON Parameters for parsing or capturing the response causes the following failure.

ERROR: Build step failed with exception java.lang.RuntimeException: java.io.IOException: Unable to serialize com.xti.jenkins.plugin.awslambda.callable.InvokeCallable@3357275a at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokePublisher.perform(LambdaInvokePublisher.java:112) at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokePublisher.perform(LambdaInvokePublisher.java:75) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668) at hudson.model.Run.execute(Run.java:1763) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410) Caused by: java.io.IOException: Unable to serialize com.xti.jenkins.plugin.awslambda.callable.InvokeCallable@3357275a at hudson.remoting.UserRequest.serialize(UserRequest.java:168) at hudson.remoting.UserRequest.<init>(UserRequest.java:62) at hudson.remoting.Channel.call(Channel.java:779) at com.xti.jenkins.plugin.awslambda.invoke.LambdaInvokePublisher.perform(LambdaInvokePublisher.java:99) ... 10 more Caused by: java.io.NotSerializableException: com.xti.jenkins.plugin.awslambda.invoke.JsonParameter at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at java.util.ArrayList.writeObject(ArrayList.java:742) at sun.reflect.GeneratedMethodAccessor184.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) at hudson.remoting.UserRequest._serialize(UserRequest.java:157) at hudson.remoting.UserRequest.serialize(UserRequest.java:166) ... 13 more Build step 'AWS Lambda invocation' marked build as failure Finished: FAILURE

This occurs when the step is a build step, as well as a post-build action. Removing the JSON Paramenters allows the step to complete successfully. This also happens with or without a JSON payload being sent with the original request.

Had the same issue with version 0.4.3 as well as 0.5.0

Zipfile not found

Hi,

I'm trying to use this plugin to update my Lambda function.

2 Questions:

  1. Code is retreived from git,
    and when running the build script i get
    Could not find zipfile or folder.

    What should i input in the file location to make it work?

  2. How can i run pip install before and add some libs to my zip prior to upload?

Thanks!

Plugin does not recognize injected variables

We have a really messy lambda repository in bitbucket, wich is fine since I can set a env variable using
LAMBDA_LOCATION=$(find pwd -name $LAMBDA_NAME) to point the location of my lambda zip. But the plugin can't use it. If I Inject the variable and pass it to the plugin (on the "Artifact Location (zip, directory, s3)" section) as $LAMBDA_LOCATION I keep getting the "Could not find zipfile or folder" error
Am I doing something wrong or it is a limitation?

Add support for cross account deployment

Right now you can either use the instance profile, or an access/secret key combination.
Our usecase is: jenkins runs in AWS account A and needs to deploy lambda functions in account B.

The codedeploy plugin of jenkins allows for specifying an iamRole to assume in the aws sdk.
Would be great if this plugin supports this as well.

Example of the codedeploy plugin:
iamRoleArn: 'arn:aws:iam::XXXX:role/some-role'

Permissions are incorrectly set before ZIP/Upload

When using the Lambda plugin, I'm getting an error executing the function in Lambda:

EACCES, permission denied '/var/task/index.js

{
  "errorMessage": "EACCES, permission denied '/var/task/index.js'",
  "errorType": "Error",
  "stackTrace": [
    "Object.fs.openSync (fs.js:439:18)",
    "Object.fs.readFileSync (fs.js:290:15)",
    "Object.Module._extensions..js (module.js:473:44)",
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)",
    "Module.require (module.js:364:17)",
    "require (module.js:380:17)"
  ]
}

On further investigation, it seems to be a permissions issue with Jenkins. I'm not entirely sure if this is directly related to the plugin (so feel free to mark as invalid), but when I added a manual step that "chmod -R" with more open permissions before the Lambda function executed, it worked.

I also filed a bug with AWS for this, so perhaps it is Lambda's issue, but it seems that the permissions on the files are lost pre-zipping.

AWS Lambda publish new version and update alias not using instance credentials

When using the the 'AWS Lambda publish new version and update alias' post-build action, it does not seem like the 'Use instance credentials' option is being respected. If I check this option and leave the AWS Access Key Id and AWS Secret Key blank, I am getting the following exception:

ERROR: Build step failed with exception
com.amazonaws.services.lambda.model.AWSLambdaException: The security token included in the request is invalid. (Service: AWSLambda; Status Code: 403; Error Code: UnrecognizedClientException;)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1545)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1183)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:964)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:676)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:650)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:633)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$300(AmazonHttpClient.java:601)
	at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:583)
	at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:447)
	at com.amazonaws.services.lambda.AWSLambdaClient.doInvoke(AWSLambdaClient.java:1955)
	at com.amazonaws.services.lambda.AWSLambdaClient.invoke(AWSLambdaClient.java:1931)
	at com.amazonaws.services.lambda.AWSLambdaClient.getAlias(AWSLambdaClient.java:858)
	at com.xti.jenkins.plugin.awslambda.service.LambdaPublishService.publishLambda(LambdaPublishService.java:29)
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublisher.publish(LambdaPublisher.java:25)
	at com.xti.jenkins.plugin.awslambda.callable.PublishCallable.call(PublishCallable.java:39)
	at com.xti.jenkins.plugin.awslambda.callable.PublishCallable.call(PublishCallable.java:19)
	at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishPublisher.perform(LambdaPublishPublisher.java:63)
Caused: java.lang.RuntimeException
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishPublisher.perform(LambdaPublishPublisher.java:72)
	at com.xti.jenkins.plugin.awslambda.publish.LambdaPublishPublisher.perform(LambdaPublishPublisher.java:47)
	at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
	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:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
	at hudson.model.Run.execute(Run.java:1753)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:405)
Build step 'AWS Lambda publish new version and update alias' marked build as failure

Also, when going back to configure the Jenkins project, the 'Use instance credentials' option is not saved.

Add option to use IAM roles instead of AK/SK

First of all, thanks for the plugin! Works very well.

I am hosting my Jenkins server on an ec2 instance, like probably most of the people that will use this plugin. I think it would be great to leverage the IAM role assigned to the Jenkins EC2 instance to allow the plugin to deploy AWS Lambda functions.

The S3 Plugin for example, allows u to use IAM Roles. It's just a simple checkbox which will hide the Access Key and Secret Key input boxes.

Plugin does not recognize env variable

Hi,
i'm trying to deploy lambda function using Use instance credentials option.
I have exported the AWS credentials as env variable (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY_), but i'm getting the following error during the deploy.

com.amazonaws.SdkClientException: Unable to load AWS credentials from any provider in the chain

I'm able to deploy the lambda function only by passing AWS Access Key Id and Secret explicitly or using default credentials located at ~/.aws
Any one have the same problem?
I'm using jenkins 2.73.2 with version 0.5.10 of lambda-jenkins-plugin.

Thanks.
Mattia

Separate build step for version + alias

I was thinking that it would be nice to have a separate step for creating a version and alias. I think it offers more flexibility.

  1. Update code and configuration
  2. Create alias for $LATEST (no new version is created)
  3. Create new version and alias the version (option to provide multiple aliases, maybe comma separated)

It would make conditionally applying versions and aliases a lot more easier.

How could this be integraded UI-wise? Leave it open to you but this is my suggestion.

  1. An input box for the region
  2. An input box for the lambda function
  3. Two checkboxes, one for Publish version and on for Assign Alias. Both can be checked or unchecked independently. If Assign Alias is checked, an input box popups up for creating the alias(es).

If Publish version and Assign Alias are both checked, a new version is created which will be aliased by all the aliases provided in the input box (comma separated).

If only Assign Alias is checked, the aliases will be applied to the $LATEST version.

Feedback is more then welcome :).

Plugin resetting VPC related config

Seems like the plugin overrides to the default (No VPC, nor Subnets nor Security Group) when it updates code/config, so I have to manually config again these setting after each Jenkins triggered deployment.

Plugin Version: 0.5.10
Jenkins Version: 2.110

Publish new version depending on environment variable

I have no idea if this is possible, but I will explain my use case.

I have two git branches (development/production). The development branch is the $LATEST version as it is used for testing etc. When I push to production, it should create a new version and tag it as production. If pushed to development, it should just update the $LATEST but don't create a version or tag the release.

So actually what I need is an optional "create version + tag" depending on an environment variable that I can set depending on the branch pushed to. Any idea if this would be possible to do?

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.