AWS::Greengrass::SubscriptionDefinitionVersion - AWS CloudFormation

AWS::Greengrass::SubscriptionDefinitionVersion

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

Note

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.

Syntax

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

JSON

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

YAML

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

Properties

SubscriptionDefinitionId

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

Required: Yes

Type: String

Update requires: Replacement

Subscriptions

The subscriptions in this version.

Required: Yes

Type: Array of Subscription

Update requires: Replacement

Return values

Ref

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.

Fn::GetAtt

Examples

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.

JSON

"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" } } ] } }

YAML

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