@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:39.667Z") @Stability(value=Stable) public class CfnComponentVersion extends CfnResource implements IInspectable
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 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 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:
python2.7python3.7python3.8java8nodejs10.xnodejs12.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();
| Modifier and Type | Class and Description |
|---|---|
static class |
CfnComponentVersion.Builder
A fluent builder for
CfnComponentVersion. |
static interface |
CfnComponentVersion.ComponentDependencyRequirementProperty
Contains information about a component dependency for a Lambda function component.
|
static interface |
CfnComponentVersion.ComponentPlatformProperty
Contains information about a platform that a component supports.
|
static interface |
CfnComponentVersion.LambdaContainerParamsProperty
Contains information about a container in which AWS Lambda functions run on Greengrass core devices.
|
static interface |
CfnComponentVersion.LambdaDeviceMountProperty
Contains information about a device that Linux processes in a container can access.
|
static interface |
CfnComponentVersion.LambdaEventSourceProperty
Contains information about an event source for an AWS Lambda function.
|
static interface |
CfnComponentVersion.LambdaExecutionParametersProperty
Contains parameters for a Lambda function that runs on AWS IoT Greengrass .
|
static interface |
CfnComponentVersion.LambdaFunctionRecipeSourceProperty
Contains information about an AWS Lambda function to import to create a component.
|
static interface |
CfnComponentVersion.LambdaLinuxProcessParamsProperty
Contains parameters for a Linux process that contains an AWS Lambda function.
|
static interface |
CfnComponentVersion.LambdaVolumeMountProperty
Contains information about a volume that Linux processes in a container can access.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnComponentVersion(software.constructs.Construct scope,
String id)
Create a new `AWS::GreengrassV2::ComponentVersion`.
|
|
CfnComponentVersion(software.constructs.Construct scope,
String id,
CfnComponentVersionProps props)
Create a new `AWS::GreengrassV2::ComponentVersion`.
|
protected |
CfnComponentVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnComponentVersion(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrArn()
The ARN of the component version.
|
String |
getAttrComponentName()
The name of the component.
|
String |
getAttrComponentVersion()
The version of the component.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getInlineRecipe()
The recipe to use to create the component.
|
Object |
getLambdaFunction()
The parameters to create a component from a Lambda function.
|
TagManager |
getTags()
Application-specific metadata to attach to the component version.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setInlineRecipe(String value)
The recipe to use to create the component.
|
void |
setLambdaFunction(CfnComponentVersion.LambdaFunctionRecipeSourceProperty value)
The parameters to create a component from a Lambda function.
|
void |
setLambdaFunction(IResolvable value)
The parameters to create a component from a Lambda function.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnComponentVersion(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnComponentVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnComponentVersion(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
CfnComponentVersionProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties.@Stability(value=Stable)
public CfnComponentVersion(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrArn()
@Stability(value=Stable) @NotNull public String getAttrComponentName()
@Stability(value=Stable) @NotNull public String getAttrComponentVersion()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
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 most Tags implementations in AWS CloudFormation templates.
"Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value"
}
@Stability(value=Stable) @Nullable public String getInlineRecipe()
The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either InlineRecipe or LambdaFunction .
@Stability(value=Stable)
public void setInlineRecipe(@Nullable
String value)
The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either InlineRecipe or LambdaFunction .
@Stability(value=Stable) @Nullable public Object getLambdaFunction()
You must specify either InlineRecipe or LambdaFunction .
@Stability(value=Stable)
public void setLambdaFunction(@Nullable
CfnComponentVersion.LambdaFunctionRecipeSourceProperty value)
You must specify either InlineRecipe or LambdaFunction .
@Stability(value=Stable)
public void setLambdaFunction(@Nullable
IResolvable value)
You must specify either InlineRecipe or LambdaFunction .
Copyright © 2022. All rights reserved.