AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::Greengrass::LoggerDefinition

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

Logger definitions can reference multiple logger definition versions.

A logger definition hierarchy with associated logger definition versions and loggers.

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

Note

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.

Syntax

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

JSON

{ "Type" : "AWS::Greengrass::LoggerDefinition", "Properties" : { "InitialVersion" : LoggerDefinitionVersion, "Name" : String } }

YAML

Type: "AWS::Greengrass::LoggerDefinition" Properties: InitialVersion: LoggerDefinitionVersion Name: String

Properties

InitialVersion

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

Note

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

Name

The name of the logger definition.

Required: Yes

Type: String

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of an AWS::Greengrass::LoggerDefinition resource to the intrinsic Ref function, the function returns the ID of the logger definition, such as 1234a5b6-78cd-901e-2fgh-3i45j6k178l9.

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

Fn::GetAtt

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

LatestVersionArn

The Amazon Resource Name (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.

Id

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

Arn

The ARN of the LoggerDefinition, such as arn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/loggers/1234a5b6-78cd-901e-2fgh-3i45j6k178l9.

Name

The name of the LoggerDefinition, such as MyLoggerDefinition.

For more information about using Fn::GetAtt, see Fn::GetAtt.

Examples

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 Group resource.

JSON

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

YAML

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

See Also