generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:[CCM-16472]: Terraform support for Governance-Enforcements (#1052)
- Loading branch information
Showing
14 changed files
with
677 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:new-resource | ||
harness_governance_rule_enforcement - Added Governance Enforcement resource in Harness terraform provider | ||
``` |
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,41 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_governance_rule_enforcement Data Source - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Datasource for looking up a rule enforcement. | ||
--- | ||
|
||
# harness_governance_rule_enforcement (Data Source) | ||
|
||
Datasource for looking up a rule enforcement. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "harness_governance_rule_enforcement" "example" { | ||
enforcement_id = "enforcement_id" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `enforcement_id` (String) Id of rule enforcement. | ||
|
||
### Read-Only | ||
|
||
- `cloud_provider` (String) The cloud provider for the rule enforcement. | ||
- `description` (String) Description for rule enforcement. | ||
- `execution_schedule` (String) Execution schedule in cron format. | ||
- `execution_timezone` (String) Timezone for the execution schedule. | ||
- `id` (String) The ID of this resource. | ||
- `is_dry_run` (Boolean) Indicates if the rule enforcement is a dry run. | ||
- `is_enabled` (Boolean) Indicates if the rule enforcement is enabled. | ||
- `name` (String) Name of the rule enforcement. | ||
- `rule_ids` (Map of String) List of rule IDs. | ||
- `rule_set_ids` (Map of String) List of rule set IDs. | ||
- `target_accounts` (List of String) List of target accounts. | ||
- `target_regions` (List of String) List of target regions. |
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: "harness_governance_rule_enforcement Resource - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
Resource for creating, updating, and managing rule enforcement. | ||
--- | ||
|
||
# harness_governance_rule_enforcement (Resource) | ||
|
||
Resource for creating, updating, and managing rule enforcement. | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `cloud_provider` (String) The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP. | ||
- `execution_schedule` (String) Execution schedule in cron format. | ||
- `execution_timezone` (String) Timezone for the execution schedule. | ||
- `name` (String) Name of the rule enforcement. | ||
- `target_accounts` (List of String) List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids. | ||
|
||
### Optional | ||
|
||
- `description` (String) Description for rule enforcement. | ||
- `is_dry_run` (Boolean) Indicates if the rule enforcement is a dry run. This by default is set to false. | ||
- `is_enabled` (Boolean) Indicates if the rule enforcement is enabled. This by default is set to true. | ||
- `rule_ids` (List of String) List of rule IDs. Either rule_ids or rule_set_ids should be provided. | ||
- `rule_set_ids` (List of String) List of rule set IDs. Either rule_ids or rule_set_ids should be provided. | ||
- `target_regions` (List of String) List of target regions. For GCP it should be left empty but is required in case of AWS or Azure. | ||
|
||
### Read-Only | ||
|
||
- `enforcement_id` (String) Id of the rule enforcement. | ||
- `id` (String) The ID of this resource. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# Import governance enforcement | ||
terraform import harness_governance_rule_enforcement.example <enforcement_id> | ||
``` |
3 changes: 3 additions & 0 deletions
3
examples/data-sources/harness_governance_rule_enforcement/data-source.tf
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,3 @@ | ||
data "harness_governance_rule_enforcement" "example" { | ||
enforcement_id = "enforcement_id" | ||
} |
2 changes: 2 additions & 0 deletions
2
examples/resources/harness_governance_rule_enforcement/import.sh
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,2 @@ | ||
# Import governance enforcement | ||
terraform import harness_governance_rule_enforcement.example <enforcement_id> |
14 changes: 14 additions & 0 deletions
14
examples/resources/harness_governance_rule_enforcement/resources.tf
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,14 @@ | ||
resource "harness_governance_rule_enforcement" "example" { | ||
identifier = "identifier" | ||
name = "name" | ||
cloud_provider = "AWS/AZURE/GCP" | ||
rule_ids = ["rule_id1"] | ||
rule_set_ids = ["rule_set_id1"] | ||
execution_schedule = "0 0 * * * *" | ||
execution_timezone = "UTC" | ||
is_enabled = true | ||
target_accounts = ["awsAccountId/azureSubscriptionId/gcpProjectId"] | ||
target_regions = ["us-east-1/eastus"] | ||
is_dry_run = false | ||
description = "description" | ||
} |
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
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
Oops, something went wrong.