Skip to content

Commit

Permalink
⭐️ AWS integration (#83)
Browse files Browse the repository at this point in the history
* ⭐️ AWS integration
* 🧹 update mondoo schema
* 🧹 remove region argument
  • Loading branch information
chris-rock authored May 20, 2024
1 parent a3531cb commit 4787a66
Show file tree
Hide file tree
Showing 7 changed files with 408 additions and 3 deletions.
92 changes: 92 additions & 0 deletions docs/resources/integration_aws.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "mondoo_integration_aws Resource - terraform-provider-mondoo"
subcategory: ""
description: |-
Continuously scan Google AWS organization and accounts for misconfigurations and vulnerabilities.
---

# mondoo_integration_aws (Resource)

Continuously scan Google AWS organization and accounts for misconfigurations and vulnerabilities.

## Example Usage

```terraform
variable "mondoo_org" {
description = "Mondoo Organization"
type = string
}
variable "aws_access_key" {
description = "AWS access key"
type = string
}
variable "aws_secret_key" {
description = "AWS access key"
type = string
}
provider "mondoo" {}
# Create a new space
resource "mondoo_space" "my_space" {
name = "AWS Terraform"
org_id = var.mondoo_org
}
# Setup the AWS integration
resource "mondoo_integration_aws" "name" {
space_id = mondoo_space.my_space.id
name = "AWS Integration"
credentials = {
key = {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
}
}
}
```

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

### Required

- `credentials` (Attributes) (see [below for nested schema](#nestedatt--credentials))
- `name` (String) Name of the integration.
- `space_id` (String) Mondoo Space Identifier.

### Read-Only

- `mrn` (String) Integration identifier

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

Optional:

- `key` (Attributes) (see [below for nested schema](#nestedatt--credentials--key))
- `role` (Attributes) (see [below for nested schema](#nestedatt--credentials--role))

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

Required:

- `access_key` (String, Sensitive)
- `secret_key` (String, Sensitive)


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

Required:

- `role_arn` (String, Sensitive)

Optional:

- `external_id` (String, Sensitive)
9 changes: 9 additions & 0 deletions examples/resources/mondoo_integration_aws/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_providers {
mondoo = {
source = "mondoohq/mondoo"
version = ">= 0.4.0"
}
}
}

36 changes: 36 additions & 0 deletions examples/resources/mondoo_integration_aws/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
variable "mondoo_org" {
description = "Mondoo Organization"
type = string
}

variable "aws_access_key" {
description = "AWS access key"
type = string
}

variable "aws_secret_key" {
description = "AWS access key"
type = string
}

provider "mondoo" {}

# Create a new space
resource "mondoo_space" "my_space" {
name = "AWS Terraform"
org_id = var.mondoo_org
}

# Setup the AWS integration
resource "mondoo_integration_aws" "name" {
space_id = mondoo_space.my_space.id
name = "AWS Integration"

credentials = {
key = {
access_key = var.aws_access_key
secret_key = var.aws_secret_key
}
}
}

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.9.0
github.com/hashicorp/terraform-plugin-testing v1.7.0
github.com/stretchr/testify v1.9.0
go.mondoo.com/mondoo-go v0.0.0-20240507081602-aa7a34bcb66d
go.mondoo.com/mondoo-go v0.0.0-20240516194133-d6612b90fe7c
)

require (
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,8 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3
go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY=
go.mondoo.com/mondoo-go v0.0.0-20240507081602-aa7a34bcb66d h1:f/vvw9UYM/iZ3XODFcndiHiu5ikV35vLw1m+lOYxYtY=
go.mondoo.com/mondoo-go v0.0.0-20240507081602-aa7a34bcb66d/go.mod h1:XY+tOP6vBFJKw5F3WLYEHNQxc+6YmfQ+hEbw3yRy3HI=
go.mondoo.com/mondoo-go v0.0.0-20240516194133-d6612b90fe7c h1:y910hpEdf1rYW/ONzc0NhuTwVDQNJNC9+x1C+xGywAI=
go.mondoo.com/mondoo-go v0.0.0-20240516194133-d6612b90fe7c/go.mod h1:XY+tOP6vBFJKw5F3WLYEHNQxc+6YmfQ+hEbw3yRy3HI=
go.mongodb.org/mongo-driver v1.15.0 h1:rJCKC8eEliewXjZGf0ddURtl7tTVy1TK3bfl0gkUSLc=
go.mongodb.org/mongo-driver v1.15.0/go.mod h1:Vzb0Mk/pa7e6cWw85R4F/endUC3u0U9jGcNU603k65c=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
Expand Down
Loading

0 comments on commit 4787a66

Please sign in to comment.