Hey there; I’m getting this error: ``` tailscale...
# general
c
Hey there; I’m getting this error:
Copy code
tailscale:index:Acl (development-tailnetAcl):
    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)")
I’m not really sure which room to ask for help in. Does anyone have an idea why this may be happening? Or how I can rectify it?
For some context; I had an ACL managed under an old repo and stack. I ported the code over to a new repo; deleted the resources in the old stack and deleted the old stack, and then ran
pulumi up
in the new stack.
b
@curved-kitchen-24115 this is more of a tailscale issue really, tailscale has multiple ACLs and the tailscale provider doesn’t allow setting new ones at the moment
c
@billowy-army-68599 that makes sense to me - I have changed the name of the resource in the movement of code and I suppose that may be tripping up something on their side. I just recreated the old stack and everything worked swell. So I’ll port over the old name and see what that does.
hmmmm. So same code, different stacks and different outcomes. Old stack -> recreated and then run up works fine and ACL is applied New stack -> up fails, with above error. I’m clearly not understanding something then @billowy-army-68599 - are you suggesting that even through I’ve rm’ed the old stack there’s something about the set of [repo, stack name, resource name] that is generating a hash on the tailscale side that matches their expectation?
if so, that’s fine - this is just “cleanup” work on my part. I can leave this corner of our IaaC a little dusty 🙂
b
the tailscale.Acl resource is a single resource, you won’t be able to manage it from multiple stacks
c
right, I deleted it from the old one and tried to create a new one (wiwth same config) in a new stack
that failed. Yet I can recreate it in the old stack and it works just fine.
{ import: <tailscale id> }
🎉
OK, in case anyone stumbled on this case in the future: I wanted to move from old_repo/org/resource/old_stack -> new_repo/org/resource/new_stack While doing this I wanted to change the name of the resource (tailscale.Acl). 1. Migrate the code from old_repo to new_repo 2. get the id for the tailscale.Acl from your old stack (I did this via the resource view on the pulumi website) 3. add a Resource ops in the new repo
{ import: <tailscale id>}
4. run down in the old stack 5. run up in the new stack 6. remove the
{import: <>}
statement
7. (optionally, change the name) YMMV.