Skip to content

aws-ia/terraform-aws-cloudwatch-log-group

AWS Cloudwatch Module

This module creates an AWS Cloudwatch log group along with the corresponding IAM permissions.

Requirements

Name Version
terraform >= 0.15.0
aws >= 3.72.0

Providers

Name Version
aws 4.4.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_log_group.main resource
aws_iam_policy.main resource
aws_iam_role.main resource
aws_iam_role_policy_attachment.main resource
aws_iam_policy_document.main data source

Inputs

Name Description Type Default Required
aws_service_principal The name of the service being logged. 'Service Principal' is a special AWS identity that represents a service or other component with an easily understood name. You can find a list of AWS Service Principals at https://gist.github.com/shortjared/4c1e3fe52bdfa47522cfe5b41e5d6f22 string n/a yes
kms_key_id Encryption for KMS key. string n/a yes
name Name of logs and supporting resources. string n/a yes
retention_in_days Specifies the number of days you want to retain 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, 3653, and 0. If you select 0, the events in the log group are always retained and never expire. number 0 no
tags tags to be added to sub resources map(string) null no

Outputs

Name Description
iam_role IAM role for cloudwatch log group.
log_group Log group resource output.
sid_service_id The service being targetted