Please use the CloudWatch Metrics submodule included in the Honeycomb AWS Integrations module instead.
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_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 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.tfvars
file intests/
with values forhoneycomb_api_key
and, optionally,honeycomb_api_host
. -
terraform plan
andterraform apply
will 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.bats
insidetests/
. It does not runterraform apply
for 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.