Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: dettach snippets from check and check groups when properties get removed #72

Open
ianaya89 opened this issue May 20, 2021 · 3 comments
Assignees

Comments

@ianaya89
Copy link

No description provided.

@ianaya89 ianaya89 added the bug label May 20, 2021
@ianaya89 ianaya89 self-assigned this May 20, 2021
@ryanchapman
Copy link

I think I'm running into the same issue.

I have two groups defined like so:

me@mine:~/src/monitoring/checkly$ cat monitored_stacks.yml
- name: production
  region: us-west-2
[...]

- name: australia
  region: ap-southeast-2
[...]

checkly.tf:

locals {
  stacks                 = yamldecode(file("monitored_stacks.yml"))
  setup_script_get_token = <<-EOT
    const axios = require("axios");
    const url = require("url");

    const baseUrl = new url.URL(request.url);
[...]
}

resource "checkly_check_group" "all_groups" {
  # https://selleo.com/til/posts/cnfrqv1ipl-foreach-over-tuples-in-terraform
  for_each                  = { for stack in local.stacks : stack.name => stack }
  name                      = each.key
  local_setup_script        = local.setup_script_get_token
[...]
}

I'd like to move the setup script from the group to the individual checks (we added some checks to the group that don't need the setup script which gets a JWT).

So my goal is to remove the setup script from the group. I've tried many things, including:

resource "checkly_check_group" "all_groups" {
[...]
  local_setup_script        = ""
resource "checkly_check_group" "all_groups" {
[...]
  local_setup_script        = null
resource "checkly_check_group" "all_groups" {
[...]
  setup_snippet_id          = 0
  local_setup_script        = ""

But none of those remove the local setup script from the group.

Not sure if this is related, but when I have local_setup_script = null and run terraform with TF_LOG=trace, I see this:

checkly_1   | 2021/06/23 16:02:09 [DEBUG] checkly_check_group.all_groups["production"]: applying the planned Update change
checkly_1   | 2021/06/23 16:02:09 [TRACE] GRPCProvider: ApplyResourceChange
checkly_1   | 2021/06/23 16:02:10 [WARN] Provider "registry.terraform.io/checkly/checkly" produced an unexpected new value for checkly_check_group.all_groups["australia"], but we are tolerating it because it is using the legacy plugin SDK.
checkly_1   |     The following problems may be the cause of any confusing errors from downstream operations:
checkly_1   |       - .local_setup_script: was null, but now cty.StringVal("const axios = require(\"axios\");\nconst url = require(\"url\");\n\nconst baseUrl = new url.URL(request.url);\n [...] 
")

What is the correct way to disable a setup script in a group?

@tnolet
Copy link
Member

tnolet commented Jun 28, 2021

@ryanchapman thanks for reporting. @ianaya89 can you have a look at this one?

@ianaya89
Copy link
Author

@ryanchapman sorry for the late response. Will take a look into this and get back to you. Is probably related to the issue I reported but want to make some tests before and try to find a workaround.

@ianaya89 ianaya89 added type: bug Something isn't working status: confirmed priority: high and removed bug labels Jun 13, 2022
@ianaya89 ianaya89 changed the title Dettach snippets from check and check groups when properties get removed bug: dettach snippets from check and check groups when properties get removed Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants