Skip to content

geekcell/terraform-aws-cloudwatch-log-group

Repository files navigation

Geek Cell GmbH

Code Quality

License GitHub release (latest tag) Release Validate Lint

Security

Infrastructure Tests

Cloud

Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests

Container

Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests

Data protection

Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests Infrastructure Tests

Terraform Cloudwatch Log Group

Terraform module which creates an AWS Cloudwatch Log group. The focus on this module lies within it's simplicity by providing default values that should make sense for most use cases.

Inputs

Name Description Type Default Required
enable_customer_managed_kms Whether to enable customer managed KMS encryption for the log group. bool false no
kms_key_id The ARN of the KMS Key to use when encrypting log data. string null no
log_streams A list of log streams to create within the log group. list(string) [] no
name The name of the log group. string n/a yes
retention_in_days Specifies the number of days you want to retain log events in the specified log group. number 30 no
skip_destroy Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state. bool false no
tags Tags to add to the AWS Cloudwatch log group. map(any) {} no

Outputs

Name Description
arn The cloudwatch log group ARN
customer_managed_key_arn The ARN of the customer KMS key used to encrypt log data if enabled.
name The cloudwatch log group name

Providers

Name Version
aws >= 4.36

Resources

  • resource.aws_cloudwatch_log_group.main (main.tf#7)
  • resource.aws_cloudwatch_log_stream.main (main.tf#17)
  • data source.aws_caller_identity.current (data.tf#1)
  • data source.aws_iam_policy_document.main (data.tf#5)
  • data source.aws_region.current (data.tf#3)

Examples

Full

module "example" {
  source = "../../"

  name = "example"
}