CfnComponentVersion
- class aws_cdk.aws_greengrassv2.CfnComponentVersion(scope, id, *, inline_recipe=None, lambda_function=None, tags=None)
Bases:
CfnResource
Creates a component.
Components are software that run on AWS 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 AWS 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 AWS IoT Greengrass component recipe reference in the AWS 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 AWS Lambda function that runs on AWS 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 AWS IoT Greengrass V1 to AWS IoT Greengrass V2 .
This function accepts Lambda functions in all supported versions of Python, Node.js, and Java runtimes. AWS 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.- See:
- CloudformationResource:
AWS::GreengrassV2::ComponentVersion
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 cfn_component_version = greengrassv2.CfnComponentVersion(self, "MyCfnComponentVersion", inline_recipe="inlineRecipe", lambda_function=greengrassv2.CfnComponentVersion.LambdaFunctionRecipeSourceProperty( component_dependencies={ "component_dependencies_key": greengrassv2.CfnComponentVersion.ComponentDependencyRequirementProperty( dependency_type="dependencyType", version_requirement="versionRequirement" ) }, component_lambda_parameters=greengrassv2.CfnComponentVersion.LambdaExecutionParametersProperty( environment_variables={ "environment_variables_key": "environmentVariables" }, event_sources=[greengrassv2.CfnComponentVersion.LambdaEventSourceProperty( topic="topic", type="type" )], exec_args=["execArgs"], input_payload_encoding_type="inputPayloadEncodingType", linux_process_params=greengrassv2.CfnComponentVersion.LambdaLinuxProcessParamsProperty( container_params=greengrassv2.CfnComponentVersion.LambdaContainerParamsProperty( devices=[greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )], memory_size_in_kb=123, mount_ro_sysfs=False, volumes=[greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )] ), isolation_mode="isolationMode" ), max_idle_time_in_seconds=123, max_instances_count=123, max_queue_size=123, pinned=False, status_timeout_in_seconds=123, timeout_in_seconds=123 ), component_name="componentName", component_platforms=[greengrassv2.CfnComponentVersion.ComponentPlatformProperty( attributes={ "attributes_key": "attributes" }, name="name" )], component_version="componentVersion", lambda_arn="lambdaArn" ), tags={ "tags_key": "tags" } )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).inline_recipe (
Optional
[str
]) – 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 eitherInlineRecipe
orLambdaFunction
.lambda_function (
Union
[IResolvable
,LambdaFunctionRecipeSourceProperty
,Dict
[str
,Any
],None
]) – The parameters to create a component from a Lambda function. You must specify eitherInlineRecipe
orLambdaFunction
.tags (
Optional
[Mapping
[str
,str
]]) – Application-specific metadata to attach to the component version. You can use tags in IAM policies to control access to AWS IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see Tag your AWS IoT Greengrass Version 2 resources in the AWS IoT Greengrass V2 Developer Guide . ThisJson
property type is processed as a map of key-value pairs. It uses the following format, which is different from mostTags
implementations in AWS CloudFormation templates:: “Tags”: { “KeyName0”: “value”, “KeyName1”: “value”, “KeyName2”: “value” }
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::GreengrassV2::ComponentVersion'
- attr_arn
The ARN of the component version.
- CloudformationAttribute:
Arn
- attr_component_name
The name of the component.
- CloudformationAttribute:
ComponentName
- attr_component_version
The version of the component.
- CloudformationAttribute:
ComponentVersion
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- inline_recipe
The recipe to use to create the component.
- lambda_function
The parameters to create a component from a Lambda function.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- node
The tree node.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
Application-specific metadata to attach to the component version.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
ComponentDependencyRequirementProperty
- class CfnComponentVersion.ComponentDependencyRequirementProperty(*, dependency_type=None, version_requirement=None)
Bases:
object
Contains information about a component dependency for a Lambda function component.
- Parameters:
dependency_type (
Optional
[str
]) – The type of this dependency. Choose from the following options:. -SOFT
– The component doesn’t restart if the dependency changes state. -HARD
– The component restarts if the dependency changes state. Default:HARD
version_requirement (
Optional
[str
]) – The component version requirement for the component dependency. AWS IoT Greengrass uses semantic version constraints. For more information, see Semantic Versioning .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 component_dependency_requirement_property = greengrassv2.CfnComponentVersion.ComponentDependencyRequirementProperty( dependency_type="dependencyType", version_requirement="versionRequirement" )
Attributes
- dependency_type
.
SOFT
– The component doesn’t restart if the dependency changes state.HARD
– The component restarts if the dependency changes state.
Default:
HARD
- See:
- Type:
The type of this dependency. Choose from the following options
- version_requirement
The component version requirement for the component dependency.
AWS IoT Greengrass uses semantic version constraints. For more information, see Semantic Versioning .
ComponentPlatformProperty
- class CfnComponentVersion.ComponentPlatformProperty(*, attributes=None, name=None)
Bases:
object
Contains information about a platform that a component supports.
- Parameters:
attributes (
Union
[Mapping
[str
,str
],IResolvable
,None
]) – A dictionary of attributes for the platform. The AWS IoT Greengrass Core software defines theos
andplatform
by default. You can specify additional platform attributes for a core device when you deploy the AWS IoT Greengrass nucleus component. For more information, see the AWS IoT Greengrass nucleus component in the AWS IoT Greengrass V2 Developer Guide .name (
Optional
[str
]) – The friendly name of the platform. This name helps you identify the platform. If you omit this parameter, AWS IoT Greengrass creates a friendly name from theos
andarchitecture
of the platform.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 component_platform_property = greengrassv2.CfnComponentVersion.ComponentPlatformProperty( attributes={ "attributes_key": "attributes" }, name="name" )
Attributes
- attributes
A dictionary of attributes for the platform.
The AWS IoT Greengrass Core software defines the
os
andplatform
by default. You can specify additional platform attributes for a core device when you deploy the AWS IoT Greengrass nucleus component. For more information, see the AWS IoT Greengrass nucleus component in the AWS IoT Greengrass V2 Developer Guide .
- name
The friendly name of the platform. This name helps you identify the platform.
If you omit this parameter, AWS IoT Greengrass creates a friendly name from the
os
andarchitecture
of the platform.
LambdaContainerParamsProperty
- class CfnComponentVersion.LambdaContainerParamsProperty(*, devices=None, memory_size_in_kb=None, mount_ro_sysfs=None, volumes=None)
Bases:
object
Contains information about a container in which AWS Lambda functions run on AWS IoT Greengrass core devices.
- Parameters:
devices (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaDeviceMountProperty
,Dict
[str
,Any
]]],None
]) – The list of system devices that the container can access.memory_size_in_kb (
Union
[int
,float
,None
]) – The memory size of the container, expressed in kilobytes. Default:16384
(16 MB)mount_ro_sysfs (
Union
[bool
,IResolvable
,None
]) – Whether or not the container can read information from the device’s/sys
folder. Default:false
volumes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaVolumeMountProperty
,Dict
[str
,Any
]]],None
]) – The list of volumes that the container can access.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_container_params_property = greengrassv2.CfnComponentVersion.LambdaContainerParamsProperty( devices=[greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )], memory_size_in_kb=123, mount_ro_sysfs=False, volumes=[greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )] )
Attributes
- devices
The list of system devices that the container can access.
- memory_size_in_kb
The memory size of the container, expressed in kilobytes.
Default:
16384
(16 MB)
- mount_ro_sysfs
Whether or not the container can read information from the device’s
/sys
folder.Default:
false
- volumes
The list of volumes that the container can access.
LambdaDeviceMountProperty
- class CfnComponentVersion.LambdaDeviceMountProperty(*, add_group_owner=None, path=None, permission=None)
Bases:
object
Contains information about a device that Linux processes in a container can access.
- Parameters:
add_group_owner (
Union
[bool
,IResolvable
,None
]) – Whether or not to add the component’s system user as an owner of the device. Default:false
path (
Optional
[str
]) – The mount path for the device in the file system.permission (
Optional
[str
]) – The permission to access the device: read/only (ro
) or read/write (rw
). Default:ro
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_device_mount_property = greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )
Attributes
- add_group_owner
Whether or not to add the component’s system user as an owner of the device.
Default:
false
- path
The mount path for the device in the file system.
- permission
read/only (
ro
) or read/write (rw
).Default:
ro
LambdaEventSourceProperty
- class CfnComponentVersion.LambdaEventSourceProperty(*, topic=None, type=None)
Bases:
object
Contains information about an event source for an AWS Lambda function.
The event source defines the topics on which this Lambda function subscribes to receive messages that run the function.
- Parameters:
topic (
Optional
[str
]) – The topic to which to subscribe to receive event messages.type (
Optional
[str
]) – The type of event source. Choose from the following options:. -PUB_SUB
– Subscribe to local publish/subscribe messages. This event source type doesn’t support MQTT wildcards (+
and#
) in the event source topic. -IOT_CORE
– Subscribe to AWS IoT Core MQTT messages. This event source type supports MQTT wildcards (+
and#
) in the event source topic.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_event_source_property = greengrassv2.CfnComponentVersion.LambdaEventSourceProperty( topic="topic", type="type" )
Attributes
- topic
The topic to which to subscribe to receive event messages.
- type
.
PUB_SUB
– Subscribe to local publish/subscribe messages. This event source type doesn’t support MQTT wildcards (+
and#
) in the event source topic.IOT_CORE
– Subscribe to AWS IoT Core MQTT messages. This event source type supports MQTT wildcards (+
and#
) in the event source topic.
- See:
- Type:
The type of event source. Choose from the following options
LambdaExecutionParametersProperty
- class CfnComponentVersion.LambdaExecutionParametersProperty(*, environment_variables=None, event_sources=None, exec_args=None, input_payload_encoding_type=None, linux_process_params=None, max_idle_time_in_seconds=None, max_instances_count=None, max_queue_size=None, pinned=None, status_timeout_in_seconds=None, timeout_in_seconds=None)
Bases:
object
Contains parameters for a Lambda function that runs on AWS IoT Greengrass .
- Parameters:
environment_variables (
Union
[Mapping
[str
,str
],IResolvable
,None
]) – The map of environment variables that are available to the Lambda function when it runs.event_sources (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaEventSourceProperty
,Dict
[str
,Any
]]],None
]) – 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 AWS IoT Core MQTT messages.exec_args (
Optional
[Sequence
[str
]]) – The list of arguments to pass to the Lambda function when it runs.input_payload_encoding_type (
Optional
[str
]) – The encoding type that the Lambda function supports. Default:json
linux_process_params (
Union
[IResolvable
,LambdaLinuxProcessParamsProperty
,Dict
[str
,Any
],None
]) – The parameters for the Linux process that contains the Lambda function.max_idle_time_in_seconds (
Union
[int
,float
,None
]) – The maximum amount of time in seconds that a non-pinned Lambda function can idle before the AWS IoT Greengrass Core software stops its process.max_instances_count (
Union
[int
,float
,None
]) – The maximum number of instances that a non-pinned Lambda function can run at the same time.max_queue_size (
Union
[int
,float
,None
]) – The maximum size of the message queue for the Lambda function component. The AWS IoT Greengrass core device stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message.pinned (
Union
[bool
,IResolvable
,None
]) – Whether or not the Lambda function is pinned, or long-lived. - A pinned Lambda function starts when the AWS IoT Greengrass Core 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 formaxIdleTimeInSeconds
. If the function has multiple work items, the AWS IoT Greengrass Core software creates multiple instances of the function. Default:true
status_timeout_in_seconds (
Union
[int
,float
,None
]) – The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.timeout_in_seconds (
Union
[int
,float
,None
]) – The maximum amount of time in seconds that the Lambda function can process a work item.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_execution_parameters_property = greengrassv2.CfnComponentVersion.LambdaExecutionParametersProperty( environment_variables={ "environment_variables_key": "environmentVariables" }, event_sources=[greengrassv2.CfnComponentVersion.LambdaEventSourceProperty( topic="topic", type="type" )], exec_args=["execArgs"], input_payload_encoding_type="inputPayloadEncodingType", linux_process_params=greengrassv2.CfnComponentVersion.LambdaLinuxProcessParamsProperty( container_params=greengrassv2.CfnComponentVersion.LambdaContainerParamsProperty( devices=[greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )], memory_size_in_kb=123, mount_ro_sysfs=False, volumes=[greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )] ), isolation_mode="isolationMode" ), max_idle_time_in_seconds=123, max_instances_count=123, max_queue_size=123, pinned=False, status_timeout_in_seconds=123, timeout_in_seconds=123 )
Attributes
- environment_variables
The map of environment variables that are available to the Lambda function when it runs.
- event_sources
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 AWS IoT Core MQTT messages.
- exec_args
The list of arguments to pass to the Lambda function when it runs.
- input_payload_encoding_type
The encoding type that the Lambda function supports.
Default:
json
- linux_process_params
The parameters for the Linux process that contains the Lambda function.
- max_idle_time_in_seconds
The maximum amount of time in seconds that a non-pinned Lambda function can idle before the AWS IoT Greengrass Core software stops its process.
- max_instances_count
The maximum number of instances that a non-pinned Lambda function can run at the same time.
- max_queue_size
The maximum size of the message queue for the Lambda function component.
The AWS IoT Greengrass core device stores messages in a FIFO (first-in-first-out) queue until it can run the Lambda function to consume each message.
- pinned
Whether or not the Lambda function is pinned, or long-lived.
A pinned Lambda function starts when the AWS IoT Greengrass Core 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 AWS IoT Greengrass Core software creates multiple instances of the function.
Default:
true
- status_timeout_in_seconds
The interval in seconds at which a pinned (also known as long-lived) Lambda function component sends status updates to the Lambda manager component.
- timeout_in_seconds
The maximum amount of time in seconds that the Lambda function can process a work item.
LambdaFunctionRecipeSourceProperty
- class CfnComponentVersion.LambdaFunctionRecipeSourceProperty(*, component_dependencies=None, component_lambda_parameters=None, component_name=None, component_platforms=None, component_version=None, lambda_arn=None)
Bases:
object
Contains information about an AWS Lambda function to import to create a component.
- Parameters:
component_dependencies (
Union
[IResolvable
,Mapping
[str
,Union
[IResolvable
,ComponentDependencyRequirementProperty
,Dict
[str
,Any
]]],None
]) – The component versions on which this Lambda function component depends.component_lambda_parameters (
Union
[IResolvable
,LambdaExecutionParametersProperty
,Dict
[str
,Any
],None
]) – The system and runtime parameters for the Lambda function as it runs on the AWS IoT Greengrass core device.component_name (
Optional
[str
]) – The name of the component. Defaults to the name of the Lambda function.component_platforms (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ComponentPlatformProperty
,Dict
[str
,Any
]]],None
]) – The platforms that the component version supports.component_version (
Optional
[str
]) – The version of the component. Defaults to the version of the Lambda function as a semantic version. For example, if your function version is3
, the component version becomes3.0.0
.lambda_arn (
Optional
[str
]) – 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
.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_function_recipe_source_property = greengrassv2.CfnComponentVersion.LambdaFunctionRecipeSourceProperty( component_dependencies={ "component_dependencies_key": greengrassv2.CfnComponentVersion.ComponentDependencyRequirementProperty( dependency_type="dependencyType", version_requirement="versionRequirement" ) }, component_lambda_parameters=greengrassv2.CfnComponentVersion.LambdaExecutionParametersProperty( environment_variables={ "environment_variables_key": "environmentVariables" }, event_sources=[greengrassv2.CfnComponentVersion.LambdaEventSourceProperty( topic="topic", type="type" )], exec_args=["execArgs"], input_payload_encoding_type="inputPayloadEncodingType", linux_process_params=greengrassv2.CfnComponentVersion.LambdaLinuxProcessParamsProperty( container_params=greengrassv2.CfnComponentVersion.LambdaContainerParamsProperty( devices=[greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )], memory_size_in_kb=123, mount_ro_sysfs=False, volumes=[greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )] ), isolation_mode="isolationMode" ), max_idle_time_in_seconds=123, max_instances_count=123, max_queue_size=123, pinned=False, status_timeout_in_seconds=123, timeout_in_seconds=123 ), component_name="componentName", component_platforms=[greengrassv2.CfnComponentVersion.ComponentPlatformProperty( attributes={ "attributes_key": "attributes" }, name="name" )], component_version="componentVersion", lambda_arn="lambdaArn" )
Attributes
- component_dependencies
The component versions on which this Lambda function component depends.
- component_lambda_parameters
The system and runtime parameters for the Lambda function as it runs on the AWS IoT Greengrass core device.
- component_name
The name of the component.
Defaults to the name of the Lambda function.
- component_platforms
The platforms that the component version supports.
- component_version
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 becomes3.0.0
.
- lambda_arn
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
.
LambdaLinuxProcessParamsProperty
- class CfnComponentVersion.LambdaLinuxProcessParamsProperty(*, container_params=None, isolation_mode=None)
Bases:
object
Contains parameters for a Linux process that contains an AWS Lambda function.
- Parameters:
container_params (
Union
[IResolvable
,LambdaContainerParamsProperty
,Dict
[str
,Any
],None
]) – The parameters for the container in which the Lambda function runs.isolation_mode (
Optional
[str
]) – The isolation mode for the process that contains the Lambda function. The process can run in an isolated runtime environment inside the AWS IoT Greengrass container, or as a regular process outside any container. Default:GreengrassContainer
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_linux_process_params_property = greengrassv2.CfnComponentVersion.LambdaLinuxProcessParamsProperty( container_params=greengrassv2.CfnComponentVersion.LambdaContainerParamsProperty( devices=[greengrassv2.CfnComponentVersion.LambdaDeviceMountProperty( add_group_owner=False, path="path", permission="permission" )], memory_size_in_kb=123, mount_ro_sysfs=False, volumes=[greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )] ), isolation_mode="isolationMode" )
Attributes
- container_params
The parameters for the container in which the Lambda function runs.
- isolation_mode
The isolation mode for the process that contains the Lambda function.
The process can run in an isolated runtime environment inside the AWS IoT Greengrass container, or as a regular process outside any container.
Default:
GreengrassContainer
LambdaVolumeMountProperty
- class CfnComponentVersion.LambdaVolumeMountProperty(*, add_group_owner=None, destination_path=None, permission=None, source_path=None)
Bases:
object
Contains information about a volume that Linux processes in a container can access.
When you define a volume, the AWS IoT Greengrass Core software mounts the source files to the destination inside the container.
- Parameters:
add_group_owner (
Union
[bool
,IResolvable
,None
]) – Whether or not to add the AWS IoT Greengrass user group as an owner of the volume. Default:false
destination_path (
Optional
[str
]) – The path to the logical volume in the file system.permission (
Optional
[str
]) – The permission to access the volume: read/only (ro
) or read/write (rw
). Default:ro
source_path (
Optional
[str
]) – The path to the physical volume in the file system.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_greengrassv2 as greengrassv2 lambda_volume_mount_property = greengrassv2.CfnComponentVersion.LambdaVolumeMountProperty( add_group_owner=False, destination_path="destinationPath", permission="permission", source_path="sourcePath" )
Attributes
- add_group_owner
Whether or not to add the AWS IoT Greengrass user group as an owner of the volume.
Default:
false
- destination_path
The path to the logical volume in the file system.
- permission
read/only (
ro
) or read/write (rw
).Default:
ro
- source_path
The path to the physical volume in the file system.