tailscale/terraform-provider-tailscale

ACL behavior in integration tests

AaronFriel opened this issue · 4 comments

Integration tests of the Pulumi provider failed due to the behavior on "create" to set the ts-default tag and error if the ACL was not the default.

Error encountered:

    tailscale:index:Acl (demo-py):
      error: 1 error occurred:
      	* Failed to set ACL: ! You seem to be trying to overwrite a non-default ACL with a tailscale_acl resource.
      Before doing this, please import your existing ACL into Terraform state using:
       terraform import $(this_resource) acl
      (got error "precondition failed, invalid old hash (412)")

Rather than require an import state, it would be nice to allow the user to "force" creation and opt out of the check.

Requiring import was the fix for #182, whatever we do here needs to ensure it doesn't re-introduce the same problem.

Yeah, I agree with the nature of the safeguard.

Would an additional input forceCreate: bool = false make sense?

this is a problem I keep running into, a forceCreate option would be great