AWS::Greengrass::CoreDefinition - AWS CloudFormation


The AWS::Greengrass::CoreDefinition resource represents a core definition for AWS IoT Greengrass. Core definitions are used to organize your core definition versions.

Core definitions can reference multiple core definition versions. All core definition versions must be associated with a core definition. Each core definition version can contain one Greengrass core.


When you create a core definition, you can optionally include an initial core definition version. To associate a core definition version later, create an AWS::Greengrass::CoreDefinitionVersion resource and specify the ID of this core definition.

After you create the core definition version that contains the core 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::CoreDefinition", "Properties" : { "InitialVersion" : CoreDefinitionVersion, "Name" : String, "Tags" : [ Tag, ... ] } }


Type: AWS::Greengrass::CoreDefinition Properties: InitialVersion: CoreDefinitionVersion Name: String Tags: - Tag



The core definition version to include when the core definition is created. Currently, a core definition version can contain only one core.


To associate a core definition version after the core definition is created, create an AWS::Greengrass::CoreDefinitionVersion resource and specify the ID of this core definition.

Required: No

Type: CoreDefinitionVersion

Update requires: Replacement


The name of the core definition.

Required: Yes

Type: String

Update requires: No interruption


Application-specific metadata to attach to the core definition. 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 Tagging Your AWS IoT Greengrass Resources in the AWS IoT Greengrass Version 1 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" }

Required: No

Type: Array of Tag

Update requires: No interruption

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the ID of the core definition, such as 1234a5b6-78cd-901e-2fgh-3i45j6k178l9.

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


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The Amazon Resource Name (ARN) of the CoreDefinition, such as arn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/cores/1234a5b6-78cd-901e-2fgh-3i45j6k178l9.


The ID of the CoreDefinition, such as 1234a5b6-78cd-901e-2fgh-3i45j6k178l9.


The ARN of the last CoreDefinitionVersion that was added to the CoreDefinition, such as arn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/cores/1234a5b6-78cd-901e-2fgh-3i45j6k178l9/versions/9876ac30-4bdb-4f9d-95af-b5fdb66be1a2.


The name of the CoreDefinition, such as MyCoreDefinition.


Create a Core Definition

The following example creates a core definition that specifies an initial version that contains a core.

The template uses the Ref function to return the ID of the core definition for the CoreDefinitionId property, which associates the version with the core definition. The template uses parameters to represent the core definition name and the ID, thing ARN, and certificate ARN to use for the core. It also outputs the ID of the new core definition.

For another template example, see the AWS::Greengrass::Group resource.


{ "Description": "Create CoreDefinition with InitialVersion", "Parameters": { "CoreDefinitionName": { "Type": "String", "Default": "TestCoreDefinition" }, "CoreId": { "Type": "String", "Default": "TestCoreId" }, "CoreThingArn": { "Type": "String", "Default": "TestCoreThingArn" }, "CoreCertificateArn": { "Type": "String", "Default": "TestCoreCertArn" } }, "Resources": { "CoreDefinition": { "Type": "AWS::Greengrass::CoreDefinition", "Properties": { "Name": { "Ref": "CoreDefinitionName" }, "InitialVersion": { "Cores": [ { "Id": { "Ref": "CoreId" }, "ThingArn": { "Ref": "CoreThingArn" }, "CertificateArn": { "Ref": "CoreCertificateArn" }, "SyncShadow": "true" } ] } } } }, "Outputs": { "CoreDefinitionId": { "Value": { "Ref": "CoreDefinition" } } } }


Description: Create CoreDefinition with InitialVersion Parameters: CoreDefinitionName: Type: String Default: TestCoreDefinition CoreId: Type: String Default: TestCoreId CoreThingArn: Type: String Default: TestCoreThingArn CoreCertificateArn: Type: String Default: TestCoreCertArn Resources: CoreDefinition: Type: 'AWS::Greengrass::CoreDefinition' Properties: Name: !Ref CoreDefinitionName InitialVersion: Cores: - Id: !Ref CoreId ThingArn: !Ref CoreThingArn CertificateArn: !Ref CoreCertificateArn SyncShadow: 'true' Outputs: CoreDefinitionId: Value: !Ref CoreDefinition

See also