This is the new Amazon CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the Amazon CloudFormation User Guide.
AWS::IoT::Logging
Configure logging.
Note
If you already set the log function of Amazon IoT Core, you can't deploy the Amazon Cloud Development Kit (Amazon CDK) to change the logging settings. You can change the logging settings by either:
-
Importing the existing logging resource into your Amazon CloudFormation stack, such as with the infrastructure as code generator (IaC generator).
-
Calling
aws iot set-v2-logging-options --disable-all-logsbefore creating a new CloudFormation stack. This command disables all Amazon IoT logging. As a result, no Amazon IoT logs will be delivered to Amazon CloudWatch until you re-enable logging.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::IoT::Logging", "Properties" : { "AccountId" :String, "DefaultLogLevel" :String, "RoleArn" :String} }
YAML
Type: AWS::IoT::Logging Properties: AccountId:StringDefaultLogLevel:StringRoleArn:String
Properties
AccountId-
The account ID.
Required: Yes
Type: String
Pattern:
^[0-9]{12}$Minimum:
12Maximum:
12Update requires: Replacement
DefaultLogLevel-
The default log level. Valid Values:
DEBUG | INFO | ERROR | WARN | DISABLEDRequired: Yes
Type: String
Allowed values:
ERROR | WARN | INFO | DEBUG | DISABLEDUpdate requires: No interruption
RoleArn-
The role ARN used for the log.
Required: Yes
Type: String
Minimum:
20Maximum:
2048Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the log ID. For example:
{"Ref": "Log-12345"}