Menu
AWS Greengrass
API Reference

CreateFunctionDefinition

Creates a Lambda function definition which contains a list of Lambda functions and their configurations to be used in a group. You can create an initial version of the definition by providing a list of Lambda functions and their configurations now, or use CreateFunctionDefinitionVersion later.

URI: /greengrass/definition/functions

Operation: POST

Produces: application/json

Parameters:

  • CreateFunctionDefinitionRequestBody

    Information needed to create a function definition.

    where used: body

    required: true

    schema:

    properties:

    • Name:

      The name of the function definition.

      type: string

    • InitialVersion:

      Information about the initial version of the function definition.

      FunctionDefinitionVersion

      type: object

      Information about a function definition version

      properties:

      • Functions

        A list of the lambda functions in the function definition version.

        type: array

        items:
        Function:

        type: object

        Information about a function.

        required: Id

        properties:

        • Id:

          The id of the Lambda function.

          type: string

        • FunctionArn:

          The arn of the Lambda function.

          type: string

        • FunctionConfiguration:

          The configuration of the function

          FunctionConfiguration:

          type: object

          The configuration of a function

          properties:

          • Pinned:

            Whether the function is pinned or not. Pinned means the function is long-lived and starts when the core starts.

            type: boolean

          • Executable:

            The executable.

            type: string

          • ExecArgs:

            The execution arguments.

            type: string

          • MemorySize:

            The memory size, in KB, which are configured for the function.

            type: integer

          • Timeout:

            The function execution time after which Lambda should terminate the function. This timeout still applies to pinned lambdas for each request.

            type: integer

          • Environment:

            The environment of the function configuration.

            FunctionConfigurationEnvironment:

            type: object

            The Environment of a function configuration.

            properties:

            • Variables:

              The environment variables for the lambda function.

              type: object

              additionalProperties:

              type: string

    Example:

    Copy
    { "Name": "string", "InitialVersion": { "Functions": [ { "Id": "string", "FunctionArn": "string", "FunctionConfiguration": { "Pinned": true, "Executable": "string", "ExecArgs": "string", "MemorySize": 0, "Timeout": 0, "Environment": { "Variables": { "additionalProperty0": "string", "additionalProperty1": "string", "additionalProperty2": "string" } } } } ] } }
  • X-Amzn-Client-Token

    A client token used to correlate requests and responses.

    where used: header

    required: false

    type: string

Responses: