TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Terraform Provider for Dominos Pizza

101 点作者 freeqaz7 个月前

14 条评论

tbrownaw7 个月前
Seems a bit convoluted.<p>Compare for example, event sourcing. In that case, you keep a log of all actions taken, and determine the current state by replacing that log.<p>Here, you have an action that you want to take (order a pizza). But you can&#x27;t just do that directly, because it&#x27;s too simple. So instead you tell yourself &quot;I currently have 0 pizzas&quot; (the initial empty state file) and &quot;I want to have one pizza&quot; (your configuration), and you ask it &quot;how do I get there from here&quot;.<p>And then after that is where the real trouble starts. You eat your pizza. You now have resource drift. If you try to correct that drift (does this provider even implement that?), terraform will think it needs to order you another pizza, because it still thinks you want to have one pizza. If you don&#x27;t fix the drift, then next time you want a pizza you&#x27;ll have to tell it that actually you want <i>two</i> pizzas. Because what you actually want is an action, but you have to work backwards from the current state (or rather, what terraform <i>thinks</i> the current state is) and what state to tell it you want in order to make it calculate they action.<p>All of which is more or less the opposite of event sourcing. Instead of wanting a state and having to apply a sequence of events to get that state, you want an event and have to calculate a sequence of state diffs that will produce that event.
评论 #41831298 未加载
kylecazar7 个月前
&quot;This is not a joke provider. Or, it kind of is a joke, but even though it&#x27;s a joke it will still order you a pizza. You are going to get a pizza. You should be careful with this provider, if you don&#x27;t want a pizza.&quot;<p>I laughed...
评论 #41815624 未加载
评论 #41816625 未加载
SOLAR_FIELDS7 个月前
My problem with this approach is that I feel like it&#x27;s the wrong tool for the job. Am I declaring the state of my pizza? Ordering pizza is inherently an imperative task, and unless we are willing to track the lifecycle of the delivery or the pizza itself I feel like we need to explore alternative solutions. Can any solutions engineers weigh in?
评论 #41816333 未加载
MNThomson7 个月前
Author here. I got nerdsniped at 2AM a few years back, never expected to see this on HN!
评论 #41815800 未加载
solatic7 个月前
Would be much more usable if it could be billed to AWS. Then I&#x27;d wire it up so my employer would be paying for a pizza with every new deployment...
评论 #41817707 未加载
评论 #41825255 未加载
nikolay7 个月前
This doesn&#x27;t make much sense as Terraform is for declarative infrastructure. It only make sense if you have an array of orders and keep adding orders and have an order resource with a for_each where you turn that array into an object with a unique key (maybe a hash of the date and line items). What happens if you delete an order from that list, though? Well, you will also have to delete it from the state then. Anyway, this is an abuse of Terraform. Best would be an CLI or TUI.
chajath7 个月前
Reminds of &quot;pizza party&quot; CLI back in the day: <a href="https:&#x2F;&#x2F;entertainment.slashdot.org&#x2F;story&#x2F;04&#x2F;05&#x2F;07&#x2F;138238&#x2F;pizza-from-the-command-line" rel="nofollow">https:&#x2F;&#x2F;entertainment.slashdot.org&#x2F;story&#x2F;04&#x2F;05&#x2F;07&#x2F;138238&#x2F;piz...</a><p>Good fun ordering pizza from your favorite tools!
fjaysdfsy7 个月前
I don&#x27;t use Terraform&#x2F;OpenTofu anymore. Thankfully you can enjoy this in Pulumi with their new TF provider support: <a href="https:&#x2F;&#x2F;www.pulumi.com&#x2F;blog&#x2F;any-terraform-provider" rel="nofollow">https:&#x2F;&#x2F;www.pulumi.com&#x2F;blog&#x2F;any-terraform-provider</a>
评论 #41817172 未加载
dgrin917 个月前
Today I learned that dominos has a public API for ordering pizza? Or is this some reverse engineered shenanigans? I&#x27;m not a Domino&#x27;s fan, but I need to find this pizzapi
评论 #41815803 未加载
评论 #41815813 未加载
chrismarlow97 个月前
Should be a makefile so you can type &#x27;make pizza&#x27;
评论 #41821931 未加载
评论 #41818867 未加载
benrutter7 个月前
This is excellent! Unnecessary thought though, I&#x27;m guessing it doesn&#x27;t handle idempotency? I.e. if you run it twice, you&#x27;ll get two pizzas?<p>Curious how you&#x27;d ammend this in the design?
JojoFatsani7 个月前
Do they make a tofu pizza?
评论 #41818671 未加载
Fire-Dragon-DoL7 个月前
Notice that this provider is banned in Italy because of the low quality infrastructure generated
choppaface7 个月前
“but use caution, since this is going to charge you money”<p>terraform apply ALWAYS charges you money!! Use caution because this action will put more on your plate not theoretically but *physically
评论 #41816539 未加载
评论 #41816927 未加载