component_versions
Creates, updates, deletes, gets or lists a component_versions resource.
Overview
| Name | component_versions |
| Type | Resource |
| Id | aws.greengrassv2.component_versions |
Fields
The following fields are returned by SELECT queries:
- list_component_versions
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the component version. |
component_name | string | The name of the component. |
component_version | string | The version of the component. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_component_versions | select | arn, region | maxResults, nextToken | Retrieves a paginated list of all versions for a component. Greater versions are listed first. |
create_component_version | insert | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the component. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The maximum number of results to be returned per paginated request. |
nextToken | string | The token to be used for the next set of paginated results. |
SELECT examples
- list_component_versions
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
- create_component_version
- Manifest
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
;
# Description fields are for documentation purposes
- name: component_versions
props:
- name: region
value: "{{ region }}"
description: Required parameter for the component_versions resource.
- name: inlineRecipe
value: "{{ inlineRecipe }}"
- name: lambdaFunction
description: |
Contains information about an Lambda function to import to create a component.
value:
lambdaArn: "{{ lambdaArn }}"
componentName: "{{ componentName }}"
componentVersion: "{{ componentVersion }}"
componentPlatforms:
- name: "{{ name }}"
attributes: "{{ attributes }}"
componentDependencies: "{{ componentDependencies }}"
componentLambdaParameters:
eventSources:
- topic: "{{ topic }}"
type_: "{{ type_ }}"
maxQueueSize: {{ maxQueueSize }}
maxInstancesCount: {{ maxInstancesCount }}
maxIdleTimeInSeconds: {{ maxIdleTimeInSeconds }}
timeoutInSeconds: {{ timeoutInSeconds }}
statusTimeoutInSeconds: {{ statusTimeoutInSeconds }}
pinned: {{ pinned }}
inputPayloadEncodingType: "{{ inputPayloadEncodingType }}"
execArgs:
- "{{ execArgs }}"
environmentVariables: "{{ environmentVariables }}"
linuxProcessParams:
isolationMode: "{{ isolationMode }}"
containerParams:
memorySizeInKB: {{ memorySizeInKB }}
mountROSysfs: {{ mountROSysfs }}
volumes:
- sourcePath: "{{ sourcePath }}"
destinationPath: "{{ destinationPath }}"
permission: "{{ permission }}"
addGroupOwner: {{ addGroupOwner }}
devices:
- path: "{{ path }}"
permission: "{{ permission }}"
addGroupOwner: {{ addGroupOwner }}
- name: tags
value: "{{ tags }}"
- name: clientToken
value: "{{ clientToken }}"