@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:36.442Z") public class CfnComponentVersion extends CfnResource implements IInspectable
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 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.7
python3.7
python3.8
java8
nodejs10.x
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();
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 AWS IoT 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.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnComponentVersion(Construct scope,
java.lang.String id)
Create a new `AWS::GreengrassV2::ComponentVersion`.
|
|
CfnComponentVersion(Construct scope,
java.lang.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 |
---|---|
java.lang.String |
getAttrArn()
The ARN of the component version.
|
java.lang.String |
getAttrComponentName()
The name of the component.
|
java.lang.String |
getAttrComponentVersion()
The version of the component.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getInlineRecipe()
The recipe to use to create the component.
|
java.lang.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 java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setInlineRecipe(java.lang.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, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnComponentVersion(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnComponentVersion(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnComponentVersion(Construct scope, java.lang.String id, 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.public CfnComponentVersion(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrArn()
public java.lang.String getAttrComponentName()
public java.lang.String getAttrComponentVersion()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
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" }
public java.lang.String getInlineRecipe()
The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either InlineRecipe
or LambdaFunction
.
public void setInlineRecipe(java.lang.String value)
The recipe defines the component's metadata, parameters, dependencies, lifecycle, artifacts, and platform compatibility.
You must specify either InlineRecipe
or LambdaFunction
.
public java.lang.Object getLambdaFunction()
You must specify either InlineRecipe
or LambdaFunction
.
public void setLambdaFunction(CfnComponentVersion.LambdaFunctionRecipeSourceProperty value)
You must specify either InlineRecipe
or LambdaFunction
.
public void setLambdaFunction(IResolvable value)
You must specify either InlineRecipe
or LambdaFunction
.