mitchellh / terraform-provider-multispace

Terraform Provider for cascading runs across multiple workspaces.
https://registry.terraform.io/providers/mitchellh/multispace/latest/docs
Mozilla Public License 2.0
146 stars 8 forks source link

Error: Run entered unexpected state "policy_checked", expected applied #6

Closed lucymhdavies closed 2 years ago

lucymhdavies commented 2 years ago

Terraform Version

$ terraform -v
Terraform v1.0.10
on darwin_amd64
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/tfe v0.26.1
+ provider registry.terraform.io/hashicorp/time v0.7.2
+ provider registry.terraform.io/mitchellh/multispace v0.1.0

Your version of Terraform is out of date! The latest version
is 1.0.11. You can update by downloading from https://www.terraform.io/downloads.html

Affected Resource(s)

multispace_run

Expected Behavior

What should have happened?

terraform apply should have triggered a run on a workspace, and succeeded once that workspace had completed

Actual Behavior

What actually happened?

╷
│ Error: Run "run-Bd9KyxHaiT5bQgVw" entered unexpected state "policy_checked", expected applied
│
│   with multispace_run.webserver["dev"],
│   on main.tf line 96, in resource "multispace_run" "webserver":
│   96: resource "multispace_run" "webserver" {
│

Steps to Reproduce

Important Factoids

Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?

References

To my layperson's eye, it appears the issue is in (at least) one of these places:

The provider does not account for the possibility that a run may be in a RunPolicy or RunCost state

Seems like a relatively simple fix, so I may see if I can PR it myself :)

lucymhdavies commented 2 years ago

My workaround for now:

(And same for a Terraform Destroy)

lucymhdavies commented 2 years ago

Looks like my issue is a duplicate of https://github.com/mitchellh/terraform-provider-multispace/issues/3