Skip to content

Conversation

@sorccu
Copy link
Member

@sorccu sorccu commented Jul 24, 2025

This PR adds support for a new resource type: checkly_url_monitor - URL monitor.

resource "checkly_url_monitor" "test" {
  name      = "test"
  activated = true
  frequency = 30
  locations = ["us-east-1", "eu-central-1"]

  request {
    url              = "https://welcome.checklyhq.com"
    follow_redirects = false

    assertion {
      source     = "STATUS_CODE"
      comparison = "EQUALS"
      target     = "200"
    }
  }
}

I've taken care to add a bit more documentation and validation this time, since the pending TF provider overhaul is likely still months away.

Additionally, checkly_heartbeat has been renamed to checkly_heartbeat_monitor, and checkly_tcp_check to checkly_tcp_monitor. The old resource types are still available, and have not been deprecated. If we deprecate them, users will start seeing warnings every time they deploy their resources. In the Plugin SDK however there is no convenient way to move a resource to a new type, so the steps to rename a resource are a bit convoluted:

  1. Figure out the ID of the affected check
  2. Rename the resource (name, type) in the .tf file
  3. Use the import command or preferably the import block to import the existing resource into the new resource type
  4. Use terraform state rm to remove the old resource from TF state

With the framework, a single "moved" block would do the job (well, we'd have to have extra code for it in the provider though).

So, for now, their descriptions will say that they've been renamed, but there's no outright deprecation.

Of course, if you don't care about keeping historical data, you can just recreate the resources by renaming them.

Affected Components

  • Resources
  • Test
  • Docs
  • Tooling
  • Other

Pre-Requisites

  • Terraform code is formatted with terraform fmt
  • Go code is formatted with go fmt
  • plan & apply command of demo/main.tf file do not produce diffs

Notes for the Reviewer

Resolves #[issue-number]

New Dependency Submission

@sorccu sorccu requested a review from a team as a code owner July 24, 2025 16:19
@github-actions
Copy link

github-actions bot commented Jul 24, 2025

Terraform Format and Style 🖌success

Format Output

The old resource types are still available, and have not been deprecated.
If we deprecate them, users will start seeing warnings every time they
deploy their resources. In the Plugin SDK however there is no convenient
way to move a resource to a new type, so the steps to rename a resource
are a bit convoluted:
  1. Figure out the ID of the affected check
  2. Rename the resource (name, type) in the .tf file
  3. Use the import command or preferably the import block to import the
     existing resource into the new resource type
  4. Use terraform state rm to remove the old resource from TF state

With the framework, a single "moved" block would do the job (well, we'd
have to have extra code for it in the provider though).

- `comparison` (String) The type of comparison to be executed between expected and actual value of the assertion. Possible values are `EQUALS`, `NOT_EQUALS`, `GREATER_THAN` and `LESS_THAN`.
- `source` (String) The source of the asserted value. The only allowed value is `STATUS_CODE`.
- `target` (String) The target value. Typically `200` when the source is `STATUS_CODE`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `target` (String) The target value. Typically `200` when the source is `STATUS_CODE`.
- `target` (String) The target value. Use a 2xx value to assert a successful `STATUS_CODE` response, e.g. `200`.

Might be worth highlighting that the assertion doesn't work for negative status codes (this is something we need to fix / add validation for at some point)

@sorccu sorccu merged commit d391f0a into main Jul 30, 2025
11 of 15 checks passed
@sorccu sorccu deleted the simokinnunen/sc-24803/tf-url-monitor-support branch July 30, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants