Class CfnComponentVersion
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::GreengrassV2::ComponentVersion.
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 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.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.greengrassv2.*;
CfnComponentVersion cfnComponentVersion = CfnComponentVersion.Builder.create(this, "MyCfnComponentVersion")
.inlineRecipe("inlineRecipe")
.lambdaFunction(LambdaFunctionRecipeSourceProperty.builder()
.componentDependencies(Map.of(
"componentDependenciesKey", ComponentDependencyRequirementProperty.builder()
.dependencyType("dependencyType")
.versionRequirement("versionRequirement")
.build()))
.componentLambdaParameters(LambdaExecutionParametersProperty.builder()
.environmentVariables(Map.of(
"environmentVariablesKey", "environmentVariables"))
.eventSources(List.of(LambdaEventSourceProperty.builder()
.topic("topic")
.type("type")
.build()))
.execArgs(List.of("execArgs"))
.inputPayloadEncodingType("inputPayloadEncodingType")
.linuxProcessParams(LambdaLinuxProcessParamsProperty.builder()
.containerParams(LambdaContainerParamsProperty.builder()
.devices(List.of(LambdaDeviceMountProperty.builder()
.addGroupOwner(false)
.path("path")
.permission("permission")
.build()))
.memorySizeInKb(123)
.mountRoSysfs(false)
.volumes(List.of(LambdaVolumeMountProperty.builder()
.addGroupOwner(false)
.destinationPath("destinationPath")
.permission("permission")
.sourcePath("sourcePath")
.build()))
.build())
.isolationMode("isolationMode")
.build())
.maxIdleTimeInSeconds(123)
.maxInstancesCount(123)
.maxQueueSize(123)
.pinned(false)
.statusTimeoutInSeconds(123)
.timeoutInSeconds(123)
.build())
.componentName("componentName")
.componentPlatforms(List.of(ComponentPlatformProperty.builder()
.attributes(Map.of(
"attributesKey", "attributes"))
.name("name")
.build()))
.componentVersion("componentVersion")
.lambdaArn("lambdaArn")
.build())
.tags(Map.of(
"tagsKey", "tags"))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnComponentVersion.static interfaceContains information about a component dependency for a Lambda function component.static interfaceContains information about a platform that a component supports.static interfaceContains information about a container in which AWS Lambda functions run on AWS IoT Greengrass core devices.static interfaceContains information about a device that Linux processes in a container can access.static interfaceContains information about an event source for an AWS Lambda function.static interfaceContains parameters for a Lambda function that runs on AWS IoT Greengrass .static interfaceContains information about an AWS Lambda function to import to create a component.static interfaceContains parameters for a Linux process that contains an AWS Lambda function.static interfaceContains information about a volume that Linux processes in a container can access.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnComponentVersion(Construct scope, String id) Create a newAWS::GreengrassV2::ComponentVersion.CfnComponentVersion(Construct scope, String id, CfnComponentVersionProps props) Create a newAWS::GreengrassV2::ComponentVersion.protectedCfnComponentVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnComponentVersion(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the component version.The name of the component.The version of the component.The recipe to use to create the component.The parameters to create a component from a Lambda function.getTags()Application-specific metadata to attach to the component version.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetInlineRecipe(String value) The recipe to use to create the component.voidsetLambdaFunction(IResolvable value) The parameters to create a component from a Lambda function.voidThe parameters to create a component from a Lambda function.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnComponentVersion
protected CfnComponentVersion(software.amazon.jsii.JsiiObjectRef objRef) -
CfnComponentVersion
protected CfnComponentVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnComponentVersion
@Stability(Stable) public CfnComponentVersion(@NotNull Construct scope, @NotNull String id, @Nullable CfnComponentVersionProps props) Create a newAWS::GreengrassV2::ComponentVersion.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
CfnComponentVersion
Create a newAWS::GreengrassV2::ComponentVersion.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN of the component version. -
getAttrComponentName
The name of the component. -
getAttrComponentVersion
The version of the component. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
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
Jsonproperty type is processed as a map of key-value pairs. It uses the following format, which is different from mostTagsimplementations in AWS CloudFormation templates."Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value" } -
getInlineRecipe
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. -
setInlineRecipe
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. -
getLambdaFunction
The parameters to create a component from a Lambda function.You must specify either
InlineRecipeorLambdaFunction. -
setLambdaFunction
@Stability(Stable) public void setLambdaFunction(@Nullable CfnComponentVersion.LambdaFunctionRecipeSourceProperty value) The parameters to create a component from a Lambda function.You must specify either
InlineRecipeorLambdaFunction. -
setLambdaFunction
The parameters to create a component from a Lambda function.You must specify either
InlineRecipeorLambdaFunction.
-