Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TF AWS Module Primitive - CloudWatch Query Definition

License License: CC BY-NC-ND 4.0

Overview

This Terraform module creates an AWS CloudWatch Logs query definition for saved Insights queries.

Usage

See examples/complete for a full working example.

Module Development

Pre-Requisites

The following commands should be available on your system:

  • asdf or mise
  • make
  • python3 (for pre-commit)

Additionally, your git user and email must be configured. Run the make configure command from the root of the repository to ensure that you meet these requirements.

Pre-Commit hooks

The .pre-commit-config.yaml file defines pre-commit hooks for Terraform formatting, validation, documentation generation, and detect-secrets. Hooks are installed when you run make configure. Go linting runs via make lint in local development and CI, not via pre-commit.

Terratest examples

Post-deploy tests in tests/post_deploy_functional/ and tests/post_deploy_functional_readonly/ target examples/complete via an explicit folder constant in each main_test.go. Adding another example (for example examples/minimal) requires a new test entry point or updating that constant; it is not picked up automatically.

Local Validation

You should validate the changes you make to any module locally, prior to pushing your changes in a branch to GitHub.

  1. Ensure that you have run make configure successfully.
  2. Ensure you are signed into the appropriate cloud provider (e.g. AWS) for the module under test in your current console session.
  3. Run the Terraform and Golang linters:
make lint
  1. Once linters pass, run integration tests (apply, test, destroy):
make test

The pre-commit validations, as well as the make lint and make test targets, are performed in CI. Running them locally before opening a PR helps ensure a smooth review.

Review & Merge Process

Open a Pull Request to the default (main) branch. The PR title must follow Conventional Commits format to merge and to drive semantic versioning.

Ensure CI workflows pass, address review feedback, and obtain approvals required by CODEOWNERS.

Automatic Updates

Shared configuration and workflow files are largely managed through launch-terraform-skeleton. Avoid one-off edits to copied skeleton files in this repository unless necessary (for example .gitignore entries for generated artifacts). Use copier check-update / copier update when refreshing from the skeleton.

Requirements

Name Version
terraform ~> 1.10
aws >= 5.100, < 7.0

Providers

Name Version
aws 6.58.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_query_definition.query_definition resource

Inputs

Name Description Type Default Required
name Name of the CloudWatch Logs saved query. string n/a yes
query_string CloudWatch Logs Insights query string to save. string n/a yes
log_group_names List of log group names associated with this query definition. list(string) null no

Outputs

Name Description
id The query definition ID.
name The name of the query definition.
query_string The saved query string.
log_group_names Log group names associated with the query definition.

About

Terraform Primitive Module for aws cloudwatch_query_definition

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages