Using the AWS Lambda Function task in Bamboo

You can use the AWS Lambda Function task to create, update, delete, invoke or entitle an AWS Lambda function (see Deploying to AWS Lambda for an overview of the Lambda component lifecycle and deployment workflow).

 

Configuration

To configure an AWS Lambda Function task:

1. Navigate to the Tasks configuration tab for the job (this will be the default job if creating a new plan).

2. Click the name of an existing AWS Lambda Function task, or click Add Task and then AWS Lambda Function to create a new task.

3. Complete the following settings:

a. Common to all tasks

b. Actions supported by this task:

Create Function

 

Create Function

 

Publish version

Check to publish a new function version as an atomic operation. Clear to override the $LATEST version.

Function Name

Specify the function name.

Description

(Optional) Specify a function description.

Architecture

Select the instruction set architecture for the function.

Runtime

Select the runtime for the function.

Deployment Package

Select the deployment package location:

Zip Archive (S3)

 

S3 Bucket

Specify the name of the S3 bucket where the deployment package is stored.

S3 Key

Specify the deployment package's S3 object key.

  • Maximum compressed size allowed is 50 MB.

  • Maximum uncompressed size allowed is 250 MB.

S3 Object Version

(Optional) Specify the deployment package's S3 object version.

ECR Container Image URI

 

ECR Image URI

Specify the URI of an image in the Amazon Elastic Container Registry (ECR).

Image Configuration Overrides

Specify image configuration overrides (JSON – inline or via URL).

Handler 

Specify the function within the code that Lambda calls to begin execution.

Role ARN

Specify the Amazon Resource Name (ARN) of the IAM role that Lambda assumes when it executes the function to access any other Amazon Web Services (AWS) resources.

Memory Size (MB)

Specify the amount of memory, in MB, that Lambda allocates to the function.

Correlation between memory allocation and amount of CPU

Lambda uses this memory size to infer the amount of CPU and memory allocated to the function. Your use-case determines your CPU and memory requirements. For example, a database operation might need less memory compared to an image processing function.

Timeout (s)

Specify the execution time, in seconds, at which Lambda should terminate the function.

Tags

Specify the tags to apply (JSON – inline or via URL).

Advanced Options

 

Environment 

Specify an environment configuration in JSON format.

KMS Key ARN 

Specify the KMS Key ARN used to encrypt your function's environment variables. If not provided, AWS Lambda will use a default service key.

  • Refer to Environment Variable Encryption for details.

    Custom Encryption for Storing Sensitive Information

    As per sub section Storing Sensitive Information, this default encryption is not necessarily sufficient for all use cases, so if you need to store sensitive information in an environment variable, we strongly suggest you encrypt that information before deploying your Lambda function.

VPC Configuration

Specify the VPC configuration in JSON format.

Dead Letter Configuration

Specify a dead letter configuration in JSON format.

Layers

Specify function layers in JSON format.

Update Function Code

 

Publish version

see Create Function above

Function Name

see Create Function above

Architecture

see Create Function above

Deployment Package

see Create Function above

Update Function Configuration



Function Name

see Create Function above

Description

see Create Function above

Runtime

see Create Function above

Handler 

see Create Function above

Role

see Create Function above

Memory (MB)

see Create Function above

Timeout (s)

see Create Function above

Advanced Options

 

Environment

see Create Function above

KMS Key ARN 

see Create Function above

VPC Configuration 

see Create Function above

Dead Letter Configuration 

see Create Function above

Layers

see Create Function above

Delete Function

 

Don't fail for non existing function

Check to not fail the build, if the function does not exist (anymore). Clear to trigger a build failure otherwise.

Function Name 

see Create Function above

Publish Version

You can also publish a version directly with the create/update function actions.

Function Name

see Create Function above

Description

see Create Function above

Code SHA256

(Optional) Specify the SHA256 hash of the deployment package to publish.

Create Alias

 

Function Name

see Create Function above

Function Version

Specify the function version to create/update the alias for.

Alias Name

Specify the alias name.

Description

see Create Function above

Routing Configuration

Specify the routing configuration to apply (JSON – inline or via URL).

Update Alias

 

Function Name

see Create Function above

Function Version

see Create Alias above

Alias Name

see Create Alias  above

Description

see Create Function above

Routing Configuration

see Create Alias  above

Delete Alias

 

Function Name

see Create Function above

Alias Name

see Create Alias  above

Add Permission

 

Function Name

see Create Function above

Statement ID

Specify a unique statement identifier.

Lambda Action

Specify the Lambda action to allow in this statement.

Principal  

Specify the principal who is granted this permission.

Source Account

(Optional) Specify the AWS account ID (without a hyphen) of the source owner.

Source ARN

(Optional) Specify the S3 bucket's Amazon Resource Name (ARN) to ensure that only events generated from the specified bucket can invoke the function.

Important

If you add a permission for the Amazon S3 principal without providing the source ARN, any AWS account that creates a mapping to your function ARN can send events to invoke your Lambda function from Amazon S3.

Remove Permission

 

Function Name

see Create Function above

Statement ID

see Add Permission above

Create Tags

 

Function ARN

Specify the function ARN.

Tags

see Create Function above

Delete Tags

 

Function Name

see Create Tags above

Tag Keys

Specify the tag keys to remove (JSON – inline or via URL).

Set Function Concurrency

Function Name

see Create Function above

Concurrent Execution Limit

Specify the concurrent execution limit reserved for this function.

Remove Function Concurrency



Function Name

see Create Function above

Invoke Function

 

Function Name 

see Create Function above

Payload

(Optional) Specify a JSON payload to provide to the Lambda function as input.

Client Context

(Optional) Specify client-specific JSON information to pass to the Lambda function in the context variable.

Invocation Type

Select the function invocation type.

Log Type

(Optional) Select "Tail" to return the last 4 KB of log data produced by your Lambda function.

Don't fail on handled function errors

Check to not fail the build, if an error has been handled by the function. Clear to trigger a build failure otherwise.

 

Variables

Create Function

Creating common variables for 1 resources affected by task: ... bamboo.custom.aws.lambda.function.resources: arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot Creating resource variables for function 'arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot': ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.FunctionArn: arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.FunctionName: TAWS-IT280-LF1-21-ubot ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Description: ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Runtime: nodejs ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Handler: index.handler ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Role: arn:aws:iam::288727192237:role/aws-lambda-basic-execution ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.MemorySize: 128 ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Timeout: 2 ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.CodeSize: 499 ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.LastModified: 2015-08-25T17:07:47.960+0000 ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot.CodeSha256: uZHeTlbOPWHDSnEpKqfPlMvJJL8LLBchpZOFaAohZhg= ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot.Version: 1 Creating common variables for first resource affected by task: Creating resource variables for function 'arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot': ... bamboo.custom.aws.lambda.function.first.FunctionArn: arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot ... bamboo.custom.aws.lambda.function.first.FunctionName: TAWS-IT280-LF1-21-ubot ... bamboo.custom.aws.lambda.function.first.Description: ... bamboo.custom.aws.lambda.function.first.Runtime: nodejs ... bamboo.custom.aws.lambda.function.first.Handler: index.handler ... bamboo.custom.aws.lambda.function.first.Role: arn:aws:iam::288727192237:role/aws-lambda-basic-execution ... bamboo.custom.aws.lambda.function.first.MemorySize: 128 ... bamboo.custom.aws.lambda.function.first.Timeout: 2 ... bamboo.custom.aws.lambda.function.first.CodeSize: 499 ... bamboo.custom.aws.lambda.function.first.LastModified: 2015-08-25T17:07:47.960+0000 ... bamboo.custom.aws.lambda.function.first.CodeSha256: uZHeTlbOPWHDSnEpKqfPlMvJJL8LLBchpZOFaAohZhg= ... bamboo.custom.aws.lambda.function.first.Version: 1

Update Function Code

See Create Function above.

Update Function Configuration

See Create Function above.

Delete Function

N/A

Publish Version

See Create Function above.

Create Alias

Creating common variables for 1 resources affected by task: ... bamboo.custom.aws.lambda.function.resources: arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one Creating resource variables for alias 'arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-31-ubot:alias-one': ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one.AliasArn: arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-31-ubot:alias-one ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one.Description: description one ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one.FunctionVersion: 1 ... bamboo.custom.aws.lambda.function.resources.arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one.Name: alias-one Creating common variables for first resource affected by task: Creating resource variables for alias 'arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-31-ubot:alias-one': ... bamboo.custom.aws.lambda.function.first.AliasArn: arn:aws:lambda:us-east-1:288727192237:function:TAWS-IT280-LF2-21-ubot:alias-one ... bamboo.custom.aws.lambda.function.first.Description: description one ... bamboo.custom.aws.lambda.function.first.FunctionVersion: 1 ... bamboo.custom.aws.lambda.function.first.Name: alias-one

Update Alias

See Create Alias above.

Delete Alias

N/A

Add Permission

Creating add permission result variables for function 'TAWS-IT280-LF1-21-ubot': ... bamboo.custom.aws.lambda.function.policy.Statement: {"Condition":{"ArnLike":{"AWS:SourceArn":"arn:aws:s3:::taws-it280-21-ubot"}},"Action":["lambda:InvokeFunction"],"Resource":"arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot","Effect":"Allow","Principal":{"Service":"s3.amazonaws.com"},"Sid":"TAWS-IT280-LF1-21"}

Remove Permission

N/A

Invoke Function

How-to Articles

Frequently Asked Questions (FAQ)

 

Atlassian®, Atlassian Bamboo®, Bitbucket®, Atlassian Crowd®, Confluence®, Jira®, Jira Service Management™, Opsgenie®, and Statuspage™ are registered trademarks of Atlassian.
Amazon Web Services™, AWS™ and the “Powered by Amazon Web Services” logo are trademarks of Amazon.com, Inc. or its affiliates in the United States and/or other countries.

Utoolity® is a registered trademark of Utoolity GmbH.
© 2024 Utoolity GmbH. All rights reserved.