这是indexloc提供的服务,不要输入任何密码
Skip to content

Removing git_repository in a project resource fails with an inconsistent result after apply error #133

@ahinh43

Description

@ahinh43

I have a project here with a git repository configured on it:

resource "vercel_project" "main" {
  name           = "test"
  framework      = "nextjs"
  
  git_repository = {
    repo = "myteam/my-vercel-repo"
    type = "gitlab"
    production_branch = "main"
  }
}

If I apply the configuration then decide I need to remove the git_repository field Terraform's plan will propose a update in-place action:

 # vercel_project.main will be updated in-place  
~ resource "vercel_project" "main" {
    - git_repository                          = {
        - production_branch = "main" -> null
        - repo              = "myteam/my-vercel-repo" -> null
        - type              = "gitlab" -> null
      } -> null
      id                                      = "prj_..."
      # ...
  }

But the apply fails with this error:

╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.vercel_project_temp.vercel_project.main,
│ provider "provider[\"registry.terraform.io/vercel/vercel\"]" produced an
│ unexpected new value: .git_repository: was null, but now
│ cty.ObjectVal(map[string]cty.Value{"production_branch":cty.StringVal("main"),
│ "repo":cty.StringVal("myteam/my-vercel-repo"),
│ "type":cty.StringVal("gitlab")}).
│
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

And in the console itself nothing ends up happening. Right now if I need to remove the git repository from the project I'd need to do it manually and run terraform refresh to sync the change to the state file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions