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

DeleteDeployment: Create a delete deployment method #22

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

Merged
merged 1 commit into from
May 3, 2022

Conversation

WCMinor
Copy link
Contributor

@WCMinor WCMinor commented Apr 25, 2022

For us it is important to delete deployments for terraform consistency

The deletion of the resource worked fine in our tests:

Terraform will perform the following actions:

  # vercel_deployment.deployment will be destroyed
  - resource "vercel_deployment" "deployment" {
      - domains    = [
          - "avocado-git-dario-terraform-deployment-test.pollen.run",
        ] -> null
      - git_source = {
          - ref     = "dario-terraform-deployment-test" -> null
          - repo_id = "449314886" -> null
          - type    = "github" -> null
        }
      - id         = "dpl_9gBRCvWiw8ViYzAawNypNfNrLtK2" -> null
      - production = false -> null
      - project_id = "prj_xxxxxxxxxxxxxxxxt" -> null
      - team_id    = "team_xxxxxxxxxxxxxxxxt" -> null
      - url        = "avocado-ibsmgnaua.pollen.run" -> null
    }

Plan: 0 to add, 0 to change, 1 to destroy.

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Saved the plan to: /tmp/plan.out

To perform exactly these actions, run the following command to apply:
    terraform apply "/tmp/plan.out"
~/dev/pollen/tf_module_vercel_deployment main* ❯ terraform apply /tmp/plan.out                                        
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - vercel/vercel in /terraform-provider-vercel
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
vercel_deployment.deployment: Destroying... [id=dpl_9xxxxxxxxxxxxxxxxtK2]
vercel_deployment.deployment: Destruction complete after 2s

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

The deployment was gone from the vercel console.

If deleted manually in the middle of the operation it fails as expected:

 ❯ terraform apply /tmp/plan.out                                        
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - vercel/vercel in /terraform-provider-vercel
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
vercel_deployment.deployment: Destroying... [id=dpl_5xxxxxxxxxxxxxxx]
╷
│ Error: Error deleting deployment
│ 
│ Could not delete deployment xxxxx-iuyda4x0l.pollen.run, unexpected error: not_found - Not found
╵
~/tf_module_vercel_deployment main* ❯ terraform plan --var-file=params.tfvars --out /tmp/plan.out --destroy
╷
│ Warning: Provider development overrides are in effect
│ 
│ The following provider development overrides are set in the CLI configuration:
│  - vercel/vercel in /terraform-provider-vercel
│ 
│ The behavior may therefore not match any released version of the provider and applying changes may cause the state to become incompatible with published releases.
╵
vercel_deployment.deployment: Refreshing state... [id=dpl_xxxxxxxxxxxy]

No changes. No objects need to be destroyed.

@WCMinor WCMinor requested a review from dglsparsons as a code owner April 25, 2022 14:37
@WCMinor WCMinor force-pushed the add-delete-deployment branch 2 times, most recently from 09c4cd8 to b3e9435 Compare April 28, 2022 14:35
@WCMinor WCMinor requested a review from dglsparsons April 28, 2022 14:36
For us it is important to delete deployments for terraform consistency
@WCMinor WCMinor force-pushed the add-delete-deployment branch from b3e9435 to 3cef4cb Compare April 28, 2022 14:39
@dglsparsons dglsparsons merged commit c2382a8 into vercel:main May 3, 2022
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

Successfully merging this pull request may close these issues.

2 participants