This message was deleted.
# general
b
This message was deleted.
l
Hi @polite-sunset-53335we don’t have any specific Azure examples, but the generic example (https://www.infracost.io/docs/features/cost_policies/#cost-policy-basics) should work with all resources. Or you should be able to adjust the AWS example (https://play.openpolicyagent.org/p/o1MLyC74CJ) to work with any resources. Do you know what policies you are wanting to add?
p
M looking for policy to stop creation if resource cost >hourly cost 100$
l
Okay, maybe something like this would work?
Copy code
deny[out] {
  maxHourlyCost = 100.0
  hourlyCost := to_number(input.projects[_].breakdown.resources[_].hourlyCost)

  msg := sprintf(
    "Hourly cost must be less than $%.2f (actual hourly cost is is $%.2f)",
    [maxHourlyCost, hourlyCost],
  )

  out := {
    "msg": msg,
    "failed": hourlyCost > maxHourlyCost
  }
}
(I’m not an expert in rego, so not quite sure).