CfnComponentVersion¶
-
class
aws_cdk.aws_greengrassv2.
CfnComponentVersion
(scope, id, *, inline_recipe=None, lambda_function=None, tags=None)¶ Bases:
aws_cdk.core.CfnResource
A CloudFormation
AWS::GreengrassV2::ComponentVersion
.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 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 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
lambdaFunction
when you call this operation.- CloudformationResource
AWS::GreengrassV2::ComponentVersion
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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" } )
Create a new
AWS::GreengrassV2::ComponentVersion
.- Parameters
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
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
[LambdaFunctionRecipeSourceProperty
,IResolvable
,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_depends_on
(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_metadata
(key, value)¶ Add a value to the CloudFormation Resource Metadata.
- Parameters
key (
str
) –value (
Any
) –
- See
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
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.
- Return type
None
-
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 intermdediate 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
).- 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 resoure, please consult that specific resource’s documentation.
- Return type
None
-
get_att
(attribute_name)¶ 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.- Return type
-
get_metadata
(key)¶ Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters
key (
str
) –- See
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
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.
- Return type
Any
-
inspect
(inspector)¶ Examines the CloudFormation resource and discloses attributes.
- Parameters
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type
None
-
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
-
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
- Return type
str
-
attr_component_name
¶ The name of the component.
- CloudformationAttribute
ComponentName
- Return type
str
-
attr_component_version
¶ The version of the component.
- CloudformationAttribute
ComponentVersion
- Return type
str
-
cfn_options
¶ Options for this resource, such as condition, update policy etc.
- Return type
-
cfn_resource_type
¶ AWS resource type.
- Return type
str
-
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.
- Return type
List
[str
]
-
inline_recipe
¶ 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
orLambdaFunction
.
-
lambda_function
¶ The parameters to create a component from a Lambda function.
You must specify either
InlineRecipe
orLambdaFunction
.
-
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)
.- Return type
str
- Returns
the logical ID as a stringified token. This value will only get resolved during synthesis.
-
node
¶ The construct tree node associated with this construct.
- Return type
-
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 })
.- Return type
str
-
stack
¶ The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- Return type
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 .
This
Json
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" }
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
(construct)¶ Check whether the given construct is a CfnResource.
- Parameters
construct (
IConstruct
) –- Return type
bool
-
classmethod
is_construct
(x)¶ Return whether the given object is a Construct.
- Parameters
x (
Any
) –- Return type
bool
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 .
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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
- Link
- Type
The type of this dependency. Choose from the following options
- Return type
Optional
[str
]
-
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
[IResolvable
,Mapping
[str
,str
],None
]) – A dictionary of attributes for the platform. The software defines theos
andplatform
by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the 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.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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 software defines the
os
andplatform
by default. You can specify additional platform attributes for a core device when you deploy the Greengrass nucleus component. For more information, see the 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 Greengrass core devices.
- Parameters
devices (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaDeviceMountProperty
]],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
]],None
]) – The list of volumes that the container can access.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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
- Link
- Type
The permission to access the device
- Return type
Optional
[str
]
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.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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.
- Link
- Type
The type of event source. Choose from the following options
- Return type
Optional
[str
]
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
[IResolvable
,Mapping
[str
,str
],None
]) – The map of environment variables that are available to the Lambda function when it runs.event_sources (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LambdaEventSourceProperty
]],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
,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 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 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 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 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.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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.
- Link
- Return type
Union
[IResolvable
,List
[Union
[IResolvable
,LambdaEventSourceProperty
]],None
]
-
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 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 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 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 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
]],None
]) – The component versions on which this Lambda function component depends.component_lambda_parameters (
Union
[IResolvable
,LambdaExecutionParametersProperty
,None
]) – The system and runtime parameters for the Lambda function as it runs on the 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
]],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
.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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.
- Link
- Return type
Union
[IResolvable
,Mapping
[str
,Union
[IResolvable
,ComponentDependencyRequirementProperty
]],None
]
-
component_lambda_parameters
¶ The system and runtime parameters for the Lambda function as it runs on the Greengrass core device.
- Link
- Return type
Union
[IResolvable
,LambdaExecutionParametersProperty
,None
]
-
component_name
¶ The name of the component.
Defaults to the name of the Lambda function.
-
component_platforms
¶ The platforms that the component version supports.
- Link
- Return type
Union
[IResolvable
,List
[Union
[IResolvable
,ComponentPlatformProperty
]],None
]
-
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
,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
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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 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.
- Link
- ExampleMetadata
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.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
- Link
- Type
The permission to access the volume
- Return type
Optional
[str
]
-
source_path
¶ The path to the physical volume in the file system.