Skip to content

aws.cloudwatchlogs-log-group resource

Description

LogGroup is a CloudWatch Logs log group: the container that holds log streams and sets their retention and encryption. The name and the log group class are fixed when the group is created, so a change to either replaces the group. The retention period, the KMS key, deletion protection, and the tags are reconciled in place. Retention and the KMS key have no setting on the create call: retention is applied afterward by PutRetentionPolicy (or cleared by DeleteRetentionPolicy), and the KMS key, while it does ride the create call, is changed afterward by AssociateKmsKey or DisassociateKmsKey.

Source: internal/service/cloudwatchlogs/log_group_rsrc.go:54

Example usage:

imports: {
  aws: 'github.com/cloudboss/unobin-library-aws'
}

resources: {
  example: aws.cloudwatchlogs-log-group {
    # Set input fields here.
  }
}

Inputs

name

string

required

Name is the log group name. It must hold only letters, digits, underscore, hyphen, forward slash, period, or the hash sign, and be no longer than 512 characters. The name is the group's identity, fixed at create time.

log-group-class

optional(string)

retention-in-days

optional(integer)

kms-key-id

optional(string)

deletion-protection-enabled

optional(boolean)

tags

map(string)

Input Constraints

Retention in days rules

retention-in-days must be a valid CloudWatch Logs retention value.

Rule logic
When
input.retention-in-days != null
Require
input.retention-in-days == 0
|| input.retention-in-days == 1
|| input.retention-in-days == 3
|| input.retention-in-days == 5
|| input.retention-in-days == 7
|| input.retention-in-days == 14
|| input.retention-in-days == 30
|| input.retention-in-days == 60
|| input.retention-in-days == 90
|| input.retention-in-days == 120
|| input.retention-in-days == 150
|| input.retention-in-days == 180
|| input.retention-in-days == 365
|| input.retention-in-days == 400
|| input.retention-in-days == 545
|| input.retention-in-days == 731
|| input.retention-in-days == 1096
|| input.retention-in-days == 1827
|| input.retention-in-days == 2192
|| input.retention-in-days == 2557
|| input.retention-in-days == 2922
|| input.retention-in-days == 3288
|| input.retention-in-days == 3653

Log group class rules

log-group-class must be STANDARD, INFREQUENT_ACCESS, or DELIVERY.

Rule logic
When
input.log-group-class != null
Require
input.log-group-class == 'STANDARD'
|| input.log-group-class == 'INFREQUENT_ACCESS'
|| input.log-group-class == 'DELIVERY'

Outputs

arn

string