AWS::GreengrassV2::ComponentVersion
Creates a component. Components are software that run on Amazon IoT Greengrass core devices. After you develop and test a component on your core device, you can use this operation to upload your component to Amazon 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 Amazon IoT Greengrass component recipe reference in the Amazon IoT Greengrass V2 Developer Guide.
To create a component from a recipe, specify
inlineRecipewhen you call this operation. -
Create components from Lambda functions
Create a component from an Amazon Lambda function that runs on Amazon 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 Amazon IoT Greengrass V1 to Amazon IoT Greengrass V2.
This function only accepts Lambda functions that use the following runtimes:
-
Python 2.7 –
python2.7 -
Python 3.7 –
python3.7 -
Python 3.8 –
python3.8 -
Java 8 –
java8 -
Node.js 10 –
nodejs10.x -
Node.js 12 –
nodejs12.x
To create a component from a Lambda function, specify
lambdaFunctionwhen you call this operation. -
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::GreengrassV2::ComponentVersion", "Properties" : { "InlineRecipe" :String, "LambdaFunction" :LambdaFunctionRecipeSource, "Tags" :{} }Key:Value, ...}
YAML
Type: AWS::GreengrassV2::ComponentVersion Properties: InlineRecipe:StringLambdaFunction:LambdaFunctionRecipeSourceTags:Key:Value
Properties
InlineRecipe-
The recipe to use to create the component. The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either
InlineRecipeorLambdaFunction.Required: No
Type: String
Update requires: Replacement
LambdaFunction-
The parameters to create a component from a Lambda function.
You must specify either
InlineRecipeorLambdaFunction.Required: No
Type: LambdaFunctionRecipeSource
Update requires: Replacement
Tags-
Application-specific metadata to attach to the component version. You can use tags in IAM policies to control access to Amazon IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see Tag your Amazon IoT Greengrass Version 2 resources in the Amazon IoT Greengrass V2 Developer Guide.
This
Jsonproperty type is processed as a map of key-value pairs. It uses the following format, which is different from mostTagsimplementations in Amazon CloudFormation templates."Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value" }Required: No
Type: Map of String
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the Arn.
For more information about using the Reffunction, see Ref.
Fn::GetAtt
The Fn::GetAttintrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAttintrinsic function, see Fn::GetAtt.