AWS::Logs::LogStream
The AWS::Logs::LogStream resource creates an Amazon CloudWatch Logs log stream in a log
group. A log stream represents the sequence of events coming from an application instance
or
resource that you are monitoring. For more information, see Monitoring Log Files in the
Amazon CloudWatch User Guide.
Topics
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Logs::LogStream", "Properties" : { "LogGroupName" :String, "LogStreamName" :String} }
YAML
Type: AWS::Logs::LogStream Properties: LogGroupName:StringLogStreamName:String
Properties
LogGroupName-
The name of the log group where the log stream is created.
Required: Yes
Type: String
Update requires: Replacement
LogStreamName-
The name of the log stream to create. The name must be unique within the log group.
Required: No
Type: String
Update requires: Replacement
Return Values
Ref
When the logical ID of this resource is provided to the Ref
intrinsic function, Ref returns the resource name, such as
MyAppLogStream.
For more information about using the Ref function, see Ref.
Example
The following example creates a CloudWatch Logs log stream named MyAppLogStream in
the exampleLogGroup log group.
JSON
"LogStream": { "Type": "AWS::Logs::LogStream", "Properties": { "LogGroupName" : "exampleLogGroup", "LogStreamName": "MyAppLogStream" } }
YAML
LogStream: Type: AWS::Logs::LogStream Properties: LogGroupName: "exampleLogGroup" LogStreamName: "MyAppLogStream"
