Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Don't use postconditions on data.http resources #2088

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

tgeoghegan
Copy link
Contributor

Putting a lifecycle.postcondition on a data.http seems to force Terraform to defer reading that resource until the apply phase. This means that any resource that depends in turn on the data.http can't be planned, which leaves us unable to deploy new localities.

This commit deletes the lifecycle blocks, which lets us plan and hopefully apply again. We should still fail obviously if some JSON manifest can't be fetched, because parsing the JSON or accessing some field of the manifest will fail.

Putting a `lifecycle.postcondition` on a `data.http` seems to force
Terraform to defer reading that resource until the apply phase. This
means that any resource that depends in turn on the `data.http` can't be
planned, which leaves us unable to deploy new localities.

This commit deletes the `lifecycle` blocks, which lets us `plan` and
hopefully `apply` again. We should still fail obviously if some JSON
manifest can't be fetched, because parsing the JSON or accessing some
field of the manifest will fail.
@tgeoghegan tgeoghegan requested a review from a team as a code owner October 7, 2022 19:49
Copy link
Contributor

@divergentdave divergentdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that passing jsondecode bad data results in Error: Error in function call and a failure of the plan. (However, getting a nonexistent attribute from the resulting object results in null, not an error.) I think the results of all three data objects are covered well enough without the postconditions.

@tgeoghegan tgeoghegan merged commit 3b43133 into main Oct 7, 2022
@tgeoghegan tgeoghegan deleted the timg/no-http-postcondition branch October 7, 2022 20:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants