Menu
AWS Greengrass
API Reference

/greengrass/definition/functions/FunctionDefinitionId/versions

POST

POST /greengrass/definition/functions/FunctionDefinitionId/versions

Operation ID: CreateFunctionDefinitionVersion

Creates a version of a Lambda function definition that has already been defined.

Produces: application/json

Body Parameters

CreateFunctionDefinitionVersionRequestBody

Information about the function definition version.

where used: body; required: true

Copy
{ "Functions": [ { "Id": "string", "FunctionArn": "string", "FunctionConfiguration": { "Pinned": true, "Executable": "string", "ExecArgs": "string", "MemorySize": 0, "Timeout": 0, "Environment": { "Variables": { "additionalProperty0": "string", "additionalProperty1": "string", "additionalProperty2": "string" }, "ResourceAccessPolicies": [ { "ResourceId": "string", "Permission": "ro|rw" } ], "AccessSysfs": true } } } ] }
FunctionDefinitionVersion

Information about a function definition version.

type: object

Functions

A list of Lambda functions in this function definition version.

type: array

items: Function

Information about a Lambda function.

type: object

required: ["Id"]

Id

The ID of the Lambda function.

type: string

FunctionArn

The ARN of the Lambda function.

type: string

FunctionConfiguration

The configuration of the Lambda function.

type: object

Pinned

True if the function is pinned. Pinned means the function is long-lived and starts when the core starts.

type: boolean

Executable

The name of the function executable.

type: string

ExecArgs

The execution arguments.

type: string

MemorySize

The memory size, in KB, which the function requires.

type: integer

Timeout

The allowed 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 configuration of the function.

type: object

Variables

Environment variables for the Lambda function's configuration.

type: object

additionalProperties: "type"=>"string"

ResourceAccessPolicies

A list of the resources, with their permissions, to which the Lambda function will be granted access.

type: array

items: ResourceAccessPolicy

ResourceAccessPolicy

A policy used by the function to access a resource.

type: object

required: ["ResourceId"]

ResourceId

The ID of the resource. (This ID is assigned to the resource when you create the resource definiton.)

type: string

Permission

The type of permission a function has to access a resource.

type: string

enum: ["ro", "rw"]

AccessSysfs

If true, the Lambda function is allowed to access the host's /sys folder. Use this when the Lambda function needs to read device information from /sys.

type: boolean

Header Parameters

X-Amzn-Client-Token

A client token used to correlate requests and responses.

where used: header; required: false

type: string

Path Parameters

FunctionDefinitionId

The ID of the Lambda function definition.

where used: path; required: true

type: string

CLI

Copy
aws greengrass create-function-definition-version \ --function-definition-id <value> \ [--functions <value>] \ [--amzn-client-token <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "FunctionDefinitionId": "string", "Functions": [ { "Id": "string", "FunctionArn": "string", "FunctionConfiguration": { "Pinned": "boolean", "Executable": "string", "ExecArgs": "string", "MemorySize": "integer", "Timeout": "integer", "Environment": { "Variables": { "additionalProperty0": "string", "additionalProperty1": "string", "additionalProperty2": "string" }, "ResourceAccessPolicies": [ { "ResourceId": "string", "Permission": "ro|rw" } ], "AccessSysfs": "boolean" } } } ], "AmznClientToken": "string" }

Responses

200 (CreateFunctionDefinitionVersionResponse)

VersionInformation

Copy
{ "Arn": "string", "Id": "string", "Version": "string", "CreationTimestamp": "string" }
VersionInformation

Information about a version.

type: object

Arn

The ARN of the version.

type: string

Id

The ID of the version.

type: string

Version

The unique ID of the version.

type: string

CreationTimestamp

The time, in milliseconds since the epoch, when the version was created.

type: string

400

invalid request

GeneralError

Copy
{ "Message": "string", "ErrorDetails": [ { "DetailedErrorCode": "string", "DetailedErrorMessage": "string" } ] }
GeneralError

General error information.

type: object

required: ["Message"]

Message

A message containing information about the error.

type: string

ErrorDetails

A list of error details.

type: array

items: ErrorDetail

ErrorDetail

Details about the error.

type: object

DetailedErrorCode

A detailed error code.

type: string

DetailedErrorMessage

A detailed error message.

type: string

GET

GET /greengrass/definition/functions/FunctionDefinitionId/versions

Operation ID: ListFunctionDefinitionVersions

Lists the versions of a Lambda function definition.

Produces: application/json

Path Parameters

FunctionDefinitionId

The ID of the Lambda function definition.

where used: path; required: true

type: string

Query Parameters

NextToken

The token for the next set of results, or null if there are no additional results.

where used: query; required: false

type: string

MaxResults

The maximum number of results to be returned per request.

where used: query; required: false

type: integer

CLI

Copy
aws greengrass list-function-definition-versions \ --function-definition-id <value> \ [--next-token <value>] \ [--max-results <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

Copy
{ "FunctionDefinitionId": "string", "NextToken": "string", "MaxResults": "integer" }

Responses

200 (ListFunctionDefinitionVersionsResponse)

ListVersionsResponse

Copy
{ "Versions": [ { "Arn": "string", "Id": "string", "Version": "string", "CreationTimestamp": "string" } ], "NextToken": "string" }
ListVersionsResponse

A list of versions.

type: object

Versions

Information about a version.

type: array

items: VersionInformation

VersionInformation

Information about a version.

type: object

Arn

The ARN of the version.

type: string

Id

The ID of the version.

type: string

Version

The unique ID of the version.

type: string

CreationTimestamp

The time, in milliseconds since the epoch, when the version was created.

type: string

NextToken

The token for the next set of results, or null if there are no additional results.

type: string

400

invalid request

GeneralError

Copy
{ "Message": "string", "ErrorDetails": [ { "DetailedErrorCode": "string", "DetailedErrorMessage": "string" } ] }
GeneralError

General error information.

type: object

required: ["Message"]

Message

A message containing information about the error.

type: string

ErrorDetails

A list of error details.

type: array

items: ErrorDetail

ErrorDetail

Details about the error.

type: object

DetailedErrorCode

A detailed error code.

type: string

DetailedErrorMessage

A detailed error message.

type: string

On this page: