cloudwatch-logs

cloudposse/cloudwatch-logs/aws

Terraform Module HCL AWS

Terraform Module to Provide a CloudWatch Logs Endpoint

Install
module "cloudwatch-logs" {
source = "cloudposse/cloudwatch-logs/aws"
version = "0.6.9"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform module for creation of CloudWatch Log Streams and Log Groups. Useful in combination with Fluentd/Fluent-bit for shipping logs. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Usage ``terraform module "cloudwatch_logs" { source = "cloudposse/cloudwatch-logs/aws" # Cloud Posse recommends pinning every module to a specific version # version = "x.x.x" namespace = "eg" stage = "prod" name = "app" stream_names = ["kafka-instance-1", "kafka-instance-2"] } ` > [!IMPORTANT] > In Cloud Posse's examples, we avoid pinning module

Inputs (26)
NameTypeDescriptionDefault
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
namespacestringID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp'null
tenantstringID element _(Rarely used, not included by default)_. A customer identifier, indinull
environmentstringID element. Usually used for region e.g. 'uw2', 'us-west-2', OR role 'prod', 'stnull
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
descriptor_formatsanyDescribe additional descriptors to be output in the `descriptors` output map. Ma{}
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by null
iam_role_enabledboolWhether to create an IAM role which is able to write logs to the CloudWatch Logstrue
principalsmap(any)Map of service name as key and a list of ARNs to allow assuming the role as valu{ "Service": [ "ec2.amazonaws.com"
enabledboolSet to false to prevent the module from creating any resourcesnull
stagestringID element. Usually used to indicate role, e.g. 'prod', 'staging', 'source', 'bunull
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
label_orderlist(string)The order in which the labels (ID elements) appear in the `id`. Defaults to ["nanull
regex_replace_charsstringTerraform regular expression (regex) string. Characters matching the regex will null
label_value_casestringControls the letter case of ID elements (labels) as included in `id`, set as tagnull
additional_permissionslist(string)Additional permissions granted to the IAM role[ "logs:CreateLogStream", "logs:Dele
delimiterstringDelimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` null
labels_as_tagsset(string)Set of labels (ID elements) to include as tags in the `tags` output. Default is [ "default" ]
tagsmap(string)Additional tags (e.g. `{'BusinessUnit': 'XYZ'}`). Neither the tag keys nor the t{}
Outputs (5)
log_group_arn — ARN of the log group
stream_arns — ARNs of the log streams
log_group_name — Name of log group
role_arn — ARN of the IAM role
role_name — Name of the IAM role
Resources (2)
aws_cloudwatch_log_groupaws_cloudwatch_log_stream
Details
FrameworkTerraform Module
LanguageHCL
Version0.6.9
Cloud AWS
★ Stars72
Forks26
Total downloads6.8M
Inputs26
Outputs5
Resources2
Examples1
LicenseApache-2.0
Namespacecloudposse
Updated