forked from mondoohq/terraform-provider-mondoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into resource_import
- Loading branch information
Showing
40 changed files
with
1,736 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ linters: | |
- unconvert | ||
- unparam | ||
- unused | ||
- vet | ||
- govet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "mondoo_assets Data Source - terraform-provider-mondoo" | ||
subcategory: "" | ||
description: |- | ||
The asset data source allows you to fetch assets from a space. | ||
--- | ||
|
||
# mondoo_assets (Data Source) | ||
|
||
The asset data source allows you to fetch assets from a space. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "mondoo" {} | ||
data "mondoo_assets" "assets_data" { | ||
space_id = "my-space-1234567" | ||
} | ||
output "asset_mrns" { | ||
description = "MRNs of the assets" | ||
value = [for asset in data.mondoo_assets.assets_data.assets : asset.mrn] | ||
} | ||
output "asset_names" { | ||
description = "Names of the assets" | ||
value = [for asset in data.mondoo_assets.assets_data.assets : asset.name] | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `space_id` (String) The unique identifier of the space. | ||
- `space_mrn` (String) The unique Mondoo Resource Name (MRN) of the space. | ||
|
||
### Read-Only | ||
|
||
- `assets` (Attributes List) The list of assets in the space. (see [below for nested schema](#nestedatt--assets)) | ||
|
||
<a id="nestedatt--assets"></a> | ||
### Nested Schema for `assets` | ||
|
||
Read-Only: | ||
|
||
- `annotations` (Attributes List) The annotations/tags of the asset. (see [below for nested schema](#nestedatt--assets--annotations)) | ||
- `asset_type` (String) The type of the asset. | ||
- `id` (String) The unique identifier of the asset. | ||
- `mrn` (String) The unique Mondoo Resource Name (MRN) of the asset. | ||
- `name` (String) The name of the asset. | ||
- `reference_ids` (List of String) The reference IDs of the asset. | ||
- `score` (Attributes) The overall score of the asset. (see [below for nested schema](#nestedatt--assets--score)) | ||
- `state` (String) The current state of the asset. | ||
- `updated_at` (String) The timestamp when the asset was last updated. | ||
|
||
<a id="nestedatt--assets--annotations"></a> | ||
### Nested Schema for `assets.annotations` | ||
|
||
Read-Only: | ||
|
||
- `key` (String) The key of the annotation. | ||
- `value` (String) The value of the annotation. | ||
|
||
|
||
<a id="nestedatt--assets--score"></a> | ||
### Nested Schema for `assets.score` | ||
|
||
Read-Only: | ||
|
||
- `grade` (String) The grade of the asset. | ||
- `value` (Number) The score value of the asset. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "mondoo_policy Data Source - terraform-provider-mondoo" | ||
subcategory: "" | ||
description: |- | ||
Data source for policies and querypacks | ||
--- | ||
|
||
# mondoo_policy (Data Source) | ||
|
||
Data source for policies and querypacks | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "mondoo_policy" "policy" { | ||
space_id = "your-space-1234567" | ||
catalog_type = "ALL" # available options: "ALL", "POLICY", "QUERYPACK" | ||
assigned_only = true | ||
} | ||
output "policies_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." | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `assigned_only` (Boolean) Only return enabled policies if set to `true` | ||
- `catalog_type` (String) Catalog type of either `ALL`, `POLICY` or `QUERYPACK`. Defaults to `ALL` | ||
- `space_id` (String) Space ID | ||
- `space_mrn` (String) Space MRN | ||
|
||
### Read-Only | ||
|
||
- `policies` (Attributes List) List of policies (see [below for nested schema](#nestedatt--policies)) | ||
|
||
<a id="nestedatt--policies"></a> | ||
### Nested Schema for `policies` | ||
|
||
Read-Only: | ||
|
||
- `action` (String) Policies can be set to `Null`, `IGNORE` or `ACTIVE` | ||
- `assigned` (Boolean) Determines if a policy is enabled or disabled | ||
- `created_at` (String) Timestamp of policy creation | ||
- `is_public` (Boolean) Determines if a policy is public or private | ||
- `policy_mrn` (String) Unique policy Mondoo Resource Name | ||
- `policy_name` (String) Policy name | ||
- `updated_at` (String) Timestamp of policy update | ||
- `version` (String) Version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "mondoo_custom_framework Resource - terraform-provider-mondoo" | ||
subcategory: "" | ||
description: |- | ||
Set custom Compliance Frameworks for a Mondoo Space. | ||
--- | ||
|
||
# mondoo_custom_framework (Resource) | ||
|
||
Set custom Compliance Frameworks for a Mondoo Space. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "mondoo" { | ||
region = "us" | ||
} | ||
variable "mondoo_org" { | ||
description = "The Mondoo Organization ID" | ||
type = string | ||
default = "my-org-1234567" | ||
} | ||
variable "my_custom_framework" { | ||
description = "Path to the custom policy file. The file must be in MQL format." | ||
type = string | ||
default = "framework.mql.yaml" | ||
} | ||
# Create a new space | ||
resource "mondoo_space" "my_space" { | ||
name = "Custom Framework Space" | ||
org_id = var.mondoo_org | ||
} | ||
resource "mondoo_custom_framework" "compliance_framework_example" { | ||
space_id = mondoo_space.my_space.id | ||
data_url = var.my_custom_framework | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `data_url` (String) URL to the custom Compliance Framework data. | ||
- `space_id` (String) Mondoo Space Identifier. | ||
|
||
### Read-Only | ||
|
||
- `mrn` (String) Mondoo Resource Name. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "mondoo_framework_assignment Resource - terraform-provider-mondoo" | ||
subcategory: "" | ||
description: |- | ||
Set Compliance Frameworks for a Mondoo Space. | ||
--- | ||
|
||
# mondoo_framework_assignment (Resource) | ||
|
||
Set Compliance Frameworks for a Mondoo Space. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
provider "mondoo" { | ||
region = "us" | ||
} | ||
variable "mondoo_org" { | ||
description = "The Mondoo Organization ID" | ||
type = string | ||
default = "my-org-1234567" | ||
} | ||
# Create a new space | ||
resource "mondoo_space" "my_space" { | ||
name = "Framework Space" | ||
org_id = var.mondoo_org | ||
} | ||
resource "mondoo_framework_assignment" "compliance_framework_example" { | ||
space_id = mondoo_space.my_space.id | ||
framework_mrn = ["//policy.api.mondoo.app/frameworks/cis-controls-8", | ||
"//policy.api.mondoo.app/frameworks/iso-27001-2022"] | ||
enabled = true | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `enabled` (Boolean) Enable or disable the Compliance Framework. | ||
- `framework_mrn` (List of String) Compliance Framework MRN. | ||
- `space_id` (String) Mondoo Space Identifier. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
provider "mondoo" {} | ||
|
||
data "mondoo_assets" "assets_data" { | ||
space_id = "my-space-1234567" | ||
} | ||
|
||
output "asset_mrns" { | ||
description = "MRNs of the assets" | ||
value = [for asset in data.mondoo_assets.assets_data.assets : asset.mrn] | ||
} | ||
|
||
output "asset_names" { | ||
description = "Names of the assets" | ||
value = [for asset in data.mondoo_assets.assets_data.assets : asset.name] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
mondoo = { | ||
source = "mondoohq/mondoo" | ||
version = ">= 0.4.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
provider "mondoo" {} | ||
|
||
data "mondoo_organization" "org" { | ||
id = "reverent-ride-275852" | ||
id = "your-org-1234567" | ||
} | ||
|
||
output "org_mrn" { | ||
description = "MRN of the organization" | ||
value = data.mondoo_organization.org.mrn | ||
} | ||
} | ||
|
||
output "org_name" { | ||
description = "Name of the organization" | ||
value = data.mondoo_organization.org.name | ||
} | ||
|
||
output "org_id" { | ||
description = "ID of the organization" | ||
value = data.mondoo_organization.org.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
data "mondoo_policy" "policy" { | ||
space_id = "your-space-1234567" | ||
catalog_type = "ALL" # available options: "ALL", "POLICY", "QUERYPACK" | ||
assigned_only = true | ||
} | ||
|
||
output "policies_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." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
terraform { | ||
required_providers { | ||
mondoo = { | ||
source = "mondoohq/mondoo" | ||
version = ">= 0.4.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.