terraform-provider-dominos
terraform-provider-dominos copied to clipboard
Request: terraform plan output the total price
Once coupon codes are supported, it'll be nice to confirm they're applied before the order is placed.
I don't think it's possible. dominos_order
can have a property like price
but it would only exist after creating the resource (that is, placing the order). I don't see how this request could be implemented but maybe @ndmckinley has an idea.
Ooh, I do actually! :) There's a special API called price_order
you can hit to get the price out. I could add a price_only
boolean to the order object, which wouldn't really create the order, just get the price. How's that?
Awesome! Would it be possible to add a hook to the end of a terraform plan
instead? Makes more sense to me for it to be in plan since an apply should attempt to change state imo
I don't know, actually. I think no matter what I do, the plan output will say price: "" -> "<COMPUTED>"
, right? Can you point to any other provider that does what you're looking for? Maybe I misunderstand.
Oh bummer. No, I was just wondering and I've never seen anything like it haha Thanks for looking into it!
Hey can someone take a look at #7? I'm actually in Ireland right now and I can't hit dominos API from here, so I could use some help testing.
@ndmckinley Looking at the code from my phone, shouldn't this price only field also have something like IgnoreChanges on it? Just to make sure a different price reported via API won't trigger a new resource (therefore, a new order). The goal is, once a pizza is order, the order will never happen again.
Heh, technically yes, if this were a real, good provider. It only gets updated during Create, though, so it won't cause changes.