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. 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
, "Tags" :[
} }Tag
, ... ]
YAML
Type: AWS::Greengrass::LoggerDefinition Properties: InitialVersion:
LoggerDefinitionVersion
Name:String
Tags:-
Tag
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
-
Application-specific metadata to attach to the logger 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 mostTags
implementations in AWS CloudFormation templates."Tags": { "KeyName0": "value", "KeyName1": "value", "KeyName2": "value" }
Required: No
Type: Array of
Tag
Update requires: No interruption
Return values
Ref
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
.
Fn::GetAtt
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
.
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
LoggerDefinitionVersion
that 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 AWS IoT Greengrass Version 1 API Reference