Skip to content

Commit

Permalink
oci integration
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Oct 31, 2023
1 parent 1730d00 commit 9dcae1c
Show file tree
Hide file tree
Showing 5 changed files with 467 additions and 4 deletions.
39 changes: 39 additions & 0 deletions examples/resources/mondoo_integration_oci_tenant/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
terraform {
required_providers {
mondoo = {
source = "mondoo/mondoo"
}
}
}

provider "mondoo" {
region = "us"
}

resource "mondoo_space" "my_space" {
name = "My Space Name"
# space_id = "your-space-id" # optional
org_id = "your-org-1234567"
}

resource "mondoo_integration_oci_tenant" "tenant_abc" {
space_id = mondoo_space.my_space.id
name = "tenant ABC"

tenancy = "ocid1.tenancy.oc1..aaaaaaaavvvvvvvvwwwwwwwwxxxxxx..."
region = "us-ashburn-1"
user = "ocid1.user.oc1..aaaaaaaabbbbbbbbccccccccddddeeeeee..."

credentials = {
fingerprint = "12:34:56:78:9a:bc:de:f1:23:45:67:89:ab:cd:ef:12"
private_key = <<EOT
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCf2kWtE6JkkP6E
cnQx/1oa4GqFs23nJFBQhgn9AThqAyUC1ilLQV9ZKjQj5/6+ljq/i4H/zU5lt2yB
....
qpbiCwjFYHmjWFygtYPhRH4T5TEzu4DXhjr4nn99sF0QFKcYkcTSIm7aZppYG4OS
1fnF+XoTcyFIGcSX/I1ND/4=
-----END PRIVATE KEY-----
EOT
}
}
100 changes: 96 additions & 4 deletions examples/resources/mondoo_space/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
mondoo = {
source = "mondoo/mondoo"
source = "mondoo/mondoo"
}
}
}
Expand All @@ -11,7 +11,99 @@ provider "mondoo" {
}

resource "mondoo_space" "my_space" {
name = "My Space Name"
space_id = "your-space-id" # optional
org_id = "your-org-1234567"
name = "My Space New"
// id = "your-space-id" # optional otherwise it will be auto-generated
org_id = "youthful-meitner-435985"
}

resource "mondoo_service_account" "service_account" {
name = "Service Account Terraform New"
description = "Service Account for Terraform"
roles = [
"//iam.api.mondoo.app/roles/viewer", // TODO use "roles/viewer"
]
space_id = mondoo_space.my_space.id

depends_on = [
mondoo_space.my_space
]
}

resource "mondoo_integration_oci_tenant" "tenant_abc" {
space_id = mondoo_space.my_space.id
name = "tenant ABC"

tenancy = "ocid1.tenancy.oc1..aaaaaaaabnjfuyr73mmvv6ep7heu57576mtqbhju5ni275c6rrfqiu6q6joq"
region = "us-ashburn-1"
user = "ocid1.user.oc1..aaaaaaaa2od3jeszy2fwgtvsp77s3y2hqaott37qg62ctm56ujf2crdgi5wa"

credentials = {
fingerprint = "72:f4:f6:50:16:43:32:1f:40:1e:39:59:eb:77:7b:38"
private_key = <<EOT
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCf2kWtE6JkkP6E
cnQx/1oa4GqFs23nJFBQhgn9AThqAyUC1ilLQV9ZKjQj5/6+ljq/i4H/zU5lt2yB
6IWkpbShnwcRXsSYpHWvU+LW+AVYg2o2NNqrNbzo6jZ8SAIFsyHLaWCvQNl/jT82
nyeysjBHqxF0KjaknhMnB6HW8wWyVtqdJJpxoU0bOeGnLVptDl/Fd3cbEVn6uXNy
9YD+9/moW7q1p4x6LuxpxW3M0vbC+v8ynWnXxrHF2Ztua93Q1yPNrlzr6IM0F4Jw
HPwbR9zTAmk9bhwZhzF5gjoQzbPcgGZAr26kUwQyQziOLEVKCH4JDkD5REWt3n0R
VkSu4eNBAgMBAAECggEAPl/Y5UaujKhJMBxK+8Fkgu1Dk4UmotU4I5uR5S/nN/Kf
LAKuHUfWcT/3FXWuoOaU6O4CXXLanvUaOXymPU9Ncu1PQDdm5hryMuY8Mt6Xk2i/
9oPcOYdf/dB6Tzd31oqF6s3lJK1c0Rkn6+PhhShjj2uQhW/9X3GxDn87ZtjwRZxh
joq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Y-----
EOT
}
}

#resource "mondoo_integration_gcp_organization" "account_abc" {
# space_id = mondoo_space.my_space.space_id
# name = "account ABC"
# organization_id = "ABC-project-id"
# credentials {
# client_id = "123456789012345678900"
# client_email = "email@abc-project-name.iam.gserviceaccount.com"
# private_key_id = "1234abcd1234abcd1234abcd1234abcd1234abcd"
# private_key = "-----BEGIN PRIVATE KEY-----\n ... -----END PRIVATE KEY-----\n"
# }
#}
#
#resource "mondoo_integration_gcp_project" "account_abc" {
# space_id = mondoo_space.my_space.space_id
# name = "account ABC"
# project_id = "ABC-project-id"
# credentials {
# client_id = "123456789012345678900"
# client_email = "email@abc-project-name.iam.gserviceaccount.com"
# private_key_id = "1234abcd1234abcd1234abcd1234abcd1234abcd"
# private_key = "-----BEGIN PRIVATE KEY-----\n ... -----END PRIVATE KEY-----\n"
# }
#}



#resource "mondoo_integration_azure_subscription" "account_abc" {
# space_id = mondoo_space.my_space.space_id
# name = "account ABC"
# tenant_id = "abbc1234-abc1-123a-1234-abcd1234abcd"
# credentials {
# client_id = "1234abcd-abcd-1234-ab12-abcd1234abcd"
# client_secret = "ABCD1234abcd1234abdc1234ABCD1234abcdefxxx="
# }
#}
Loading

0 comments on commit 9dcae1c

Please sign in to comment.