AWS::Greengrass::LoggerDefinition - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


The AWS::Greengrass::LoggerDefinition resource represents a logger definition for Amazon IoT Greengrass. Logger definitions are used to organize your logger definition versions.

Logger definitions can reference multiple logger definition versions. All logger definition versions must be associated with a logger definition. Each logger definition version can contain one or more loggers.


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

After you create the logger definition version that contains the loggers 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 Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::Greengrass::LoggerDefinition", "Properties" : { "InitialVersion" : LoggerDefinitionVersion, "Name" : String, "Tags" : [ Tag, ... ] } }


Type: AWS::Greengrass::LoggerDefinition Properties: InitialVersion: LoggerDefinitionVersion Name: String Tags: - Tag



The logger definition version to include when the logger definition is created. A logger definition version contains a list of logger property types.


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

Required: No

Type: LoggerDefinitionVersion

Update requires: Replacement


The name of the logger definition.

Required: Yes

Type: String

Update requires: No interruption


Application-specific metadata to attach to the logger definition. You can use tags in IAM policies to control access to Amazon IoT Greengrass resources. You can also use tags to categorize your resources. For more information, see Tagging Your Amazon IoT Greengrass Resources in the Amazon 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 Amazon 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 logger 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 LoggerDefinition, such as arn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/loggers/1234a5b6-78cd-901e-2fgh-3i45j6k178l9.


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


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


The name of the LoggerDefinition, such as MyLoggerDefinition.


Logger Definition Snippet

The following snippet defines a logger definition resource with an initial version that contains a logger.

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


"TestLoggerDefinition": { "Type": "AWS::Greengrass::LoggerDefinition", "Properties": { "Name": "DemoTestLoggerDefinition", "InitialVersion": { "Loggers": [ { "Id": "TestLogger1", "Type": "FileSystem", "Component": "GreengrassSystem", "Level": "INFO", "Space": "128" } ] } } }


TestLoggerDefinition: Type: 'AWS::Greengrass::LoggerDefinition' Properties: Name: DemoTestLoggerDefinition InitialVersion: Loggers: - Id: TestLogger1 Type: FileSystem Component: GreengrassSystem Level: INFO Space: '128'

See also