cloudwatch-logs
CloudWatch Logs Module Documentation
This directory contains machine-readable documentation for the AWS CloudWatch Logs Terraform module.
Files
- ../module.hcl.yaml - Complete module contract following
hcl.terraform.io/v1alpha1schema
Documentation Structure
The module.hcl.yaml file contains:
Inputs (5 variables)
| Name | Type | Required | Description |
|---|---|---|---|
| log_group_name | string | Yes | Name of the CloudWatch Log Group (immutable, forceReplace) |
| retention_in_days | number | No | Days to retain log events (default: 30) |
| kms_key_arn | string | No | KMS key ARN for encryption (immutable) |
| metric_filters | list(object) | No | Metric filters for log-to-metric conversion |
| tags | map(string) | No | Resource tags for organization |
Outputs (2 values)
| Name | Type | Description |
|---|---|---|
| log_group_arn | string | ARN for IAM policies and cross-account access |
| log_group_name | string | Name for CloudWatch Logs Insights queries |
Behaviors (5 patterns)
- Log group name immutability and data loss warnings
- KMS key immutability requiring recreation
- Immediate retention changes
- Metric filter forward-only processing
- Mandatory encryption-at-rest
Examples (2 scenarios)
- simple - Minimal configuration with required inputs only
- complete - Full configuration with encryption, filters, and tags
Usage
For Humans
Read the YAML to understand:
- Variable constraints and validation rules
- Default behaviors and side effects
- Example values for different use cases
- Relationships between variables
For Machines
Parse the YAML to:
- Generate UI forms with validation
- Index for module registries
- Enforce policy compliance
- Generate API documentation
- Validate module usage
Schema Version
apiVersion: hcl.terraform.io/v1alpha1
Quality Metrics
| Metric | Value |
|---|---|
| Inputs documented | 5/5 (100%) |
| Outputs documented | 2/2 (100%) |
| Inputs with remarks | 5/5 (100%) |
| Inputs with examples | 5/5 (100%) |
| Behaviors documented | 5 |
| Example scenarios | 2 |
| i18n support | en, fr |
Completeness Checklist
- All inputs have summary + remarks
- All inputs have 2+ concrete examples
- Complex types have complete object examples
- All outputs have remarks explaining usage
- All outputs have example values
- Validation rules are complete
- Immutable/forceReplace flags set correctly
- Behavioral interactions documented
- Example scenarios described
- i18n annotations included
References
- Terraform Source: ../variables.tf, ../outputs.tf, ../versions.tf
- AWS Documentation: CloudWatch Logs
- Schema Files: ../schema/