vercel / terraform-provider-vercel

Terraform Vercel Provider
Mozilla Public License 2.0
142 stars 21 forks source link

Cannot import `vercel_project_deployment_retention`: deployment retention not found #207

Open lohrm-stabl opened 3 days ago

lohrm-stabl commented 3 days ago

The docs (https://github.com/vercel/terraform-provider-vercel/blob/71a655f75a51b204e511a76b2f7419fca99e2789/examples/resources/vercel_project_deployment_retention/import.sh) say:

# You can import via the team_id and project_id.
# - team_id can be found in the team `settings` tab in the Vercel UI.
# - project_id can be found in the project `settings` tab in the Vercel UI.
terraform import vercel_project_deployment_retention.example team_xxxxxxxxxxxxxxxxxxxxxxxx/prj_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

However, this does not seem to work:

terraform import vercel_project_deployment_retention.deployment-retention team_xxx/prj_xxx
vercel_project_deployment_retention.deployment-retention: Importing from ID "team_xxx/prj_xxx"...
╷
│ Error: Error reading project deployment retention
│ 
│ Could not get project deployment retention team_xxx prj_xxx, unexpected error: deployment retention not found
╵

Minimal cdk.tf.json to replicate:

{
  "//": {
    "metadata": {
      "backend": "local",
      "imports": {
        "vercel_project": [
          "webproject"
        ]
      },
      "stackName": "webproject",
      "version": "0.20.7"
    },
    "outputs": {
    }
  },
  "provider": {
    "vercel": [
      {
        "api_token": "xxx",
        "team": "team_xxx"
      }
    ]
  },
  "resource": {
    "vercel_project_deployment_retention": {
      "deployment-retention": {} // <-- this should be imported
    },
    "vercel_project": {
      "webproject": {
        "//": {
          "metadata": {
            "path": "xxx",
            "uniqueId": "webproject"
          }
        },
        "auto_assign_custom_domains": true,
        "automatically_expose_system_environment_variables": true,
        "directory_listing": false,
        "framework": "nextjs",
        "function_failover": false,
        "git_fork_protection": true,
        "git_lfs": false,
        "git_repository": {
          "production_branch": "prod",
          "repo": "xxx",
          "type": "github"
        },
        "name": "webproject",
        "prioritise_production_builds": true,
        "serverless_function_region": "fra1"
      }
    }
  },
  "terraform": {
    "backend": {
      "local": {
        "path": "/workspaces/...hidden.../terraform.external.tfstate"
      }
    },
    "required_providers": {
      "vercel": {
        "source": "vercel/vercel",
        "version": "1.14.0"
      }
    }
  }
}

Also does not work with the import statement.

Edit: Same problem for ProjectFunctionCpu

dglsparsons commented 2 days ago

Sorry - are you replacing the xxx IDs with your specific team and project IDs?

lohrm-stabl commented 2 days ago

Yes.