create_component_version
async
¶
create_component_version(
*,
config_overrides: Optional[AsyncGreengrassV2ClientConfig] = None,
inline_recipe: Optional[RecipeBlob] = None,
lambda_function: Optional[LambdaFunctionRecipeSource] = None,
tags: Optional[TagMap] = None,
client_token: Optional[ClientTokenString] = None,
) -> CreateComponentVersionResponse
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
inlineRecipewhen 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
lambdaFunctionwhen you call this operation.IoT Greengrass currently supports Lambda functions on only Linux core devices.
Parameters:
-
inline_recipe(Optional[RecipeBlob], default:None) –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. -
lambda_function(Optional[LambdaFunctionRecipeSource], default:None) –The parameters to create a component from a Lambda function.
You must specify either
inlineRecipeorlambdaFunction. -
tags(Optional[TagMap], default:None) –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.
-
client_token(Optional[ClientTokenString], default:None) –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.
Raises:
-
AccessDeniedException–You don't have permission to perform the action.
-
ConflictException–Your request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.
-
InternalServerException–IoT Greengrass can't process your request right now. Try again later.
-
RequestAlreadyInProgressException–The request is already in progress. This exception occurs when you use a client token for multiple requests while IoT Greengrass is still processing an earlier request that uses the same client token.
-
ServiceQuotaExceededException–Your request exceeds a service quota. For example, you might have the maximum number of components that you can create.
-
ThrottlingException–Your request exceeded a request rate quota. For example, you might have exceeded the amount of times that you can retrieve device or deployment status per second.
-
ValidationException–The request isn't valid. This can occur if your request contains malformed JSON or unsupported characters.
-
UnknownServiceError–The service returned an error code this client does not model.