Skip to content

Required attribute for mondoo_policies data source #298

Description

@sibuthomasmathew

Describe the bug
A clear and concise description of what the bug is.

In the documentation, space_id and space_mrn are showed as optional

Image

However, applying terraform without them throws the following error:

╷
│ Error: Invalid Attribute Combination
│
│   with data.mondoo_policies.policies_data,
│   on k8s.tf line 23, in data "mondoo_policies" "policies_data":
│   23: data "mondoo_policies" "policies_data" {
│
│ No attribute specified when one (and only one) of [space_mrn] is required
╵
╷
│ Error: Invalid Attribute Combination
│
│   with data.mondoo_policies.policies_data,
│   on k8s.tf line 23, in data "mondoo_policies" "policies_data":
│   23: data "mondoo_policies" "policies_data" {
│
│ No attribute specified when one (and only one) of [space_id] is require

Even in the code, the attributes are marked optional

To Reproduce
Steps to reproduce the behavior:

Apply the following terraform code

data "mondoo_policies" "policies_data" {
  catalog_type  = "POLICY"
  assigned_only = true
}

output "policies_mrn" {
  value       = [for policy in data.mondoo_policies.policies_data.policies : policy.policy_mrn]
  description = "The MRN of the policies in the space according to the filter criteria."
}

Expected behavior
A clear and concise description of what you expected to happen.

Highlight in the documentation either space_id and space_mrn is required. Not sure whether it would need changes to the provider source code

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions