Terraform
Enable automated product usage reports
This topic describes how to enable Terraform Enterprise to automatically report product usage information to HashiCorp. Refer to Terraform Enterprise product data reference for information about the product usage data Terraform Enterprise sends to HashiCorp.
Introduction
Product usage reports provide the following benefits:
- Insight into how much more you can deploy under your current contract.
- Protection against over-utilization.
- Predictable consumption for budgeting purposes.
Additionally, you can review usage with your existing monitoring solutions, such as Splunk and Datadog. Monitoring product usage enables you to optimize and manage your deployments. Refer to Monitor Terraform Enterprise for instructions on how to enable log forwarding for non-Replicated runtimes. Refer to documentation for enabling log forwarding for Replicated deployments if Terraform is deployed to Replicated.
Requirements
Configure your network to allow outbound HTTPS traffic on port
443
.Configure your network to allow HTTPS egress on port
443
fromhttps://reporting.hashicorp.services
by allow-listing the following IP addresses:Configure your network to allow egress to
https://api.replicated.com
Refer to Configure network access for additional information.
Enable product usage reporting
Terraform is configured to automatically report product usage data by default. Refer to Opt out of product usage reporting for instructions on how to disable automatic reports.
Check logs
Terraform Enterprise automatically begins reporting data within approximately 24 hours from start up. Refer to Log location and format to verify that the data sent successfully.
{
"@level": "debug",
"@message": "export finished successfully",
"@module": "tfe-licensing.licensingexporter",
"@timestamp": "2023-05-10T17:48:06.656979Z"
}
Terraform Enterprise logs report an error when your installation is air-gapped or when your network does not allow the correct egress:
{
"@level": "error",
"@message": "error exporting snapshot",
"@module": "tfe-licensing.census",
"@timestamp": "2023-05-11T01:50:51.662155Z",
"err": "export failed with error POST https://reporting.hashicorp.services giving up after 5 attempt(s): Post \"https://reporting.hashicorp.services\": dial tcp 35.166.5.222:443: i/o timeout"
}
In this case, reconfigure your network to allow egress and check back in roughly 24 hours.
Opt out of product usage reporting
If your installation is air-gapped or you do not want to report product utilization data to HashiCorp, you can opt out of reporting.
- Add the following environment variable to your deployment configuration
TFE_USAGE_REPORTING_OPT_OUT=TRUE
. - Restart your system.
- Check your product logs roughly 24 hours after opting out to make sure that the system does not send reports.