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
[x] Bug fix (non-breaking change that fixes an issue)
[ ] New feature (non-breaking change that adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] Documentation (non-breaking change that adds documentation)
Related issues
Fixes #315
Checklists
Development
[x] Lint rules pass locally
[x] The code changed/added as part of this pull request has been covered with tests
[x] All tests related to the changed code pass in development
[x] tfplugindocs has been run to make sure the docs are up to date.
Code review
[x] This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
[x] Pull Request is no longer marked as "draft"
[ ] Reviewers have been assigned
[x] Changes have been reviewed by at least one other engineer
[x] The target branch is future unless the change is going directly into production
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 importslug
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
tfplugindocs
has been run to make sure the docs are up to date.Code review
future
unless the change is going directly into production