Class CfnDeployment

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-22T22:42:52.544Z") @Stability(Stable) public class CfnDeployment extends CfnResource implements IInspectable, ITaggable
Creates a continuous deployment for a target, which is a AWS IoT Greengrass core device or group of core devices.

When you add a new core device to a group of core devices that has a deployment, AWS IoT Greengrass deploys that group's deployment to the new device.

You can define one deployment for each target. When you create a new deployment for a target that has an existing deployment, you replace the previous deployment. AWS IoT Greengrass applies the new deployment to the target devices.

You can only add, update, or delete up to 10 deployments at a time to a single target.

Every deployment has a revision number that indicates how many deployment revisions you define for a target. Use this operation to create a new revision of an existing deployment. This operation returns the revision number of the new deployment when you create it.

For more information, see the Create deployments in the AWS IoT Greengrass V2 Developer Guide .

Deployment resources are deleted when you delete stacks. To keep the deployments in a stack, you must specify "DeletionPolicy": "Retain" on each deployment resource in the stack template that you want to keep. For more information, see DeletionPolicy .

You can only delete up to 10 deployment resources at a time. If you delete more than 10 resources, you receive an error.

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.*;
 Object rateIncreaseCriteria;
 CfnDeployment cfnDeployment = CfnDeployment.Builder.create(this, "MyCfnDeployment")
         .targetArn("targetArn")
         // the properties below are optional
         .components(Map.of(
                 "componentsKey", ComponentDeploymentSpecificationProperty.builder()
                         .componentVersion("componentVersion")
                         .configurationUpdate(ComponentConfigurationUpdateProperty.builder()
                                 .merge("merge")
                                 .reset(List.of("reset"))
                                 .build())
                         .runWith(ComponentRunWithProperty.builder()
                                 .posixUser("posixUser")
                                 .systemResourceLimits(SystemResourceLimitsProperty.builder()
                                         .cpus(123)
                                         .memory(123)
                                         .build())
                                 .windowsUser("windowsUser")
                                 .build())
                         .build()))
         .deploymentName("deploymentName")
         .deploymentPolicies(DeploymentPoliciesProperty.builder()
                 .componentUpdatePolicy(DeploymentComponentUpdatePolicyProperty.builder()
                         .action("action")
                         .timeoutInSeconds(123)
                         .build())
                 .configurationValidationPolicy(DeploymentConfigurationValidationPolicyProperty.builder()
                         .timeoutInSeconds(123)
                         .build())
                 .failureHandlingPolicy("failureHandlingPolicy")
                 .build())
         .iotJobConfiguration(DeploymentIoTJobConfigurationProperty.builder()
                 .abortConfig(IoTJobAbortConfigProperty.builder()
                         .criteriaList(List.of(IoTJobAbortCriteriaProperty.builder()
                                 .action("action")
                                 .failureType("failureType")
                                 .minNumberOfExecutedThings(123)
                                 .thresholdPercentage(123)
                                 .build()))
                         .build())
                 .jobExecutionsRolloutConfig(IoTJobExecutionsRolloutConfigProperty.builder()
                         .exponentialRate(IoTJobExponentialRolloutRateProperty.builder()
                                 .baseRatePerMinute(123)
                                 .incrementFactor(123)
                                 .rateIncreaseCriteria(rateIncreaseCriteria)
                                 .build())
                         .maximumPerMinute(123)
                         .build())
                 .timeoutConfig(IoTJobTimeoutConfigProperty.builder()
                         .inProgressTimeoutInMinutes(123)
                         .build())
                 .build())
         .parentTargetArn("parentTargetArn")
         .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

    • CfnDeployment

      protected CfnDeployment(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnDeployment

      protected CfnDeployment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnDeployment

      @Stability(Stable) public CfnDeployment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnDeploymentProps 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. 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.
    • getAttrDeploymentId

      @Stability(Stable) @NotNull public String getAttrDeploymentId()
      The ID of the deployment.
    • 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
    • getTargetArn

      @Stability(Stable) @NotNull public String getTargetArn()
      The ARN of the target AWS IoT thing or thing group.
    • setTargetArn

      @Stability(Stable) public void setTargetArn(@NotNull String value)
      The ARN of the target AWS IoT thing or thing group.
    • getComponents

      @Stability(Stable) @Nullable public Object getComponents()
      The components to deploy.
    • setComponents

      @Stability(Stable) public void setComponents(@Nullable IResolvable value)
      The components to deploy.
    • setComponents

      @Stability(Stable) public void setComponents(@Nullable Map<String,Object> value)
      The components to deploy.
    • getDeploymentName

      @Stability(Stable) @Nullable public String getDeploymentName()
      The name of the deployment.
    • setDeploymentName

      @Stability(Stable) public void setDeploymentName(@Nullable String value)
      The name of the deployment.
    • getDeploymentPolicies

      @Stability(Stable) @Nullable public Object getDeploymentPolicies()
      The deployment policies for the deployment.
    • setDeploymentPolicies

      @Stability(Stable) public void setDeploymentPolicies(@Nullable IResolvable value)
      The deployment policies for the deployment.
    • setDeploymentPolicies

      @Stability(Stable) public void setDeploymentPolicies(@Nullable CfnDeployment.DeploymentPoliciesProperty value)
      The deployment policies for the deployment.
    • getIotJobConfiguration

      @Stability(Stable) @Nullable public Object getIotJobConfiguration()
      The job configuration for the deployment configuration.
    • setIotJobConfiguration

      @Stability(Stable) public void setIotJobConfiguration(@Nullable IResolvable value)
      The job configuration for the deployment configuration.
    • setIotJobConfiguration

      @Stability(Stable) public void setIotJobConfiguration(@Nullable CfnDeployment.DeploymentIoTJobConfigurationProperty value)
      The job configuration for the deployment configuration.
    • getParentTargetArn

      @Stability(Stable) @Nullable public String getParentTargetArn()
      The parent deployment's ARN for a subdeployment.
    • setParentTargetArn

      @Stability(Stable) public void setParentTargetArn(@Nullable String value)
      The parent deployment's ARN for a subdeployment.
    • getTagsRaw

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

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