chronark / terraform-provider-vercel

A terraform provider for vercel's hosting platform
ff789693-5a72-142e-e45d-326ead4ae7a4.vercel.app
Mozilla Public License 2.0
25 stars 9 forks source link

Resource Project: Blocks of type "domain" are not expected here. #55

Open andreyluchianic opened 2 years ago

andreyluchianic commented 2 years ago

Hi there, i'm having troubles when try to add domain block in project resource.

Terraform Version

Run terraform -v to show the version. We support terraform v0.13+

 terraform -v
Terraform v1.0.4
on darwin_amd64
+ provider registry.terraform.io/chronark/vercel v0.10.4
+ provider registry.terraform.io/hashicorp/google-beta v4.1.0

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files


provider "vercel" {
  # Configuration options
  token = var.vercel_token
}

resource "vercel_domain" "main" {
  for_each = var.states

  name = each.value.domain
}

resource "vercel_project" "projects" {
  for_each = var.states
  name = "${each.value.state}-${var.project_name}"

  team_id = var.team_id
  framework = "nextjs"
  build_command = "yarn build"

  git_repository {
    type = "github"
    repo = var.github_repo
  }

  domain {
    name = vercel_domain.main.name
  }

  // domain {
  //   name = "www.${vercel_domain.main.name}"
  //   redirect = vercel_domain.main.name
  //   redirect_status_code = 308
  // }
}

Debug Output

Screenshot 2021-12-03 at 12 27 11

Panic Output

No panic

Expected Behavior

Should create project in Vercel, without this domain block in project resource everything works fine.

Actual Behavior

Unsupported block

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply or terraform plan

Important Factoids

References

chronark commented 2 years ago

Yeah that looks good to be correct. I'll check it out tomorrow to find the error

andreyluchianic commented 2 years ago

Hey @chronark btw, i have a feeling that domain resource also don't work how it supposed. Using same config but without domain (list block in project) i see that resource domain is created:

Screenshot 2021-12-07 at 10 24 43

but no changes in Vercel UI. Domain is custom domain - i expect domain appear in vercel -> team -> domains