AWS::Greengrass::LoggerDefinition
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.
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 Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Greengrass::LoggerDefinition", "Properties" : { "InitialVersion" :LoggerDefinitionVersion, "Name" :String, "Tags" :Json} }
YAML
Type: AWS::Greengrass::LoggerDefinition Properties: InitialVersion:LoggerDefinitionVersionName:StringTags:Json
Properties
InitialVersion-
The logger definition version to include when the logger definition is created. A logger definition version contains a list of
loggerproperty types.Note
To associate a logger definition version after the logger definition is created, create an
AWS::Greengrass::LoggerDefinitionVersionresource 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
Tags-
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
Jsonproperty type is processed as a map of key-value pairs. It uses the following format, which is different from mostTagsimplementations in Amazon CloudFormation templates."Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value" }Required: No
Type: Json
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Reffunction, Refreturns the
ID of the logger definition, such as
1234a5b6-78cd-901e-2fgh-3i45j6k178l9.
For more information about using the Reffunction, see Ref.
Fn::GetAtt
The Fn::GetAttintrinsic 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::GetAttintrinsic function, see Fn::GetAtt.
Arn-
The Amazon Resource Name (ARN) of the
LoggerDefinition, such asarn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/loggers/1234a5b6-78cd-901e-2fgh-3i45j6k178l9. Id-
The ID of the
LoggerDefinition, such as1234a5b6-78cd-901e-2fgh-3i45j6k178l9. LatestVersionArn-
The ARN of the last
LoggerDefinitionVersionthat was added to theLoggerDefinition, such asarn:aws:greengrass:us-east-1:123456789012:/greengrass/definition/loggers/1234a5b6-78cd-901e-2fgh-3i45j6k178l9/versions/9876ac30-4bdb-4f9d-95af-b5fdb66be1a2. Name-
The name of the
LoggerDefinition, such asMyLoggerDefinition.
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 AWS::Greengrass::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
-
CreateLoggerDefinition in the Amazon IoT Greengrass Version 1 API Reference