Skip to main content

function_definitions

Creates, updates, deletes, gets or lists a function_definitions resource.

Overview

Namefunction_definitions
TypeResource
Idaws.greengrass.function_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the definition.
creation_timestampstringThe time, in milliseconds since the epoch, when the definition was created.
idstringThe ID of the definition.
last_updated_timestampstringThe time, in milliseconds since the epoch, when the definition was last updated.
latest_versionstringThe ID of the latest version associated with the definition.
latest_version_arnstringThe ARN of the latest version associated with the definition.
namestringThe name of the definition.
tagsobjectTag(s) attached to the resource arn.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_function_definitionselectfunction_definition_id, regionRetrieves information about a Lambda function definition, including its creation time and latest version.
list_function_definitionsselectregionMaxResults, NextTokenRetrieves a list of Lambda function definitions.
create_function_definitioninsertregionX-Amzn-Client-TokenCreates 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.
update_function_definitionupdatefunction_definition_id, regionUpdates a Lambda function definition.
delete_function_definitiondeletefunction_definition_id, regionDeletes a Lambda function definition.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
function_definition_idstringThe ID of the Lambda function definition.
regionstringAWS region (default: us-east-1)
MaxResultsstringThe maximum number of results to be returned per request.
NextTokenstringThe token for the next set of results, or ''null'' if there are no additional results.
X-Amzn-Client-TokenstringA client token used to correlate requests and responses.

SELECT examples

Retrieves information about a Lambda function definition, including its creation time and latest version.

SELECT
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name,
tags
FROM aws.greengrass.function_definitions
WHERE function_definition_id = '{{ function_definition_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

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.

INSERT INTO aws.greengrass.function_definitions (
InitialVersion,
Name,
tags,
region,
`X-Amzn-Client-Token`
)
SELECT
'{{ InitialVersion }}',
'{{ Name }}',
'{{ tags }}',
'{{ region }}',
'{{ X-Amzn-Client-Token }}'
RETURNING
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name
;

UPDATE examples

Updates a Lambda function definition.

UPDATE aws.greengrass.function_definitions
SET
Name = '{{ Name }}'
WHERE
function_definition_id = '{{ function_definition_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes a Lambda function definition.

DELETE FROM aws.greengrass.function_definitions
WHERE function_definition_id = '{{ function_definition_id }}' --required
AND region = '{{ region }}' --required
;