Skip to main content

component_versions

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

Overview

Namecomponent_versions
TypeResource
Idaws.greengrassv2.component_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the component version.
component_namestringThe name of the component.
component_versionstringThe version of the component.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_component_versionsselectarn, regionmaxResults, nextTokenRetrieves a paginated list of all versions for a component. Greater versions are listed first.
create_component_versioninsertregionCreates a component. Components are software that run on Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to IoT Greengrass. Then, you can deploy the component to other core devices. You can use this operation to do the following: Create components from recipes Create a component from a recipe, which is a file that defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For more information, see IoT Greengrass component recipe reference in the IoT Greengrass V2 Developer Guide. To create a component from a recipe, specify inlineRecipe when you call this operation. Create components from Lambda functions Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe and artifacts from the Lambda function's deployment package. You can use this operation to migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2. This function accepts Lambda functions in all supported versions of Python, Node.js, and Java runtimes. IoT Greengrass doesn't apply any additional restrictions on deprecated Lambda runtime versions. To create a component from a Lambda function, specify lambdaFunction when you call this operation. IoT Greengrass currently supports Lambda functions on only Linux core devices.

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
arnstringThe ARN of the component.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to be returned per paginated request.
nextTokenstringThe token to be used for the next set of paginated results.

SELECT examples

Retrieves a paginated list of all versions for a component. Greater versions are listed first.

SELECT
arn,
component_name,
component_version
FROM aws.greengrassv2.component_versions
WHERE arn = '{{ arn }}' -- required
AND region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;

INSERT examples

Creates a component. Components are software that run on Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to IoT Greengrass. Then, you can deploy the component to other core devices. You can use this operation to do the following: Create components from recipes Create a component from a recipe, which is a file that defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform capability. For more information, see IoT Greengrass component recipe reference in the IoT Greengrass V2 Developer Guide. To create a component from a recipe, specify inlineRecipe when you call this operation. Create components from Lambda functions Create a component from an Lambda function that runs on IoT Greengrass. This creates a recipe and artifacts from the Lambda function's deployment package. You can use this operation to migrate Lambda functions from IoT Greengrass V1 to IoT Greengrass V2. This function accepts Lambda functions in all supported versions of Python, Node.js, and Java runtimes. IoT Greengrass doesn't apply any additional restrictions on deprecated Lambda runtime versions. To create a component from a Lambda function, specify lambdaFunction when you call this operation. IoT Greengrass currently supports Lambda functions on only Linux core devices.

INSERT INTO aws.greengrassv2.component_versions (
inlineRecipe,
lambdaFunction,
tags,
clientToken,
region
)
SELECT
'{{ inlineRecipe }}',
'{{ lambdaFunction }}',
'{{ tags }}',
'{{ clientToken }}',
'{{ region }}'
RETURNING
arn,
component_name,
component_version,
creation_timestamp,
status
;