Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changes for v1.1.0

...

AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, and security.

AWS Lambda can automatically run code in response to multiple events, such as:

  • HTTP requests via Amazon API Gateway
  • Modifications to objects in Amazon S3 buckets
  • Table updates in Amazon DynamoDB
  • State transitions in AWS Step Functions

Lambda runs your code on high-availability compute infrastructure and performs all the administration of the compute resources, including:

  • Server and operating system maintenance
  • Capacity provisioning and automatic scaling
  • Code and security patch deployment
  • Code monitoring and logging.

All you need to do is supply the code.

Image Removed

This Universal Extension provides the capability to execute a AWS Lambda function and return the result of that execution.

Version Information

Template NameExtension NameExtension Version
AWS Lambdaue-aws-lambda1.1.0

Refer to Changelog for version history information.

Software Requirements

This integration requires a Universal Agent and a Python runtime to execute the Universal Task.

Software Requirements for Universal Template and Universal Task

Requires Python 3.7.0 or higher. Tested with the Universal Agent bundled Python distribution.

...

Extension's Universal Agent host should be able to reach AWS Lambda REST endpoints.

Key Features

This Universal Extension provides the following key features:

...

To use the Universal Template, you first must perform the following steps:.

  1. This Universal Task requires the Resolvable Credentials feature. Check that the Resolvable Credentials Permitted system property has been set to true.

  2. Download the provided ZIP file.

  3. In the Universal Controller UI, select Administration >Configuration > Universal Templates to display the current list of Universal Templates.

  4. Click Import Template.

  5. Select the template ZIP file and Import.

...

  1. To import the Universal Template into your Controller, follow the instructions here.

  2. When the files have been imported successfully, refresh the Universal Templates list; the Universal Template will appear on the list

...

  1. .

Configure Universal Task

For the new Universal Task type AWS Lambda, create a new task, and enter the task-specific details that were created in the Universal Template.

...

FieldInput typeDefault valueTypeDescription
ActionRequiredTrigger Lambda functionChoice

The action performed upon the task execution. Available action:

  • Trigger Lambda function

AWS Region

Required

Optional since version 1.1.0

Optional-Text

Region for the Amazon Web Service. Find more information about the AWS Service endpoints and quotas here.

When AWS

CredentialsRequired

Region is not populated as part of the task definition, during task execution the integration will look for credentials on the task execution environment. Refer to configuration options for more information.

AWS Credentials

Optional since version 1.1.0

Optional-Credentials

The AWS account credentials.

They are comprised of:

  • AWS access key ID
  • AWS secret access key

Credentials definition should be as follows.

  • AWS Access Key ID as "Runtime User".
  • AWS Secret Access Key as "Runtime Password".

When AWS Credentials are not populated as part of the task definition, during task execution the integration will look for AWS Credentials on the task execution environment. Refer to configuration options for more information.

Role Based AccessOptionalFalseBoolean

Special type of authorization is provided by Role Assumption where the client sends his own credentials and the role he wants to assume from another user.

If allowed, the client receives temporary credentials with limited time access to some resources.

Role ARNOptional-Text

Role Arn: Amazon Role, which is applied for the connection. Role ARN format: Example RoleArn: arn:aws:iam::119322085622:role.

Required when Role Based Access="True".

Function NameRequired-TextName of the Lambda function i.e my, which will be triggered. For example, my-function (name-only) or my-function:v1 (with alias) that will be triggered.
Invocation TypeRequiredRequest ResponseChoice

Type of execution for the function being triggered. Available choices are:

  • Request Response (Synchronously)
  • Event (Asynchronously)
Payload SourceOptionalNoneChoice

Source of payload to be sent.

  • None
  • Script
Payload ScriptOptional-Script Field

Script field where the payload can be entered. The scripts must evaluate to a proper JSON format.

Required when Payload Source = "Script".

Client Context SourceOptionalNoneChoice

Client context that's provided to Lambda function by the client application.

  • None
  • Script
Client Context ScriptOptional-Script

Script passing parameters using the ClientContext object. The scripts must evaluate to a proper JSON format.

Required when Client Context Source= "Script".

Use ProxyOptionalFalseBooleanFlag to indicate whether Proxy shall be used in the communication with AWS.
Proxy TypeOptionalHTTPChoice

Type of proxy connection to be used.

Available options are

:

the following.

  • HTTP
  • HTTPS
  • HTTPS with Credentials

Visible only when Use Proxy = "True".

ProxyOptional-Text

Comma separated list of Proxy servers. Valid formats: Valid formats are the following.
http://proxyip:port or http://proxyip:port,https://proxyip:port.

Required when Use Proxy is checked.

Proxy CA Bundle FileOptional-Text

The path to a custom certificate bundle to use when establishing SSL/TLS connections with proxy.

Used when Proxy Type is configured for "HTTPS" or "HTTPS With Credentials".

Proxy CredentialsOptional-Credentials

Credentials to be used for the proxy communication.They are comprised of:

  • username
  • password

    The credential definition should be as follows.

    • Proxy Username as "Runtime User".
    • Proxy Password as "Runtime Password".

    Required when "Proxy Type" is configured for "HTTPS" or "HTTPS With Credentials".

    QualifierOptional-Text

    Version or alias to invoke a published version of the function. Example for version 1 Qualifier = "1".

    If empty, default value is the latest version.

    Extension Cancellation

    ...

    .

    ...

    ...

    Task Examples

    Trigger Lambda Synchronously with Log

    Triggering a Lambda function Sychronously Synchronously with Log Type equals "Tail".

    Syncronously Synchronicity is set by Invocation Type equals "Request_Response".

    Image RemovedImage Added

    Trigger Lambda Asynchronously with Role Based Access and HTTPS Proxy

    Triggering Lambda function Asychronously, Asynchronously with:

    • Role Based Access

    ...

    • HTTPS Proxy connection

    ...

    ...

    • Payload Source

    ...

    • Client Context Source

    ...

    Also, Qualifier is set to "3", meaning the 3rd version of the Lambda function will be triggered.

    Asyncronously is set by Invocation Type equals "Event". "Proxy" needs to be on the correct format and "Proxy CA Bundle File" on correct format and path.

    Image Removed

    Image Added

    Trigger Lambda Synchronously with HTTPS with Credentials Proxy

    Triggering a Lambda function Sychronously Synchronously with "HTTPS with Credentials" Proxy " connection.

    Note that the Log Type is set to "None" and Qualifier is blank, meaning that the latest version of the Lambda function will be called.

    Image Removed

    Image Added

    Trigger Lambda Synchronously with Log

    Triggering a Lambda function Synchronously with "Region" provided as environment variables and without AWS Credentials. Please refer to AWS Credentials input field for more information.

    Image Added

    Task Output

    Exit Codes

    The exit codes for AWS Lambda Extension are described in the following table.

    Exit CodeStatus Classification CodeStatus Classification DescriptionStatus Description
    0SUCCESSSuccessful ExecutionSUCCESS: Successful Task execution
    1FAILFailed ExecutionFAIL: < Error Description >
    2AUTHENTICATION_ERRORBad credentialsAUTHENTICATION_ERROR: Account cannot be authenticated.
    3AUTHORIZATION_ERRORInsufficient PermissionsAUTHORIZATION_ERROR: Account is not authorized to perform the requested action.
    10CONNECTION_ERRORBad connection data or connection timed outCONNECTION_ERROR: < Error Description >
    11CONNECTION_ERRORExtension specific connection errorCONNECTION_ERROR: ProxyConnectionError: Failed to connect to proxy URL <url>
    20DATA_VALIDATION_ERRORInput fields validation errorDATA_VALIDATION_ERROR: Some of the input fields cannot be validated. See STDOUT for more details.

    Extension Output

    In the context of a workflow, subsequent tasks can rely on the information provided by this integration as Extension Output.

    Attribute changed is populated as follows.

    • true in case the job is triggered successfully
    • false otherwise

    result section includes the following attributes.

    AttributeTypeDescription
    status_codeintegerThe HTTP status code is in the 200 range for a successful request. For the RequestResponse invocation type, this status code is 200. For the Event invocation type, this status code is 202. For the DryRun invocation type, the status code is 204.
    log_resultstringThe last 4 KB of the execution log, which is base64 encoded.
    payloadstringThe response from the function, or an error object.
    executed_versionstringThe version of the function that executed. When you invoke a function with an alias, this indicates which version the alias resolved to.
    function_errorstringIf present, indicates that an error occurred during function execution. Details about the error are included in the response payload.

    An example of the Extension Output for AWS Lambda Universal Task successful execution is described a successful triggering job is presented below.

    {
      "exit_code": 0,
      "status_description": "SUCCESS: AWS Lambda function invoked successfully",
      "changed": true,
      "invocation": {
          "extension": "ue-aws-lambda",
          "version": "1.

    ...

    1.0",
          "fields": {
              "action": "Trigger Lambda Function",
              "credentials_user": "test-user",
              "credentials_password": "****",
              "region": "us-east-1",
              "role_based_access": false,
              "role_arn": null,
              "function_name": "test-function",
              "invocation_type": "RequestResponse",
              "payload_source": null,
              "payload_script": null,
              "client_context_source": null,
              "client_context_script": null,
              "log_type": null,
              "qualifier": null,
              "use_proxy": false,
              "proxy_type": null,
              "proxy": null,
              "proxy_credentials_user": null,
              "proxy_credentials_password": null,
              "proxy_ca_bundle_file": null
          }
      },
      "result": {
          "status_code": 200,
          "log_result": "Multiline Log text",
          "payload": "{\"statusCode\": 999, \"body\": {\"message\": \"Hello World\"}}",
          "executed_version": "$LATEST",
          "function_error": null,
        }
      }
    }
    

    Task Status

    The task instance with Status equals to "Success" and Exit Code equals "0".

    Image Removed

    STDOUT and STDERR

    STDOUT and STDERR provide additional information to User. The populated content can be changed in future versions of this extension without notice. Backward compatibility is not guaranteed.

    Document References

    This document references the following documents:.

    Universal Templates
    NameDocument LinkLocationDescription
    https://docs.stonebranch.com/confluence/display/UC72x/Universal + TemplatesUser documentation for creating, working with and understanding Universal Templates in the Universal Controller user interfaceand Integrations.
    Universal Taskshttps://docs.stonebranch.com/confluence/display/UC72x/Universal+TasksUser documentation for creating Universal Tasks in the Universal Controller user interface.
    AWS Lambdahttps://docs.aws.amazon.com/lambda/?id=docs_gatewayDocumentation for AWS Lambda.
    IAM RBAC authorization modelhttps://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html#introduction_attribute-based-access-control_compare-rbacUser Documentation for Comparing ABAC to the traditional RBAC model.User Documentation for Comparing ABAC to the traditional RBAC model.

    Changelog

    ue-aws-lambda-1.1.0 (2022-06-30)

    Enhancements

    • Added: Provide the capability to rely on AWS credentials set-up on the environment where the extension is running and therefore it is not mandatory to be passed on the task definition as input fields. The same applies to AWS Region. (#29115)

    ue-aws-lambda-1.0.1 (2022-03-14)

    Fixes

    • Fixed Change of template SysId. (#27744)