This module creates resources to send your CloudWatch Metrics to Honeycomb.
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_KEYAdditionally, 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 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.
Test cases are in tests/. To setup:
-
Edit the
provider "aws"block to fit your credentials. -
Create a
test.auto.tfvarsfile intests/with values forhoneycomb_api_keyand, optionally,honeycomb_api_host. -
terraform planandterraform applywill now work as expected, as willterraform destroy. -
There's a small Bats that validates a few test cases, one for each of the
examples/. To run it,bats test.batsinsidetests/. It does not runterraform applyfor you, you have to do that first. See test.bats for more documentation. (Feel free to add more test cases.)
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.
We use tflint and terraform fmt, and enforce this with a github action.
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.