-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Resources: wiz_integration_servicenow (#94)
New Resources: wiz_integration_servicenow (#94)
- Loading branch information
Showing
9 changed files
with
468 additions
and
4 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,53 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "wiz_integration_servicenow Resource - terraform-provider-wiz" | ||
subcategory: "" | ||
description: |- | ||
Integrations are reusable, generic connections between Wiz and third-party platforms like Slack, Google Chat, and Jira that allow data from Wiz to be passed to your preferred tool. | ||
--- | ||
|
||
# wiz_integration_servicenow (Resource) | ||
|
||
Integrations are reusable, generic connections between Wiz and third-party platforms like Slack, Google Chat, and Jira that allow data from Wiz to be passed to your preferred tool. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "wiz_integration_servicenow" "default" { | ||
name = "default" | ||
servicenow_url = var.servicename_url | ||
servicenow_username = var.servicenow_username | ||
servicenow_password = var.servicenow_password | ||
scope = "All Resources, Restrict this Integration to global roles only" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `name` (String) The name of the integration. | ||
- `servicenow_password` (String, Sensitive) ServiceNow password. (default: none, environment variable: WIZ_INTEGRATION_SERVICENOW_PASSWORD) | ||
- `servicenow_url` (String) ServiceNow URL. (default: none, environment variable: WIZ_INTEGRATION_SERVICENOW_URL) | ||
- `servicenow_username` (String) Email of a ServiceNow user with permissions to create tickets. (default: none, environment variable: WIZ_INTEGRATION_SERVICENOW_USERNAME) | ||
|
||
### Optional | ||
|
||
- `project_id` (String) The project this action is scoped to. | ||
- `scope` (String) Scoping to a selected Project makes this Integration accessible only to users with global roles or Project-scoped access to the selected Project. Other users will not be able to see it, use it, or view its results. Integrations restricted to global roles cannot be seen or used by users with Project-scoped roles. | ||
- Allowed values: | ||
- Selected Project | ||
- All Resources | ||
- All Resources, Restrict this Integration to global roles only | ||
|
||
- Defaults to `All Resources, Restrict this Integration to global roles only`. | ||
- `servicenow_client_id` (String) ServiceNow OAuth Client ID. (default: none, environment variable: WIZ_INTEGRATION_SERVICENOW_CLIENT_ID) | ||
- `servicenow_client_secret` (String, Sensitive) ServiceNow OAuth Client Secret. (default: none, environment variable: WIZ_INTEGRATION_SERVICENOW_CLIENT_SECRET) | ||
|
||
### Read-Only | ||
|
||
- `created_at` (String) Identifies the date and time when the object was created. | ||
- `id` (String) Identifier for this object. | ||
|
||
|
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,7 @@ | ||
resource "wiz_integration_servicenow" "default" { | ||
name = "default" | ||
servicenow_url = var.servicename_url | ||
servicenow_username = var.servicenow_username | ||
servicenow_password = var.servicenow_password | ||
scope = "All Resources, Restrict this Integration to global roles only" | ||
} |
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
55 changes: 55 additions & 0 deletions
55
internal/acceptance/resource_integration_servicenow_test.go
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,55 @@ | ||
package acceptance | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
) | ||
|
||
func TestAccResourceWizIntegrationServiceNow_basic(t *testing.T) { | ||
rName := acctest.RandomWithPrefix(ResourcePrefix) | ||
|
||
resource.UnitTest(t, resource.TestCase{ | ||
PreCheck: func() { testAccPreCheckIntegrationServiceNow(t) }, | ||
ProviderFactories: providerFactories, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testResourceWizIntegrationServiceNowBasic(rName), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr( | ||
"wiz_integration_servicenow.foo", | ||
"name", | ||
rName, | ||
), | ||
resource.TestCheckResourceAttr( | ||
"wiz_integration_servicenow.foo", | ||
"servicenow_url", | ||
os.Getenv("WIZ_INTEGRATION_SERVICENOW_URL"), | ||
), | ||
resource.TestCheckResourceAttr( | ||
"wiz_integration_servicenow.foo", | ||
"servicenow_username", | ||
os.Getenv("WIZ_INTEGRATION_SERVICENOW_USERNAME"), | ||
), | ||
resource.TestCheckResourceAttr( | ||
"wiz_integration_servicenow.foo", | ||
"scope", | ||
"All Resources, Restrict this Integration to global roles only", | ||
), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testResourceWizIntegrationServiceNowBasic(rName string) string { | ||
return fmt.Sprintf(` | ||
resource "wiz_integration_servicenow" "foo" { | ||
name = "%s" | ||
scope = "All Resources, Restrict this Integration to global roles only" | ||
} | ||
`, rName) | ||
} |
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.