Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added zendesk integration #170

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions docs/resources/integration_zendesk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "mondoo_integration_zendesk Resource - terraform-provider-mondoo"
subcategory: ""
description: |-
Zendesk integration to keep track of security tasks and add Zendesk tickets directly from within the Mondoo Console.
---

# mondoo_integration_zendesk (Resource)

Zendesk integration to keep track of security tasks and add Zendesk tickets directly from within the Mondoo Console.

## Example Usage

```terraform
variable "zendesk_token" {
description = "The GitHub Token"
type = string
sensitive = true
}

provider "mondoo" {
space = "hungry-poet-123456"
}

# Setup the zendesk integration
resource "mondoo_integration_zendesk" "zendesk_integration" {
name = "My Zendesk Integration"
subdomain = "your-subdomain"
email = "[email protected]"

custom_fields = [
{
id = "123456"
value = "custom_value_1"
},
{
id = "123457"
value = "custom_value_2"
}
]

auto_create = true
auto_close = true

credentials = {
token = var.zendesk_token
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `credentials` (Attributes) (see [below for nested schema](#nestedatt--credentials))
- `email` (String) Zendesk email.
- `name` (String) Name of the integration.
- `subdomain` (String) Zendesk subdomain.

### Optional

- `auto_close` (Boolean) Automatically close tickets.
- `auto_create` (Boolean) Automatically create tickets.
- `custom_fields` (Attributes List) Custom fields to be added to the Zendesk ticket. (see [below for nested schema](#nestedatt--custom_fields))
- `space_id` (String) Mondoo Space Identifier. If it is not provided, the provider space is used.

### Read-Only

- `mrn` (String) Integration identifier

<a id="nestedatt--credentials"></a>
### Nested Schema for `credentials`

Required:

- `token` (String, Sensitive) Token for GitHub integration.


<a id="nestedatt--custom_fields"></a>
### Nested Schema for `custom_fields`

Required:

- `id` (Number) Custom field ID.
- `value` (String) Custom field value.
8 changes: 8 additions & 0 deletions examples/resources/mondoo_integration_zendesk/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
mondoo = {
source = "mondoohq/mondoo"
version = ">= 0.19"
}
}
}
34 changes: 34 additions & 0 deletions examples/resources/mondoo_integration_zendesk/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
variable "zendesk_token" {
description = "The GitHub Token"
type = string
sensitive = true
}

provider "mondoo" {
space = "hungry-poet-123456"
}

# Setup the zendesk integration
resource "mondoo_integration_zendesk" "zendesk_integration" {
name = "My Zendesk Integration"
subdomain = "your-subdomain"
email = "[email protected]"

custom_fields = [
{
id = "123456"
value = "custom_value_1"
},
{
id = "123457"
value = "custom_value_2"
}
]

auto_create = true
auto_close = true

credentials = {
token = var.zendesk_token
}
}
14 changes: 14 additions & 0 deletions internal/provider/gql.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,19 @@ type ShodanConfigurationOptions struct {
Targets []string
}

type ZendeskConfigurationOptions struct {
Subdomain string
Email string
AutoCloseTickets bool
AutoCreateTickets bool
CustomFields []ZendeskCustomField
}

type ZendeskCustomField struct {
ID int64
Value string
}

type JiraConfigurationOptions struct {
Host string
Email string
Expand Down Expand Up @@ -647,6 +660,7 @@ type ClientIntegrationConfigurationOptions struct {
GithubConfigurationOptions GithubConfigurationOptions `graphql:"... on GithubConfigurationOptions"`
HostedAwsConfigurationOptions HostedAwsConfigurationOptions `graphql:"... on HostedAwsConfigurationOptions"`
ShodanConfigurationOptions ShodanConfigurationOptions `graphql:"... on ShodanConfigurationOptions"`
ZendeskConfigurationOptions ZendeskConfigurationOptions `graphql:"... on ZendeskConfigurationOptions"`
JiraConfigurationOptions JiraConfigurationOptions `graphql:"... on JiraConfigurationOptions"`
EmailConfigurationOptions EmailConfigurationOptions `graphql:"... on EmailConfigurationOptions"`
GitlabConfigurationOptions GitlabConfigurationOptions `graphql:"... on GitlabConfigurationOptions"`
Expand Down
Loading
Loading