spacelift-io / terraform-provider-spacelift

Terraform provider to interact with Spacelift
MIT License
74 stars 28 forks source link

Mark slug as computed and import to state #331

Closed adamconnelly closed 2 years ago

adamconnelly commented 2 years ago

Description of the change

Previously if someone tried to import a stack, and included the slug attribute, Terraform would force a recreate on the next apply because we didn't import slug into the state (so it detected a change from null to the actual value).

I've added a custom importer that just reads the stack information using the existing stack read function. I've also marked the slug as computed - this means that if an existing stack resource doesn't specify the slug, it won't force a recreate.

Type of change

Related issues

Checklists

Development

Code review