AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS GreengrassV2 CreateComponentVersion API operation.

Syntax

New-GGV2ComponentVersion
-LambdaFunction_ComponentDependency <Hashtable>
-LambdaFunction_ComponentName <String>
-LambdaFunction_ComponentPlatform <ComponentPlatform[]>
-LambdaFunction_ComponentVersion <String>
-ContainerParams_Device <LambdaDeviceMount[]>
-ComponentLambdaParameters_EnvironmentVariable <Hashtable>
-ComponentLambdaParameters_EventSource <LambdaEventSource[]>
-ComponentLambdaParameters_ExecArg <String[]>
-InlineRecipe <Byte[]>
-ComponentLambdaParameters_InputPayloadEncodingType <LambdaInputPayloadEncodingType>
-LinuxProcessParams_IsolationMode <LambdaIsolationMode>
-LambdaFunction_LambdaArn <String>
-ComponentLambdaParameters_MaxIdleTimeInSecond <Int32>
-ComponentLambdaParameters_MaxInstancesCount <Int32>
-ComponentLambdaParameters_MaxQueueSize <Int32>
-ContainerParams_MemorySizeInKB <Int32>
-ContainerParams_MountROSysf <Boolean>
-ComponentLambdaParameters_Pinned <Boolean>
-ComponentLambdaParameters_StatusTimeoutInSecond <Int32>
-Tag <Hashtable>
-ComponentLambdaParameters_TimeoutInSecond <Int32>
-ContainerParams_Volume <LambdaVolumeMount[]>
-ClientToken <String>
-Select <String>
-Force <SwitchParameter>

Description

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 only accepts Lambda functions that use the following runtimes:
    • Python 2.7 – python2.7
    • Python 3.7 – python3.7
    • Python 3.8 – python3.8
    • Python 3.9 – python3.9
    • Java 8 – java8
    • Java 11 – java11
    • Node.js 10 – nodejs10.x
    • Node.js 12 – nodejs12.x
    • Node.js 14 – nodejs14.x
    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

-ClientToken <String>
A unique, case-sensitive identifier that you can provide to ensure that the request is idempotent. Idempotency means that the request is successfully processed only once, even if you send the request multiple times. When a request succeeds, and you specify the same client token for subsequent successful requests, the IoT Greengrass V2 service returns the successful response that it caches from the previous request. IoT Greengrass V2 caches successful responses for idempotent requests for up to 8 hours.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ComponentLambdaParameters_EnvironmentVariable <Hashtable>
The map of environment variables that are available to the Lambda function when it runs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_EnvironmentVariables
-ComponentLambdaParameters_EventSource <LambdaEventSource[]>
The list of event sources to which to subscribe to receive work messages. The Lambda function runs when it receives a message from an event source. You can subscribe this function to local publish/subscribe messages and Amazon Web Services IoT Core MQTT messages.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_EventSources
-ComponentLambdaParameters_ExecArg <String[]>
The list of arguments to pass to the Lambda function when it runs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_ExecArgs
-ComponentLambdaParameters_InputPayloadEncodingType <LambdaInputPayloadEncodingType>
The encoding type that the Lambda function supports.Default: json
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_InputPayloadEncodingType
-ComponentLambdaParameters_MaxIdleTimeInSecond <Int32>
The maximum amount of time in seconds that a non-pinned Lambda function can idle before the IoT Greengrass Core software stops its process.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_MaxIdleTimeInSeconds
-ComponentLambdaParameters_MaxInstancesCount <Int32>
The maximum number of instances that a non-pinned Lambda function can run at the same time.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_MaxInstancesCount
-ComponentLambdaParameters_MaxQueueSize <Int32>
The maximum size of the message queue for the Lambda function component. The IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_MaxQueueSize
-ComponentLambdaParameters_Pinned <Boolean>
Whether or not the Lambda function is pinned, or long-lived.
  • A pinned Lambda function starts when IoT Greengrass starts and keeps running in its own container.
  • A non-pinned Lambda function starts only when it receives a work item and exists after it idles for maxIdleTimeInSeconds. If the function has multiple work items, the IoT Greengrass Core software creates multiple instances of the function.
Default: true
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_Pinned
-ComponentLambdaParameters_StatusTimeoutInSecond <Int32>
The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_StatusTimeoutInSeconds
-ComponentLambdaParameters_TimeoutInSecond <Int32>
The maximum amount of time in seconds that the Lambda function can process a work item.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_TimeoutInSeconds
-ContainerParams_Device <LambdaDeviceMount[]>
The list of system devices that the container can access.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_LinuxProcessParams_ContainerParams_Devices
-ContainerParams_MemorySizeInKB <Int32>
The memory size of the container, expressed in kilobytes.Default: 16384 (16 MB)
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_LinuxProcessParams_ContainerParams_MemorySizeInKB
-ContainerParams_MountROSysf <Boolean>
Whether or not the container can read information from the device's /sys folder.Default: false
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_LinuxProcessParams_ContainerParams_MountROSysfs
-ContainerParams_Volume <LambdaVolumeMount[]>
The list of volumes that the container can access.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_LinuxProcessParams_ContainerParams_Volumes
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-InlineRecipe <Byte[]>
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 inlineRecipe or lambdaFunction.The cmdlet will automatically convert the supplied parameter of type string, string[], System.IO.FileInfo or System.IO.Stream to byte[] before supplying it to the service.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LambdaFunction_ComponentDependency <Hashtable>
The component versions on which this Lambda function component depends.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentDependencies
-LambdaFunction_ComponentName <String>
The name of the component.Defaults to the name of the Lambda function.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LambdaFunction_ComponentPlatform <ComponentPlatform[]>
The platforms that the component version supports.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentPlatforms
-LambdaFunction_ComponentVersion <String>
The version of the component.Defaults to the version of the Lambda function as a semantic version. For example, if your function version is 3, the component version becomes 3.0.0.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LambdaFunction_LambdaArn <String>
The ARN of the Lambda function. The ARN must include the version of the function to import. You can't use version aliases like $LATEST.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LinuxProcessParams_IsolationMode <LambdaIsolationMode>
The isolation mode for the process that contains the Lambda function. The process can run in an isolated runtime environment inside the IoT Greengrass container, or as a regular process outside any container.Default: GreengrassContainer
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesLambdaFunction_ComponentLambdaParameters_LinuxProcessParams_IsolationMode
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is '*'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.GreengrassV2.Model.CreateComponentVersionResponse). Specifying the name of a property of type Amazon.GreengrassV2.Model.CreateComponentVersionResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Hashtable>
A list of key-value pairs that contain metadata for the resource. For more information, see Tag your resources in the IoT Greengrass V2 Developer Guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns an Amazon.GreengrassV2.Model.CreateComponentVersionResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Supported Version

AWS Tools for PowerShell: 2.x.y.z