The terraform import handling for stacks was reusing the resourceStackRead() function, which sets the ID to an empty string if no stack is found. To solve this I've pulled out query for a stack and updating the state based on a stack struct into separate functions, and I've updated the import handling to detect when the stack can't be found an output a decent error message.
I pulled the PopulateStack() function into the structs package to follow the pattern we've taken for the scheduled task structs.
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)
Description of the change
The terraform import handling for stacks was reusing the
resourceStackRead()
function, which sets the ID to an empty string if no stack is found. To solve this I've pulled out query for a stack and updating the state based on a stack struct into separate functions, and I've updated the import handling to detect when the stack can't be found an output a decent error message.I pulled the
PopulateStack()
function into the structs package to follow the pattern we've taken for the scheduled task structs.Type of change
Related issues
Checklists
Development
false
.)go generate
to make sure the docs are up to dateCode review
future
unless the change is going directly into production