Skip to content

Commit

Permalink
Merge branch 'main' into jira_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mati007thm authored Dec 11, 2024
2 parents a85837c + 0496f60 commit da40c63
Show file tree
Hide file tree
Showing 10 changed files with 782 additions and 3 deletions.
73 changes: 73 additions & 0 deletions docs/resources/integration_email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "mondoo_integration_email Resource - terraform-provider-mondoo"
subcategory: ""
description: |-
Send an email to your ticket system, or any recipient.
---

# mondoo_integration_email (Resource)

Send an email to your ticket system, or any recipient.

## Example Usage

```terraform
provider "mondoo" {
space = "hungry-poet-123456"
}
# Setup the Email integration
resource "mondoo_integration_email" "email_integration" {
name = "My Email Integration"
recipients = [
{
name = "John Doe"
email = "[email protected]"
is_default = true
reference_url = "https://example.com"
},
{
name = "Alice Doe"
email = "[email protected]"
is_default = false
reference_url = "https://example.com"
}
]
auto_create = true
auto_close = true
}
```

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

### Required

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

### Optional

- `auto_close` (Boolean) Auto close tickets (defaults to false).
- `auto_create` (Boolean) Auto create tickets (defaults to false).
- `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--recipients"></a>
### Nested Schema for `recipients`

Required:

- `email` (String) Recipient email address.
- `name` (String) Recipient name.

Optional:

- `is_default` (Boolean) Mark this recipient as default. This needs to be set if auto_create is enabled.
- `reference_url` (String) Reference URL for the recipient.
8 changes: 8 additions & 0 deletions examples/resources/mondoo_integration_email/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"
}
}
}
26 changes: 26 additions & 0 deletions examples/resources/mondoo_integration_email/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
provider "mondoo" {
space = "hungry-poet-123456"
}

# Setup the Email integration
resource "mondoo_integration_email" "email_integration" {
name = "My Email Integration"

recipients = [
{
name = "John Doe"
email = "[email protected]"
is_default = true
reference_url = "https://example.com"
},
{
name = "Alice Doe"
email = "[email protected]"
is_default = false
reference_url = "https://example.com"
}
]

auto_create = true
auto_close = true
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.11.0
github.com/stretchr/testify v1.10.0
go.mondoo.com/cnquery/v11 v11.33.0
go.mondoo.com/cnquery/v11 v11.33.1
go.mondoo.com/mondoo-go v0.0.0-20241118222255-5299c9adc97c
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
go.mondoo.com/cnquery/v11 v11.33.0 h1:lXLEPwt+7D3GW2hKMNmHlQlD6YhEd3izGnmHIo2a3Kg=
go.mondoo.com/cnquery/v11 v11.33.0/go.mod h1:ynuOojMFVuwUAq7nC0Dk6Ut/2MS9T/R+hHmWQdP491Q=
go.mondoo.com/cnquery/v11 v11.33.1 h1:ppAKcz3PG80AXKclDYOR3w89B7HgszDw3OSStJj4CcI=
go.mondoo.com/cnquery/v11 v11.33.1/go.mod h1:ynuOojMFVuwUAq7nC0Dk6Ut/2MS9T/R+hHmWQdP491Q=
go.mondoo.com/mondoo-go v0.0.0-20241118222255-5299c9adc97c h1:0u12icLFjeTLzNQHjPs8Mw65VG1Wl8LxHoGRihwaSmg=
go.mondoo.com/mondoo-go v0.0.0-20241118222255-5299c9adc97c/go.mod h1:VTTbqYTjin1hKSnwKHVYeOTEyJrAZarNlf1I8M2rlpM=
go.mondoo.com/ranger-rpc v0.6.4 h1:q01kjESvF2HSnbFO+TjpUQSiI2IM8JWGJLH3u0vNxZA=
Expand Down
14 changes: 14 additions & 0 deletions internal/provider/gql.go
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,19 @@ type JiraConfigurationOptions struct {
AutoCreateCases bool
}

type EmailConfigurationOptions struct {
Recipients []EmailRecipient
AutoCreateTickets bool
AutoCloseTickets bool
}

type EmailRecipient struct {
Name string
Email string
IsDefault bool
ReferenceURL string
}

type ClientIntegrationConfigurationOptions struct {
AzureConfigurationOptions AzureConfigurationOptions `graphql:"... on AzureConfigurationOptions"`
HostConfigurationOptions HostConfigurationOptions `graphql:"... on HostConfigurationOptions"`
Expand All @@ -635,6 +648,7 @@ type ClientIntegrationConfigurationOptions struct {
HostedAwsConfigurationOptions HostedAwsConfigurationOptions `graphql:"... on HostedAwsConfigurationOptions"`
ShodanConfigurationOptions ShodanConfigurationOptions `graphql:"... on ShodanConfigurationOptions"`
JiraConfigurationOptions JiraConfigurationOptions `graphql:"... on JiraConfigurationOptions"`
EmailConfigurationOptions EmailConfigurationOptions `graphql:"... on EmailConfigurationOptions"`
GitlabConfigurationOptions GitlabConfigurationOptions `graphql:"... on GitlabConfigurationOptions"`
// Add other configuration options here
}
Expand Down
Loading

0 comments on commit da40c63

Please sign in to comment.