Integrations
You can use the Invoke Lambda Function action with the following integrations:
Filter by label
There are no items with the selected labels at this time.
Requirements
The Invoke Lambda Function action requires sufficient IAM permissions - an adequate IAM policy similar to the one provisioned by the Automation with AWS (Core) CloudFormation template might look as follows:
Refer to Overview of Managing Access Permissions to Your AWS Lambda Resources for details on how to create more granular/secure policies.
Configuration
To configure an Invoke Lambda Function action:
Complete the following settings:
Parameters Specify the action parameters according to the following skeleton in JSON format – refer to lambda . invoke for details:
You typically only specify the
FunctionName
andPayload
parameters, and not all parameters documented for lambda . invoke are applicable here (invocation-type
andlog-type
are not meaningful, andoutfile
is not supported).You can inject contextual variables into the remote action payload, refer to Entity Variables for details.
Invoke Lambda Function skeleton{ "FunctionName": "", "Payload": {}, "Qualifier": "", "ClientContext": {} }
Entity Variables
-
DeploymentResult — The Bamboo
${deploymentResult}
entity returns the following JSON shape:DeploymentResult shape (JSON)
{ "agentId": "<>", "deploymentVersionName": "<>", "environmentId": "<>", "executedDate": "<>", "finishedDate": "<>", "id": "<>", "queuedDate": "<>", "reasonSummary": "<>", "startedDate": "<>" }
-
-
ResultsSummary — The Bamboo
${resultsSummary}
entity returns the following JSON shape:ResultsSummary shape (JSON)
{ "buildAgentId": "<the id of the latest agent that built the result>", "buildCancelledDate": "<when the build was cancelled>", "buildCompletedDate": "<when the build finished>", "buildDate": "<>", "buildNumber": "<>", "buildTime": "<>", "changesListSummary": "<>", "duration": "<the duration of the build in milliseconds>", "durationDescription": "<the duration in a 'pretty' format>", "formatVersion": "<>", "id": "<>", "logSize": "<the size of the log file associated with this result>", "processingDuration": "<>", "processingDurationDescription": "<>", "queueTime": "<>", "reasonSummary": "<>", "relativeBuildDate": "<>", "relativeBuildStartedDate": "<the relative started time (duration) compared to current date>", "relativeQueueDate": "<>", "restartCount": "<>", "shortReasonSummary": "<>", "testSummary": "<>", "timeToFix": "<the stored version of how long (milli seconds) it took for this build to fix a failure>" }
-
-
-
-
Notification — The Bamboo
${notification}
entity returns the following JSON shape:Notification shape (JSON)
{ "description": "<a description>", "emailSubject: "<the email subject>", "htmlEmailContent": "<the HTML email content>", "imContent": "<the instant messaging content>", "textEmailContent": "<the text email content>" }
-
Examples
-
Invoke Lambda Function — This parameters template demonstrates the Invoke Lambda Function action:
JSON escaping requirements
If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:
custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function
variables with conflicting content (e.g. multi line variables like JIRA's
$issue.fields.description
or Bamboo's$notification.textEmailContent
or JSON structures retrieved via JSONPath) need to be escaped twice, via$util.escapeJson($util.escapeJson(...))
- we are exploring options on how to make this easier in a future release
Invoke Lambda Function parameters example (escaped manually)
{ "FunctionName": "arn:aws:lambda:ap-southeast-2:123456789012:function:sample-AutomationWithAWSQuickstartLamb-1RRX37PWXZXLS", "Payload": "{ \"Event\":\"$event.simpleName\", \"Timestamp\": \"$event.timestamp\", \"TraceID\": \"$event.traceId\"}" }
Invoke Lambda Function parameters example (escaped with utility function)
{ "FunctionName": "arn:aws:lambda:ap-southeast-2:123456789012:function:sample-AutomationWithAWSQuickstartLamb-1RRX37PWXZXLS", "Payload": "$util.escapeJson('{ "Event": "$event.simpleName", "Timestamp": "$event.timestamp", "TraceID": "$event.traceId" }')" }
How-to Articles
Filter by label
There are no items with the selected labels at this time.