You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
New spaces come with a default set of policies enabled. I am trying to change a default policy from "ENABLED" to "DISABLED" with the following code:
resource "mondoo_policy_assignment" "disabled_policies" {
space_id = mondoo_space.os_policy_testing.id
policies = [
"//policy.api.mondoo.app/policies/mondoo-aws-security",
"//policy.api.mondoo.app/policies/mondoo-azure-security",
"//policy.api.mondoo.app/policies/mondoo-gcp-security",
]
state = "disabled" # default is enabled, we also support preview and disabled
depends_on = [
mondoo_space.os_policy_testing
]
}
The code above applies successfully, but after applying, the policies are still enabled:
The text was updated successfully, but these errors were encountered:
@chris-rock after further investigation, I am noticing strange behavior here. It seems that the issue is tide to first runs with the provider, but if I apply another change, then I try to manage a default policy then it works. Here is the full code I am using ...
resource "mondoo_space" "os_policy_testing" {
name = "OS policy testing"
org_id = var.org_id
}
resource "mondoo_policy_assignment" "enabled_policies" {
space_id = mondoo_space.os_policy_testing.id
policies = [
"//policy.api.mondoo.app/policies/mondoo-linux-security",
"//policy.api.mondoo.app/policies/mondoo-macos-security",
"//policy.api.mondoo.app/policies/mondoo-windows-security",
"//policy.api.mondoo.app/policies/amazon-linux-2023-level-1",
"//policy.api.mondoo.app/policies/amazon-linux-2-level-1",
]
state = "enabled" # default is enabled, we also support preview and disabled
depends_on = [
mondoo_space.os_policy_testing
]
}
resource "mondoo_policy_assignment" "disabled_policies" {
space_id = mondoo_space.os_policy_testing.id
policies = [
"//policy.api.mondoo.app/policies/mondoo-aws-security",
"//policy.api.mondoo.app/policies/mondoo-azure-security",
"//policy.api.mondoo.app/policies/mondoo-aws-security",
"//policy.api.mondoo.app/policies/mondoo-gcp-security",
"//policy.api.mondoo.app/policies/mondoo-kubernetes-best-practices",
"//policy.api.mondoo.app/policies/mondoo-kubernetes-security",
]
state = "disabled" # default is enabled, we also support preview and disabled
depends_on = [
mondoo_space.os_policy_testing
]
}
resource "mondoo_policy_assignment" "preview_policies" {
space_id = mondoo_space.os_policy_testing.id
policies = [
"//policy.api.mondoo.app/policies/amazon-linux-2023-level-2",
]
state = "preview" # default is enabled, we also support preview and disabled
depends_on = [
mondoo_space.os_policy_testing
]
}
Describe the bug
New spaces come with a default set of policies enabled. I am trying to change a default policy from "ENABLED" to "DISABLED" with the following code:
The code above applies successfully, but after applying, the policies are still enabled:
The text was updated successfully, but these errors were encountered: