Lucretius / terraform-provider-drone

A terraform provider for drone.io
MIT License
12 stars 6 forks source link

Drone Secret Resource Broken When Modified from Drone UI #11

Open oxr463 opened 2 years ago

oxr463 commented 2 years ago

If a drone secret is deleted from the Drone UI, then terraform will blow up with this error:

terraform plan
module.secrets.drone_secret.secret["master_password"]: Refreshing state... [id=oxr463/terraform-module-drone-repository/master_password]
╷
│ Error: failed to read Drone Secret: oxr463/terraform-module-drone-repository/master_password
│ 
│   with module.secrets.drone_secret.secret["master_password"],
│   on secrets/main.tf line 1, in resource "drone_secret" "secret":
│    1: resource "drone_secret" "secret" {
│ 
╵

The solution for this is to remove the secret from the terraform state:

terraform state rm 'module.secrets.drone_secret.secret["master_password"]'