Skip to content

Examples of AWS::GreengrassV2::Deployment ?

0

anyone can share an example of IoT Deployment Cloud Formation template ?, it seems that i can't deploy public component and as key i can't pass a parameter. Here the example of my Cloud Formation template that deploy Stream Manager component as key (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-greengrassv2-deployment.html)

AWSTemplateFormatVersion: '2010-09-09'
Description: 'This will create a new IoT Greengrass Deployment for a target groups/things'
Parameters:
  DeploymentName:
    Type: String
    Description: The name of the deployment
  TargetArn:
    Type: String
    Description: The ARN of the target AWS IoT thing or thing group
  NotifyToComponents:
    Type: String
    Description: If use NOTIFY_COMPONENTS The deployment notifies each component before it stops and updates that component.
    AllowedValues:
      - NOTIFY_COMPONENTS
      - SKIP_NOTIFY_COMPONENTS
  FailureHandlingPolicy:
    Type: String
    Description: The failure handling policy for the configuration deployment. This policy defines what to do if the deployment fails.
    Default: ROLLBACK
  ComponentName1:
    Type: String
    Description: The name of private or public component to deploy
  ComponentVersion1:
    Type: String
    Description: The version of private or public component to deploy
  ConfigurationToMerge1:
    Type: String
    Description: The json configuration to merge inside component conf

Resources:
  NewDeployment:
    Type: AWS::GreengrassV2::Deployment
    Properties:
      Components:
        aws.greengrass.StreamManager:
          ComponentVersion: !Ref ComponentVersion1
          ConfigurationUpdate:
            Merge: !Sub |
              '${ConfigurationToMerge1}'
            Reset: []
      TargetArn: !Ref TargetArn
      DeploymentName: !Ref DeploymentName
      DeploymentPolicies:
        FailureHandlingPolicy: !Ref FailureHandlingPolicy
        ComponentUpdatePolicy:
          TimeoutInSeconds: 5000
          Action: !Ref NotifyToComponents
        ConfigurationValidationPolicy:
          TimeoutInSeconds: 30000

Outputs:
  NewDeploymentArn:
    Value: !Sub
      - arn:${AWS::Partition}:greengrass:${AWS::Region}:${AWS::AccountId}:deployments:${DeploymentId}
      - DeploymentId: !GetAtt NewDeployment.DeploymentId
1 Answer
0

Hello,

Your template has an error under the ConfigurationUpdate.Merge key. Please use double quotes instead of the single quotes as seen in your code snippet above.

Merge: !Sub |
      "${ConfigurationToMerge1}"

If you are still unable to use CloudFormation to deploy Greengrass components, please open an AWS Support request.

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.