AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


The AWS::Greengrass::SubscriptionDefinitionVersion resource represents a subscription definition version for AWS IoT Greengrass. A subscription definition version contains a list of subscriptions.


To create a subscription definition version, you must specify the ID of the subscription definition that you want to associate with the version. For information about creating a subscription definition, see AWS::Greengrass::SubscriptionDefinition.

After you create a subscription definition version that contains the subscriptions you want to deploy, you must add it to your group version. For more information, see AWS::Greengrass::Group.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::Greengrass::SubscriptionDefinitionVersion", "Properties" : { "SubscriptionDefinitionId" : String, "Subscriptions" : [ Subscription, ... ] } }


Type: AWS::Greengrass::SubscriptionDefinitionVersion Properties: SubscriptionDefinitionId: String Subscriptions: - Subscription



The ID of the subscription definition associated with this version. This value is a GUID.

Required: Yes

Type: String

Update requires: Replacement


The subscriptions in this version.

Required: Yes

Type: List of Subscription

Update requires: Replacement

Return Values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Amazon Resource Name (ARN) of the subscription definition version, such as arn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/subscriptions/1234a5b6-78cd-901e-2fgh-3i45j6k178l9/versions/9876ac30-4bdb-4f9d-95af-b5fdb66be1a2.

For more information about using the Ref function, see Ref.


Subscription Definition Version Snippet

The following snippet defines subscription definition and subscription definition version subscriptions. The subscription definition version references the subscription definition and contains a subscription. In this example, the subscription source is an existing device in the group. The target is a function in the group that was created in another stack and is referenced using the ImportValue function.

For an example of a complete template, see the AWS::Greengrass::Group subscription.


"TestSubscriptionDefinition": { "Type": "AWS::Greengrass::SubscriptionDefinition", "Properties": { "Name": "DemoTestSubscriptionDefinition" } }, "TestSubscriptionDefinitionVersion": { "Type": "AWS::Greengrass::SubscriptionDefinitionVersion", "Properties": { "SubscriptionDefinitionId": { "Ref": "TestSubscriptionDefinition" }, "Subscriptions": [ { "Id": "TestSubscription1", "Source": { "Fn::Join": [ ":", [ "arn:aws:iot", { "Ref": "AWS::Region" }, { "Ref": "AWS::AccountId" }, "thing/TestDevice1" ] ] }, "Subject": "some/topic", "Target": { "Fn::ImportValue": "TestCanaryLambdaVersionArn" } } ] } }


TestSubscriptionDefinition: Type: 'AWS::Greengrass::SubscriptionDefinition' Properties: Name: DemoTestSubscriptionDefinition TestSubscriptionDefinitionVersion: Type: 'AWS::Greengrass::SubscriptionDefinitionVersion' Properties: SubscriptionDefinitionId: !Ref TestSubscriptionDefinition Subscriptions: - Id: TestSubscription1 Source: !Join - ':' - - 'arn:aws:iot' - !Ref 'AWS::Region' - !Ref 'AWS::AccountId' - thing/TestDevice1 Subject: some/topic Target: !ImportValue TestCanaryLambdaVersionArn

See Also