Terraform is an infrastructure as code tool that lets users define both cloud and on-prem resources in human-readable configuration files. Users can version, reuse, and share in a central solution for managing infrastructure across multiple platforms throughout their lifecycle.
This introduction assumes you have both Uptime.com and Github accounts.
Uptime.com and Terraform
The Uptime.com Github contains all necessary files and a README with instructions to create and install a Terraform instance. Additionally, Terraform has a tendency to use many API requests when managing a large group of Uptime.com checks.
The following are the requirements for using the current version of the Uptime.com Terraform provider:
- Terraform v0.12.0 or higher
- Go v1.12 or higher (installation instructions)
If your Terraform configurations become rate limited, please take the following suggested steps:
-refresh=false Disables the default behavior of synchronizing the Terraform state with remote objects before checking for configuration changes.
As an example, let’s say your account has 500 checks. If you need to change 1 check and are using Terraform’s default behavior, the system will GET all 500 checks before it can UPDATE the one that needs modification. This flag tells Terraform: "don't do the 500 GET calls, and rely on what you remember from last time instead".
-target=ADDRESS Instructs Terraform to focus its planning efforts only on resource instances that match the given address and on any objects that those instances depend on.
To continue our previous example, you can use this flag to specifically target the 1 check that needs updating. The end result is 2 API calls to GET specific check and then UPDATE it.
Terraform and the Uptime.com UI
Terraform automatically remembers a check’s state, and will synchronize (refresh) each operation to ensure something hasn't inadvertently changed. Avoid making changes to checks outside your terraform system to prevent unnecessary refreshes.
Contact Uptime.com Support
It is possible to add on an increase to your account’s rate limit. If the previous steps have not helped to resolve any rate limiting issues that may occur, contact us for further assistance.
Uses and Use Cases
The Uptime.com Terraform provider is primarily useful for provisioning and managing checks in an enterprise setting, where multiple users may collaborate on a deployment. It allows teams to effectively build check creation, and retrieval of metrics, into normal workflow.
With Terraform, it should be possible to create a new check within a deployment, assign a tag to the check, and retrieve metrics at set intervals.
It is also possible to manage third-party integrations via Terraform, provision new integrations, or manage existing ones as changes are made to your system.