Skip to content

Infrastrukturait/terraform-aws-cloudwatch-logs

Repository files navigation

terraform-aws-cloudwatch-logs

WeSupportUkraine

About

Terraform module for creation of CloudWatch Log Streams and Log Groups.

License

License: MIT

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

Source: <https://opensource.org/licenses/MIT>

See LICENSE for full details.

Authors

Documentation

Requirements

Name Version
terraform >= 0.14
aws >= 2.0.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_log_group.this resource
aws_cloudwatch_log_stream.this resource

Inputs

Name Description Type Default Required
kms_key_id The ARN of the KMS Key to use when encrypting log data.
Please note, after the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group.
All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested."
string null no
logs_path Path of the logs in CloudWatch. 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.
Default to 30 days.
number 30 no
tags Resource tags. map(string) {} no

Outputs

Name Description
log_group_arn The Amazon Resource Name (ARN) specifying the log group.
log_group_name The name of the log group.
log_group_retention_in_days Specifies the number of days log events are retained
log_stream_arn The Amazon Resource Name (ARN) specifying the log stream.
log_stream_log_group_name The name of the log group under which the log stream was created
log_stream_name The name of the log stream.
logs_path Path of the logs in CloudWatch

Examples

module "app_prod_logs" {
  source = "../../"

  logs_path         = var.logs_path
  retention_in_days = var.retention_in_days
}