terraform-provider-tailscale icon indicating copy to clipboard operation
terraform-provider-tailscale copied to clipboard

ACL behavior in integration tests

Open AaronFriel opened this issue 3 years ago • 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.

AaronFriel avatar Jan 24 '23 00:01 AaronFriel

Requiring import was the fix for https://github.com/tailscale/terraform-provider-tailscale/issues/182, whatever we do here needs to ensure it doesn't re-introduce the same problem.

DentonGentry avatar Jan 24 '23 00:01 DentonGentry

Yeah, I agree with the nature of the safeguard.

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

AaronFriel avatar Jan 24 '23 16:01 AaronFriel

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

markwellis avatar Aug 01 '23 14:08 markwellis