Hacker News new | past | comments | ask | show | jobs | submit login
The Terraform Plugin for the Dominos Pizza Provider (github.com)
154 points by mooreds 32 days ago | hide | past | web | favorite | 87 comments

Epic. Now it's got me thinking this is a first step towards declaratively stating what should be in my fridge at all times and having food automatically provisioned for me.

Looked around but couldn't find a grocery store API to help deliver the dream.

My local supermarket has an online ordering platform. I could reverse engineer the API.

Some kind of abstraction like postmates maybe?

Walmart Grocery Delivery?

Amazon Prime Pantry ?

This seems like poor cloud architecture. What I really want is at least one pizza delivered from several kitchens and assurance that drivers will use different routes.

A good upgrade from the fax API xpizza had to rely on, though.

We can engineer a solution to the dynamic tradeoffs you see in food delivery..

Sometimes you want at least one pizza, reliably as possible, and you're willing to pay extra. Other times you may want a pizza as affordable as possible, even if it is delayed or the order may be cancelled on you. The open generic API should support this high-level configuration, and the provider should be auto-selected according to your needs.

I also see an opportunity for this in the ride-sharing space. Sometimes riders are looking for a cheap and possibly slow option, other times a premium is expected for a fast trip. In my dreams I could use an open app that understands these tradeoffs, and automatically requests a driver from Uber, Lyft, or any other Taxi provider who offers safe/fast/affordable drivers in a given area.

So maybe it the same pizza could come from multiple providers but they break it up into slices and attach a pizza-correlation-id to each slice so an entire pizza can be assembled at the point of delivery.

And a table of pre-sliced pizza would be less prone to philosophers starving while deadlocked on acquiring utensils.

What if two philosophers grab the same slice and won't let go?

One eats the pizza first, then the other eats it, problem solved!

That just serializes the problem, maybe the philosophers could just atomically take a slice, but what if its half pinapple and naturally no one likes pinapple and there arent enough slices?

Reminds me of mathematical methods for fairly dividing cake, eg https://mindyourdecisions.com/blog/2015/12/22/how-to-split-a... (though I don't think that's the method I'm recalling).

No need for utensils while eating pizza! Publish me!

Lyfe already offers this with Shared and Saver rides. I assume Uber has similar.

I’d like it on Kubernetes so the pizza’s readiness probe can ping my IoT doorbell.

Plus, the ability to add a sidecar container of garlic bread and dips would be nice.

And the rolling deploys are a nice addition.

Pretty amusing. If you aren't familiar with Terraform, it is declarative. You provide the desired state of your system, and if the current state is different, TF does its best to heal components and their dependencies into that state.

"Having pizza" would be the state TF is trying to achieve here

So you must not forget to call destroy every time you eat it or how is this supposed to work? (No Dominos in this country, so I cannot test)

It orders one on each apply. From the docs:

> “As far as I know, there is no programmatic way to destroy an existing pizza. terraform destroy is implemented on the client side, by consuming the pizza.”

You could place a camera (connected to WiFi) over a special pizza tray-area in the fridge, whose job will be to monitor % of tray covered by Pizza. Run terraform apply when the pizza % is dangerously low...

(of course, you may need to use Deep Learning™️ to analyse the image from the camera to trace the outline of the remaining pizza and thus calculate %)

A legitimate use of a pie chart to visualize remaining supply.

Thinking too much into it, but slices are (roughly) the same size across the board, you could use a weight sensor and calibrate it against a single slice so it knows pizza percentage that way (this also prevents the need for having a constantly lit pizza tray)

While it does work, this provider is designed to showcase the power of Terraform and flexibility. I don’t recommend using this in production :)

If this isn’t production, I don’t know what is :)

Sadly client side implementations of Destroy tend to leave you with inconsistent state files ;-)

Terraform is buggy. It may be powerful, but only because its easier to learn vs cloudformation.

Also, it works outside of AWS.

aws-cdk is a great abstraction on top of cloudformation, unfortunately it's not ready yet; it works for many use cases but is probably not ready for whatever your specific use case happens to be.

> No Dominos in this country, so I cannot test

consider yourself lucky, it is like eating cardboard

I was a delivery driver for dominos in the 90s. It was monumentally bad pizza back then.

It's gotten better. Not great. Better. If you haven't tried some recently, do so. You will be merely disappointed. But no longer hungry...

There was nowhere else go to besides "better" ! I actually tried some a few months ago, trying to keep an open mind. I agree with "disappointed, but no longer hungry". But I disagree that one should go out of their way to try it - all I could think was "this is made to be adequate for stoners".

(And I know programmatically ordering food is cool and all, but I'd trudge through the snow and wait an hour if that's what it took to get something other than Dominos)

Dominos’ taste varies between country. Far better than the grease in a box from Pizza Hut, and the local pizza place is horrible.

Had a dominos in Singapore, it was awful compared to the UK. I’ve not had one in the US

in the words of idubbbz (cf. https://youtu.be/9WJs3S1D350 around 1:50 or so), "have you people TASTED cardboard?", or more accurately,"if it's flavorless, then say it's flavorless!"

i personally have never tasted cardboard to my knowledge so i can't say that Dominos tastes like it, but I can say that if it does, I'm upset with myself for not spending enough time eating cardboard, because I certainly find Dominos to be quite satisfying. maybe not the best, certainly, but no, it doesn't strike me as eating cardboard. and, just out of curiosity, have you actually eaten cardboard, or are you just comparing it to what you assume cardboard must be like!

>it doesn't strike me as eating cardboard //

So, the thought of eating cardboard physically impacts on you? Why do you say it does, why don't you say "it doesn't seem to me like eating cardboard would be a similar experience". /s

Of course "tastes like cardboard" is just a generic phrase to indicate you think something is bland [and chewy] or unsatisfying to eat. Just like the the metaphorical way in which people talk about thoughts striking them.

In short, I find your objection silly and overly argumentative.

Some people, like OP, declare to the world how good their taste is by putting down common things.

Domino's is perfectly good pizza. It's not mind-blowing, but it isn't inedible garbage either. I didn't eat at Domino's when I lived in Manhattan because there were more pizza places to try than you could in a lifetime, but I do eat Domino's when I'm in more rural/suburban parts of America and I've found that it is at least on par with local places.

I've eaten a pizza box, and that tasted like Dominoes. Is that any help?

Dominoes stock price in the last 5 years says otherwise.

And Uber and WeWork are great companies based on their valuation....

Actually Dominos stock has outperformed Apple over the last 20 years. It's a remarkable story. Nothing at all like Uber and WeWork.

Google tells me Domino's DPZ IPO was 15 years ago. Was it trading differently before? AAPL has performed better since but anyway it's a silly comparison of there were major equity restructuring events back then.

Uber's stock price has not moved anywhere infact its lower than its IPO price, is that your point?

Wework is not publicly traded so not sure why do you think its relevant.

It doesn’t matter whether “it’s moved”, it’s valuation is still ridiculous based on its actual core business valuation.

As far as WeWork bring public or not it also doesn’t matter whether the pool of investors who have assigned it a value are private investors or the public market.

If you are so sure it's valuation is ridiculous, you should be shorting the stock and put your money where your mouth is.

Wework not being public matters, you can look at the financials of public companies which was my point.

You cannot look at the financials of private companies so no point of commenting what private investors are doing when you cannot look at the same data.

Shorting a stock isn’t just a matter whether it’s going to go down but predicting when it’s going to go down. As Buffett says “the market can stay irrational longer than you can stay solvent”.

Private investors don’t care about the fundamentals. They are just hoping to pawn their stake off to the public market to make a profit.

Exactly and in the end the market does become rational, might take some time so coming back to Dominoes are you saying that the market has been irrational for 5 years?

> Private investors don’t care about the fundamentals.

Exactly which is why there was no point in talking about private valuation.

If private investors don’t care about valuations because their time horizon is shorter and they plan to get out and sell to the bigger fool, how is that any different than the public investor?

Either way, stock valuation doesn’t determine the viability of a company as a going concern - profitability does. Did anyone think that MS wasn’t a going concern during the decade where it’s stock stagnated? Do any of the major profitable tech companies have a business model that is more less successful based on investor sentiment during the day?

> stock valuation doesn’t determine the viability of a company as a going concern - profitability does.

Have you looked at the EPS of dominos for the last 5 years?

Isn’t that what I’ve been arguing the whole time - that it was the earnings that made a company viable and not the stock price?

I was replying specifically to...

“Dominoes stock price in the last 5 years says otherwise.”

The comment wasn’t “Dominoes earnings per share in the last 5 years says otherwise”.

and why do you think the stock price went up for the last 5 years, was it because of the people love to eat pizza which tastes like cardboard?

And if stock price is directly correlated with profitability again how does that relate to Uber and Lyft?

Alternatively, how does that explain Microsoft under Ballmer? Revenues and profits went up dramatically during his tenure but the stock price stagnated for years.

If stock price was directly correlated to profitability or business viability, Apple wouldn’t have such a low multiple compared to some of other tech darlings.

Its not directly related but profitability is one of main factor another factor is future earnings which should answer your doubt about Microsoft and Apple.

More accurately, having a particular pizza order from Dominos seems to be that desired state.

It's then up to Dominos to recognize that a correct pizza order is incomplete without a completed pizza delivery.

Dominos has an online order tracker, so it ought to be possible to have this plugin recognize when an order is in fact complete.

Meh. I used terraform for a few years and every time it didn’t work the way I wanted I found a ignored github issue. Vaporware as far as I am concerned.

"vaporware" you mean the most popular tool to deploy on cloud platforms.

I prefer cloudformation

My biggest issue with CloudFormation is that it absolutely refused to start managing any resource it didn't create. "terraform import" is clumsy but better than nothing.

I always thought CloudFormation was also less extensible, but it looks like they have Lambda-based macros now, which might actually be less hassle than writing gRPC plugin servers for Terraform.

Now I need to look up how to extend Pulumi. I'm reluctant to use anything that will require generating a lot of Go code.

If you create resources outside of terraform/CF your doing it wrong. This is a feature, not a bug.

That's a beautiful statement of purity, but my reality has been different. Even with the best of intensions sometimes resources are created outside of an IaC solution and you want to bring them in.

On the other hand I hear that CF's rollback is better at not leaving things in a busted state.

This. It takes years to learn good architecture, and Cloudformation nudges you to make it right. Thats why you need senior infrastructure engineers.

This is 100% unrelated to “senior infrastructure engineers” (most of whom I’ve seen end up building pure crap), and import is simply a matter of practicality.

If we followed the (patently poor) advice above, CF users would not have been able to use NAT Gateways - to take one of several prominent examples - for many months following their launch. Terraform was substantially faster to support them, but being able to import resources created outside the normal mechanism for _any_ reason is an essential part of any IaC tool.

> If you create resources outside of terraform/CF your doing it wrong.

But at least you're doing it!

There are sometimes holes in Terraform coverage.

We don't seem to have used Terraform for everything since day one. Even if we had, we can't migrate to CloudFormation without abandoning our Terraform-created datastores and live-migrating to new ones. (Not that we necessarily want to, at this point.)

Always Outnumbered, Never Outgunned. Respect, man.

            me too

And outside of AWS?

Terraform supports multiple vendors, but your templates are not vendor-neutral, you have to rewrite them all. I don't see it as that big a win over using each vendor's native tools, as long as they all support a config managed in git.

With terraform, I at least only have to learn one syntax, so there’s at least that, if noting else.

Which does little good if you still have to learn the provisioner, the terminology and the idiosyncrasies of the platform.

And good luck using your business support plan with AWS when something goes wonky and you’re using Terraform.

It does plenty of good. I have software that spans AWS, Azure, and GCP (don't ask me why). I can easily manage it as a cohesive whole, e.g. using an ip address provisioned in GCP as the target of a DNS record provisioned in AWS. I can spin it all up in a single call to a single tool.

Under the hood, terraform is just using the AWS APIs. If an error occurs with them, getting support isn't an issue.

Luckily you're not the only consumer of Terraform...

Terrible example, does not encourage best practices. It recommends checking in your credit card information. A good example would show how to properly protect this information with Vault or a cloud specific secrets provider.

I can just imagine all of the exploited credit cards of devops engineers due to this.

Found the infosec person

"don't blast your private keys to the whole world" isn't infosec people, it's anyone allowed to get near a business operation.

Lol this is worse, it's "don't put your credit card info on github including CVV2".

But This article is pretty silly so my OP is meant to be a bit silly, tho apparently people are taking teraforming a pizza seriously.


My favorite part: "terraform destroy is implemented on the client side, by consuming the pizza."

I was expecting this to 'terraform' some shop into a dominoes, some kind of recipe for shop fitters to fitout a Dominoes in a standard way.

I assume this is all contained in style guides, and various other tomes. Has any company tried doing it programmatically though???

I’ve heard Dominos described as a tech company disguised as a pizza company. This continues to support that idea.

(I know this provider isn’t from them, but it still applies nonetheless)

That explains why their pizza isn't that good, especially compared to, say, Costco.

Who is better at a cheaper price? Of you count Costco you have to count how much hassle it is to obtain a pizza from Costco.

I'm often too cheap to pay for delivery any way. Plus, I can usually add pick-up (including at Costco) to a list of existing errands.

What a time to be alive!


And who hurt you ?

On topic, this seems like a good showcase of Terraforms' flexibility, and a good side project for the OP.

Are you calling us sick fuckers because of choice of diet or devops tools.

Very good news ehh^^

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact