Documentation for Tasks for AWS 2.13 – other releases are available in the Tasks for AWS Documentation Directory.
View

Unknown macro: {spacejump}

or visit the current documentation home.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

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:

    1. Common to all tasks

       Click here to expand...
      Task Description (Optional) Identify the purpose of the task.
      Disable this task

      Check, or clear, to selectively run this task.

      Action

      Each task supports one or more actions depending on the target AWS resource. Select the desired action and configure the action specific parameters below.

      RegionSelect the desired AWS Region. Alternatively, select [Use region variable ...] to supply the region dynamically via Bamboo variables (needs to be a region code such as ap-southeast-2) - refer to How to parametrize the AWS region via a Bamboo variable for details.
      ...Configure task/action specific parameters, see below ...
      AWS Security Credentials
      SourceSelect the source for the required AWS Security Credentials - can be either Inline, an IAM Role for EC2 or a shared Identity Federation for AWS Connector.
      Connector(Conditional) Select the shared Identity Federation for AWS Connector. Alternatively, select [Use connector variable ...] to supply the connector dynamically via Bamboo variables (needs to be a connector id such as f24e81bc-7aff-42db-86a2-7cf82e24d871) - refer to How to parametrize the AWS connector via a Bamboo variable for details.

    • Actions supported by this task:

      Create Function

       
      Function Name

      Specify a function name.

      Description

      (Optional) Specify a function description.

      Runtime

      Select a runtime environment for the function.

      S3 Bucket
      Specify the name of the S3 bucket where the deployment package is stored.
      S3 KeySpecify the deployment package's S3 object key.
      • (info) Maximum compressed size allowed is 50 MB.
      • (info) Maximum uncompressed size allowed is 250 MB.
      S3 Object Version(Optional) Specify the deployment package's S3 object version.
      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)

      Select 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)
      Select the execution time, in seconds, at which Lambda should terminate the function.

      Update Function Code

       

       

      Function Name

      see Create Function above

      S3 Bucket
      see Create Function above
      S3 Keysee Create Function above
      S3 Object Versionsee Create Function above

      Update Function Configuration

       

      Function Name

      see Create Function above

      Descriptionsee Create Function above
      Handler see Create Function above
      Rolesee Create Function above
      Memory (MB)
      see Create Function above
      Timeout (s)
      see Create Function above

      Delete Function

       

      Don't fail for non existing functionCheck 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

      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.

      By default, the Invoke API assumes "RequestResponse" invocation type. You can optionally request asynchronous execution by specifying "Event" as the InvocationType. You can also use this parameter to request AWS Lambda to not execute the function but do some verification, such as if the caller is authorized to invoke the function and if the inputs are valid

      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.

      Add Permission

       
      Function Name

      see Create Function above

      Statement ID
      Specify a unique statement identifier.
      Lambda ActionSpecify 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

Variables

All tasks support Bamboo Variable Substitution/Definition - this task's actions generate variables as follows:

A task's generated variables might get amended with respective AWS API additions over time - a live build log will always provide the most current variable shape accordingly

Create Function

Creating common variables for 1 resources affected by task:
... 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':
... 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
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.FunctionName: TAWS-IT280-LF1-21-ubot
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Description:
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Runtime: nodejs
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Handler: index.handler
... 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
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.MemorySize: 128
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.Timeout: 2
... custom.aws.lambda.function.resources.arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot.CodeSize: 499
... 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
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':
... custom.aws.lambda.function.first.FunctionArn: arn:aws:lambda:eu-west-1:288727192237:function:TAWS-IT280-LF1-21-ubot
... custom.aws.lambda.function.first.FunctionName: TAWS-IT280-LF1-21-ubot
... custom.aws.lambda.function.first.Description:
... custom.aws.lambda.function.first.Runtime: nodejs
... custom.aws.lambda.function.first.Handler: index.handler
... custom.aws.lambda.function.first.Role: arn:aws:iam::288727192237:role/aws-lambda-basic-execution
... custom.aws.lambda.function.first.MemorySize: 128
... custom.aws.lambda.function.first.Timeout: 2
... custom.aws.lambda.function.first.CodeSize: 499
... custom.aws.lambda.function.first.LastModified: 2015-08-25T17:07:47.960+0000

Update Function Code

See Create above.

Update Function Configuration

See Create above.

Delete Function

N/A

Invoke Function

Creating invocation result variables for function 'TAWS-IT280-LF1-21-ubot':
... custom.aws.lambda.function.result.FunctionError: null
... custom.aws.lambda.function.result.LogResult: null
... custom.aws.lambda.function.result.Payload:
... custom.aws.lambda.function.result.StatusCode: 200

Add Permission

Creating add permission result variables for function 'TAWS-IT280-LF1-21-ubot':
... 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

How-to Articles

Frequently Asked Questions (FAQ)

  • No labels