Use this action to create or update a function in the Amazon Web Services (AWS) Lambda serverless architecture. Run code in AWS Lambda without provisioning or managing servers.
Prerequisites
Make sure to initialize the connection using your AWS credentials, by adding the following to your YAML file:
- name: Configure AWS credentials uses: cloudbees-io/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.MY_KEY_ID }} aws-secret-access-key: ${{ secrets.MY_SECRET_KEY }} aws-region: eu-west-3
Refer to CloudBees action: Configure AWS credentials for more information.
All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
Inputs
Input name | Data type | Required? | Description |
---|---|---|---|
|
JSON string |
No |
The instruction set architecture that the function supports. |
|
String |
Required only if using an image ( |
The code image resource, such as the Amazon ECR repository URI. |
|
String |
No |
The Amazon Resource Name (ARN) for a code-signing configuration. |
|
String |
Required only if using a ZIP file ( |
The path to the ZIP file of the code to be uploaded. |
|
JSON string |
No |
The location where the Lambda function sends asynchronous events that fail to process. |
|
String |
No |
The Lambda function description. |
|
Boolean |
No |
Default is |
|
JSON string |
No |
The environment variables accessible from the function code during execution. |
|
JSON string |
No |
The size of the Lambda function |
|
JSON string |
No |
The Amazon EFS file system connection settings. |
|
String |
Yes |
The AWS Lambda function name. |
|
String |
Required only if using a ZIP file ( |
The method name in uploaded code that Lambda calls to run the function. |
|
String |
Yes |
The Identity and Access Management (IAM) name of the function’s execution role, in ARN format. |
|
JSON string |
No |
The container image configuration values that override the container image Dockerfile values. |
|
String |
No |
The ARN of the AWS Key Management Service (KMS) customer-managed key used to encrypt your function’s environment variables. |
|
JSON string |
No |
The list of function layers to add to the Lambda functions execution environment. |
|
Integer |
No |
The amount of memory available to the Lambda function at runtime. |
|
String |
No |
The type of build input artifact.
Options are |
|
Boolean |
No |
Default is |
|
String |
No |
The latest updated revision ID. If specified, the Lambda function is only updated if the revision ID matches the latest updated revision ID. Use this option to avoid publishing a version if the function configuration has changed since you last updated it. |
|
String |
Required only if using a ZIP file ( |
The Lambda function runtime. |
|
String |
Required only if using an Amazon S3 bucket. |
The Amazon S3 bucket name. |
|
String |
Required only if using an Amazon S3 bucket. |
The Amazon S3 bucket object name. |
|
String |
No |
The Amazon S3 bucket object version. |
|
JSON string |
No |
The SnapStart configuration to run the Lambda function with a pre-initialized snapshot. |
|
JSON string |
No |
The Lambda function tag list. |
|
Integer |
No |
The allowed amount of time, in seconds, that a Lambda function runs before it is stopped. |
|
JSON string |
No |
The AWS X-Ray tracing configuration in the Lambda function. To sample and record incoming requests, enable X-ray Active tracing in the Lambda functions console. |
|
JSON string |
No |
The VPC security groups and subnets for network connectivity to AWS resources. |
Usage examples
Create/update an AWS Lambda function using an ECR image
In your YAML file, add:
- name: Create or update AWS lambda function with ECR id: createOrUpdateLambdaFunctionWithECR uses: cloudbees-io/lambda-create-function@v1 with: iam-role-arn: arn:aws:iam::123456789012:role/my-lambda-actions function-name: my-function package-type: Image code-image: 123456789012.dkr.ecr.us-west-2.amazonaws.com/hello-world-lambda:v1 architectures: '["x86_64"]'
Create or update an AWS Lambda function using a local ZIP file
In your YAML file, add:
- name: Create or update AWS lambda function with ZIP file id: createOrUpdateLambdaFunctionWithZip uses: cloudbees-io/lambda-create-function@v1 with: iam-role-arn: arn:aws:iam::123456789012:role/my-lambda-actions function-name: my-function package-type: Zip handler: bootstrap code-zip: ${{ cloudbees.workspace }}/bootstrap.zip architectures: '["x86_64", "arm64"]' runtime: provided.al2