Skip to content

Instantly share code, notes, and snippets.

@wbingli
Created March 21, 2020 00:23
Show Gist options
  • Save wbingli/f725de6f7950067b250f8f35a8c7ec09 to your computer and use it in GitHub Desktop.
Save wbingli/f725de6f7950067b250f8f35a8c7ec09 to your computer and use it in GitHub Desktop.

AWS::Logs::LogGroup

Resource schema for AWS::Logs::LogGroup

Syntax

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

JSON

{
    "Type" : "AWS::Logs::LogGroup",
    "Properties" : {
        "LogGroupName" : String,
        "RetentionInDays" : Double,
        "Arn" : String
    }
}

YAML

Type: AWS::Logs::LogGroup
Properties:
    LogGroupName: String
    RetentionInDays: Double
    Arn: String

Properties

LogGroupName

The name of the log group. If you don't specify a name, AWS CloudFormation generates a unique ID for the log group.

Required: No

Type: String

Minimum: 1

Maximum: 512

Pattern: ^[.-_/#A-Za-z0-9]{1,512}\Z

Update requires: Replacement

RetentionInDays

The number of days to retain the log events in the specified log group. Possible values are: 1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, and 3653.

Required: No

Type: Double

Allowed Values: 1 | 3 | 5 | 7 | 14 | 30 | 60 | 90 | 120 | 150 | 180 | 365 | 400 | 545 | 731 | 1827 | 3653

Update requires: No interruption

Arn

The CloudWatch log group ARN.

Required: No

Type: String

Update requires: No interruption

Return Values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the LogGroupName.

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 CloudWatch log group ARN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment