Skip to content

DEPRECATED - Please use the AWS Integrations CloudWatch Metrics Submodule Instead

License

Notifications You must be signed in to change notification settings

honeycombio/terraform-aws-honeycomb-cloudwatch-metric-stream

Repository files navigation

DEPRECATED

Please use the CloudWatch Metrics submodule included in the Honeycomb AWS Integrations module instead.

Terraform AWS-Honeycomb CloudWatch Metrics Stream module

This module creates resources to send your CloudWatch Metrics to Honeycomb.

Use

The minimal config is:

module "my-cloudwatch-metrics" {
  source = "honeycombio/honeycomb-cloudwatch-metric-stream/aws"

  name = "my-cloudwatch-metrics"
  honeycomb_dataset_name = "my-cloudwatch-metrics"
  honeycomb_api_key = var.honeycomb_api_key
}

You can load terraform variables from the system by ensuring the environment variable TF_VAR_honeycomb_api_key is exported on the system.

export TF_VAR_honeycomb_api_key=$HONEYCOMB_API_KEY

Additionally, in variables.tf you can include an empty placeholder to the variable.

variable "honeycomb_api_key" {}

Now when you run terraform plan/apply you will not be prompted for your API key during the sequence.

For more config options, including resource tagging and namespace include/exclude filters, see USAGE.md.

Examples

Examples of use of this module can be found in examples/. We've provided a default example ("send all metrics") and examples using the namespace_include_filters and namespace_exclude_filters (which are mutually exclusive). We've also provided an example of tagging your resources.

Development

Tests

Test cases are in tests/. To setup:

  1. Edit the provider "aws" block to fit your credentials.

  2. Create a test.auto.tfvars file in tests/ with values for honeycomb_api_key and, optionally, honeycomb_api_host.

  3. terraform plan and terraform apply will now work as expected, as will terraform destroy.

  4. There's a small Bats that validates a few test cases, one for each of the examples/. To run it, bats test.bats inside tests/. It does not run terraform apply for you, you have to do that first. See test.bats for more documentation. (Feel free to add more test cases.)

Docs

Docs are autogenerated via ./docs.sh, and put in USAGE.md. Please regenerate and commit before merging. (Consider automating this with a github action - see comments in that file for what's not yet working.

Lints

We use tflint and terraform fmt, and enforce this with a github action.

Contributions

Features, bug fixes and other changes to this module are gladly accepted. Please open issues or a pull request with your change.

All contributions will be released under the Apache License 2.0.

About

DEPRECATED - Please use the AWS Integrations CloudWatch Metrics Submodule Instead

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •