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

resource group doesn't exits #68

Open
Ashutoshkale opened this issue Jan 29, 2024 · 1 comment
Open

resource group doesn't exits #68

Ashutoshkale opened this issue Jan 29, 2024 · 1 comment

Comments

@Ashutoshkale
Copy link

I'm trying to create monitor with following provider

required_providers {
    betteruptime = {
      source = "BetterStackHQ/better-uptime"
      version = "0.5.1"
    }

terraform version

Terraform v1.7.1
on linux_amd64

error

POST https://betteruptime.com/api/v2/monitors returned 422: {"errors":{"resource_group":["doesn't exist"]}}

resource "betteruptime_monitor" "xx-xx" {

}
@PetrHeinz
Copy link
Member

Hello @Ashutoshkale, apologies for the late reaction 🙌

I've tried to recreate you config (better-uptime provider in v0.5.1, using a slightly higher version of TF v1.8.0):

terraform {
  required_version = ">= 0.13"
  required_providers {
    betteruptime = {
      source  = "BetterStackHQ/better-uptime"
      version = "0.5.1"
    }
  }
}

resource "betteruptime_monitor" "xx-xx" {

}

With this config BETTERUPTIME_API_TOKEN=XXX terraform apply fails on missing required arguments:

╷
│ Error: Missing required argument
│ 
│   on main.tf line 11, in resource "betteruptime_monitor" "xx-xx":
│   11: resource "betteruptime_monitor" "xx-xx" {
│ 
│ The argument "monitor_type" is required, but no definition was found.
╵
╷
│ Error: Missing required argument
│ 
│   on main.tf line 11, in resource "betteruptime_monitor" "xx-xx":
│   11: resource "betteruptime_monitor" "xx-xx" {
│ 
│ The argument "url" is required, but no definition was found.
╵

I've added the required arguments:

terraform {
  required_version = ">= 0.13"
  required_providers {
    betteruptime = {
      source  = "BetterStackHQ/better-uptime"
      version = "0.5.1"
    }
  }
}

resource "betteruptime_monitor" "xx-xx" {
  url          = "https://example.com"
  monitor_type = "status"
}

Now, BETTERUPTIME_API_TOKEN=XXX terraform apply succeeded:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # betteruptime_monitor.xx-xx will be created
  + resource "betteruptime_monitor" "xx-xx" {
      + check_frequency  = 180
      + created_at       = (known after apply)
      + email            = true
      + follow_redirects = true
      + http_method      = "GET"
      + id               = (known after apply)
      + last_checked_at  = (known after apply)
      + monitor_type     = "status"
      + paused_at        = (known after apply)
      + push             = true
      + recovery_period  = 180
      + remember_cookies = true
      + request_timeout  = 30
      + status           = (known after apply)
      + updated_at       = (known after apply)
      + url              = "https://example.com"
      + verify_ssl       = true
    }

Plan: 1 to add, 0 to change, 0 to destroy.
betteruptime_monitor.xx-xx: Creating...
betteruptime_monitor.xx-xx: Creation complete after 1s [id=2320154]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Are you still encountering the issue? Maybe you've omitted part of your configuration which is the reason behind the issue you're mentioning.

Also, I'd recommend to upgrade our provider to v0.10.0 or higher, as there were a few fixes, tweaks and new features added since than 🙌

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

No branches or pull requests

2 participants