Class CfnComponentVersion

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:57.076Z") @Stability(Stable) public class CfnComponentVersion extends CfnResource implements IInspectable
A CloudFormation 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();
 
  • 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 Construct scope, @NotNull String id, @Nullable CfnComponentVersionProps props)
      Create a new AWS::GreengrassV2::ComponentVersion.

      Parameters:
      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.
    • CfnComponentVersion

      @Stability(Stable) public CfnComponentVersion(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::GreengrassV2::ComponentVersion.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      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()
      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 most Tags implementations in AWS CloudFormation templates.

       "Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value"
       }
       
    • getInlineRecipe

      @Stability(Stable) @Nullable public String 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 InlineRecipe or LambdaFunction .

    • setInlineRecipe

      @Stability(Stable) public void setInlineRecipe(@Nullable String value)
      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 or LambdaFunction .

    • getLambdaFunction

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

      You must specify either InlineRecipe or LambdaFunction .

    • setLambdaFunction

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

      You must specify either InlineRecipe or LambdaFunction .

    • setLambdaFunction

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

      You must specify either InlineRecipe or LambdaFunction .