Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A second approach to fixing timeouts in state. #577

Closed
wants to merge 1 commit into from

Conversation

paddycarver
Copy link
Contributor

Timeouts are persisted in state in a funny way, and the SDK manages how
this happens. PlanResourceChange, ImportResourceChange, and ReadResource
all apply this logic to persisting the timeouts and state, but
ImportResource doesn't. This is likely because the logic assumes there's
a state that the timeouts may be present in, but ImportResource
obviously doesn't have a state.

This PR just applies the same logic assuming the resource state is null
(which, technically, is kinda true?) and experimentally it has the same
effect that running apply has.

Why are we storing timeouts in state at all? My guess is it has
something to do with Terraform's type management with cty between state
and config; I bet we're not allowed to have something in config that's
not in state, or some such.

Timeouts are persisted in state in a funny way, and the SDK manages how
this happens. PlanResourceChange, ImportResourceChange, and ReadResource
all apply this logic to persisting the timeouts and state, but
ImportResource doesn't. This is likely because the logic assumes there's
a state that the timeouts _may_ be present in, but ImportResource
obviously doesn't have a state.

This PR just applies the same logic assuming the resource state is null
(which, technically, is kinda true?) and experimentally it has the same
effect that running `apply` has.

Why are we storing timeouts in state at all? My guess is it has
something to do with Terraform's type management with cty between state
and config; I bet we're not allowed to have something in config that's
not in state, or some such.
@paddycarver paddycarver added bug Something isn't working testing labels Sep 11, 2020
@paddycarver paddycarver requested a review from a team September 11, 2020 03:31
@paddycarver
Copy link
Contributor Author

Going to run with #576 as a less intrusive diff, and upstream this as a more permanent, clean fix.

@ghost
Copy link

ghost commented Oct 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant