diff --git a/docs/data-sources/active_policy.md b/docs/data-sources/active_policy.md index 858d07f..19b2911 100644 --- a/docs/data-sources/active_policy.md +++ b/docs/data-sources/active_policy.md @@ -18,7 +18,7 @@ data "mondoo_active_policy" "policy" { } output "policies_mrn" { - value = data.mondoo_active_policy.policy.policies.*.policy_mrn + value = [for policy in data.mondoo_active_policy.policy.policies : policy.policy_mrn] description = "The MRN of the policies in the space" } ``` diff --git a/docs/data-sources/policy.md b/docs/data-sources/policy.md index 4e3a758..ee366cd 100644 --- a/docs/data-sources/policy.md +++ b/docs/data-sources/policy.md @@ -15,12 +15,12 @@ Data source for policies and querypacks ```terraform data "mondoo_policy" "policy" { space_id = "your-space-1234567" - catalog_type = "ALL" # availabe options: "ALL", "POLICY", "QUERYPACK" + catalog_type = "ALL" # available options: "ALL", "POLICY", "QUERYPACK" assigned_only = true } output "policies_mrn" { - value = data.mondoo_policy.policy.policies.*.policy_mrn + value = [for policy in data.mondoo_policy.policy.policies : policy.policy_mrn] description = "The MRN of the policies in the space according to the filter criteria." } ``` diff --git a/examples/data-sources/mondoo_active_policy/data-source.tf b/examples/data-sources/mondoo_active_policy/data-source.tf index 2bd6dcc..04cc802 100644 --- a/examples/data-sources/mondoo_active_policy/data-source.tf +++ b/examples/data-sources/mondoo_active_policy/data-source.tf @@ -3,6 +3,6 @@ data "mondoo_active_policy" "policy" { } output "policies_mrn" { - value = data.mondoo_active_policy.policy.policies.*.policy_mrn + value = [for policy in data.mondoo_active_policy.policy.policies : policy.policy_mrn] description = "The MRN of the policies in the space" } diff --git a/examples/data-sources/mondoo_policy/data-source.tf b/examples/data-sources/mondoo_policy/data-source.tf index 1ca14cd..17d677a 100644 --- a/examples/data-sources/mondoo_policy/data-source.tf +++ b/examples/data-sources/mondoo_policy/data-source.tf @@ -1,10 +1,10 @@ data "mondoo_policy" "policy" { space_id = "your-space-1234567" - catalog_type = "ALL" # availabe options: "ALL", "POLICY", "QUERYPACK" + catalog_type = "ALL" # available options: "ALL", "POLICY", "QUERYPACK" assigned_only = true } output "policies_mrn" { - value = data.mondoo_policy.policy.policies.*.policy_mrn + value = [for policy in data.mondoo_policy.policy.policies : policy.policy_mrn] description = "The MRN of the policies in the space according to the filter criteria." }