Class CfnComponentVersion

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:02.799Z") @Stability(Stable) public class CfnComponentVersion extends CfnResource implements IInspectable, ITaggable
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.

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();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 software.constructs.Construct scope, @NotNull String id, @Nullable CfnComponentVersionProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnComponentVersion

      @Stability(Stable) public CfnComponentVersion(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the component version.
    • getAttrComponentName

      @Stability(Stable) @NotNull public String getAttrComponentName()
      The name of the component.
    • getAttrComponentVersion

      @Stability(Stable) @NotNull public String getAttrComponentVersion()
      The version of the component.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getInlineRecipe

      @Stability(Stable) @Nullable public String getInlineRecipe()
      The recipe to use to create the component.
    • setInlineRecipe

      @Stability(Stable) public void setInlineRecipe(@Nullable String value)
      The recipe to use to create the component.
    • getLambdaFunction

      @Stability(Stable) @Nullable public Object getLambdaFunction()
      The parameters to create a component from a Lambda function.
    • setLambdaFunction

      @Stability(Stable) public void setLambdaFunction(@Nullable IResolvable value)
      The parameters to create a component from a Lambda function.
    • setLambdaFunction

      @Stability(Stable) public void setLambdaFunction(@Nullable CfnComponentVersion.LambdaFunctionRecipeSourceProperty value)
      The parameters to create a component from a Lambda function.
    • getTagsRaw

      @Stability(Stable) @Nullable public Map<String,String> getTagsRaw()
      Application-specific metadata to attach to the component version.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable Map<String,String> value)
      Application-specific metadata to attach to the component version.