PEBKAC: Working with my playlist from another computer does not pull playlist state
JamesAtIntegratnIO opened this issue · comments
So I was on my work laptop and wanted to add a song to the playlist. But after terraform init. All the songs were in the terraform.tfstate
but the playlist wasn't. terraform plan showed that it would create a new playlist.
terraform apply` created a second playlist with a new ID and the same name
Steps to reproduce:
- Clone your playlist repo to another computer. (different folder would probably work as well since the state is local)
- Get local authenticator working with the docker image
terraform init
terraform plan
End result:
- plan output shows a whole new playlist to add
Expected result:
- no changes
This is expected behaviour of terraform. That's what the state file is for (keeping track of resources and their IDs). You can import a playlist into your new state though using terraform import spotify_playlist.playlist <playlistID>
See https://registry.terraform.io/providers/conradludgate/spotify/latest/docs/resources/playlist#import
and https://www.terraform.io/docs/cli/import/index.html for more info on importing