terraform - Restrict Savings Plan creation outside specified subscription in Mgmt group via Azure Policy - Stack Overflow
- c - Solaris 10 make Error code 1 Fatal Error when trying to build python 2.7.16 - Stack Overflow 推荐度:
- javascript - How to dismiss a phonegap notification programmatically - Stack Overflow 推荐度:
- javascript - Get the JSON objects that are not present in another array - Stack Overflow 推荐度:
- javascript - VS 2015 Angular 2 import modules cannot be resolved - Stack Overflow 推荐度:
- javascript - Type 'undefined' is not assignable to type 'menuItemProps[]' - Stack Overflow 推荐度:
- 相关推荐
Using Terraform/Azure Policies, I want to restrict the creation of savings plans only to one of our subscriptions i.e Prod. We have more than 10 subscriptions in the tenant in different management groups.
Since Savings Plans don't have a straightforward path I'm facing difficulties creating a policy for them.
Here's the policy I have so far:
resource "azurerm_policy_definition" "restrict_savings_plan" {
name = "restrict-savings-plan-creation"
policy_type = "Custom"
mode = "All"
display_name = "Restrict Savings Plan Creation to Prod Subscription"
policy_rule = <<POLICY
{
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Billing billingAccounts/savingsPlanOrders/savingsPlans"//Not sure if this is correct
},
{
"value": "[subscription().Id]", //Kinda iffy about this
"notEquals": "Prod-subscription-id"
}
]
},
"then": {
"effect": "deny"
}
}
POLICY
}
I referenced the Azure documentation to identify the Savings Plan type for this policy, but I'm not entirely certain it's accurate. If there's a more correct type, I’d appreciate it if you could point it out.
The goal of this policy is to deny the creation of Savings Plans outside the Prod subscription. I expect that if someone attempts this, they should see a deny message.
However, I’m unsure whether the conditions for the Subscription value
and the Savings Plan field
in the policy_rule
are written correctly as our vendor has confirmed that they're still able to create plans without getting any denials. I would greatly appreciate any feedback or suggestions to refine this policy.
Thank you in advance!
- Win10、安卓手机实现打通:拖拽即可互传文件
- 仅售74美元的Android迷你电脑:你会买吗?
- visual c++ - MSVC errors out: undeclared identifier for SQL Server - Stack Overflow
- eslint - How to have 2 no-restricted-globals rules with different severity? - Stack Overflow
- caching - Pytorch: the cache is constantly increasing - Stack Overflow
- python - ModuleNotFoundError: No module named 'llama_index.text_splitter' - Stack Overflow
- javascript - MineFlayer bot Error: read ECONNRESET as I was trying to log it in to my server - Stack Overflow
- python - Why is my KivyMD Button not changing Color with "md_bg_color"? - Stack Overflow
- c++ - Camera is tilting when trying to rotate quaternion - Stack Overflow
- django - SimpleJWT: Re-apply Blacklist Token Migration: "Table 'token_blacklist_blacklistedtoken' doesn
- julia - How can I fix GLMakie.jl LoadError? - Stack Overflow
- python - Azure Cognitive Vector search query and index creation - Stack Overflow
- c++ - Which option has precendence if I enable and disable FrontEndHeapDebugOptions at the same time? - Stack Overflow
- ZeroMQ Subscriber in Rails Worker Fails to Receive Messages, but Works with QLStats - Stack Overflow
- java - Android physical keyboard support for key press and hold - Stack Overflow
- Clicking on Android Studio on Mac makes Chrome window disaapear - Stack Overflow
- python - How Can I Use GPU to Accelerate Image Augmentation? - Stack Overflow