Skip to content

Commit

Permalink
feat(integrationconnectors): Prepared IntegrationConnectorsConnection…
Browse files Browse the repository at this point in the history
… for inclusion in C.G.C. documentation (#553)

* Prepared IntegrationConnectorsConnection for inclusion in C.G.C. documentation.

* Prepared IntegrationConnectorsConnection for inclusion in C.G.C. documentation

---------

Co-authored-by: Sampath Kumar <[email protected]>
  • Loading branch information
balanaguharsha and msampathkumar authored Jan 16, 2024
1 parent fc03864 commit 24645bf
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 1 deletion.
257 changes: 257 additions & 0 deletions integrationconnectors/advanced/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

data "google_project" "default" {
}

resource "google_secret_manager_secret" "default" {
secret_id = "my-example-secrect"
replication {
user_managed {
replicas {
location = "us-central1"
}
}
}
}


resource "google_secret_manager_secret_version" "default" {
secret = google_secret_manager_secret.default.id
secret_data = "dummypassword"
}

resource "google_secret_manager_secret_iam_member" "default" {
secret_id = google_secret_manager_secret.default.id
role = "roles/secretmanager.admin"
member = "serviceAccount:${data.google_project.default.number}[email protected]"
depends_on = [google_secret_manager_secret_version.default]
}


# [START integrationconnectors_connection_example]
resource "google_integration_connectors_connection" "testconnection" {
name = "test-connection"
description = "tf updated description"
location = "us-central1"
service_account = "${data.google_project.default.number}[email protected]"
connector_version = "projects/${data.google_project.default.project_id}/locations/global/providers/zendesk/connectors/zendesk/versions/1"
// These show all the different types of config variables, not necessary that each resource will use everything.
config_variable {
key = "proxy_enabled"
boolean_value = false
}
config_variable {
key = "sample_integer_value"
integer_value = 1
}

config_variable {
key = "sample_encryption_key_value"
encryption_key_value {
type = "GOOGLE_MANAGED"
kms_key_name = "sampleKMSKkey"
}
}

config_variable {
key = "sample_secret_value"
secret_value {
secret_version = google_secret_manager_secret_version.default.name
}
}

suspended = false
auth_config {
// These show all the different types of additional variables, not necessary that each resource will use everything.
additional_variable {
key = "sample_string"
string_value = "sampleString"
}
additional_variable {
key = "sample_boolean"
boolean_value = false
}
additional_variable {
key = "sample_integer"
integer_value = 1
}
additional_variable {
key = "sample_secret_value"
secret_value {
secret_version = google_secret_manager_secret_version.default.name
}
}
additional_variable {
key = "sample_encryption_key_value"
encryption_key_value {
type = "GOOGLE_MANAGED"
kms_key_name = "sampleKMSKkey"
}
}
auth_type = "USER_PASSWORD"
auth_key = "sampleAuthKey"
user_password {
username = "[email protected]"
password {
secret_version = google_secret_manager_secret_version.default.name
}
}
}

destination_config {
key = "url"
destination {
host = "https://test.zendesk.com"
port = 80
}
}
lock_config {
locked = false
reason = "Its not locked"
}
log_config {
enabled = true
}
node_config {
min_node_count = 2
max_node_count = 50
}
labels = {
foo = "bar"
}
ssl_config {
// These show all the different types of additional variables, not necessary that each resource will use everything.
additional_variable {
key = "sample_string"
string_value = "sampleString"
}
additional_variable {
key = "sample_boolean"
boolean_value = false
}
additional_variable {
key = "sample_integer"
integer_value = 1
}
additional_variable {
key = "sample_secret_value"
secret_value {
secret_version = google_secret_manager_secret_version.default.name
}
}
additional_variable {
key = "sample_encryption_key_value"
encryption_key_value {
type = "GOOGLE_MANAGED"
kms_key_name = "sampleKMSKkey"
}
}
client_cert_type = "PEM"
client_certificate {
secret_version = google_secret_manager_secret_version.default.name
}
client_private_key {
secret_version = google_secret_manager_secret_version.default.name
}
client_private_key_pass {
secret_version = google_secret_manager_secret_version.default.name
}
private_server_certificate {
secret_version = google_secret_manager_secret_version.default.name
}
server_cert_type = "PEM"
trust_model = "PRIVATE"
type = "TLS"
use_ssl = true
}

eventing_enablement_type = "EVENTING_AND_CONNECTION"
eventing_config {
// These show all the different types of additional variables, not necessary that each resource will use everything.
additional_variable {
key = "sample_string"
string_value = "sampleString"
}
additional_variable {
key = "sample_boolean"
boolean_value = false
}
additional_variable {
key = "sample_integer"
integer_value = 1
}
additional_variable {
key = "sample_secret_value"
secret_value {
secret_version = google_secret_manager_secret_version.default.name
}
}
additional_variable {
key = "sample_encryption_key_value"
encryption_key_value {
type = "GOOGLE_MANAGED"
kms_key_name = "sampleKMSKkey"
}
}
registration_destination_config {
key = "registration_destination_config"
destination {
host = "https://test.zendesk.com"
port = 80
}
}
auth_config {
auth_type = "USER_PASSWORD"
auth_key = "sampleAuthKey"
user_password {
username = "[email protected]"
password {
secret_version = google_secret_manager_secret_version.default.name
}
}
// These show all the different types of additional variables, not necessary that each resource will use everything.
additional_variable {
key = "sample_string"
string_value = "sampleString"
}
additional_variable {
key = "sample_boolean"
boolean_value = false
}
additional_variable {
key = "sample_integer"
integer_value = 1
}
additional_variable {
key = "sample_secret_value"
secret_value {
secret_version = google_secret_manager_secret_version.default.name
}
}
additional_variable {
key = "sample_encryption_key_value"
encryption_key_value {
type = "GOOGLE_MANAGED"
kms_key_name = "sampleKMSKkey"
}
}
}
enrichment_enabled = true
}
depends_on = [google_secret_manager_secret_iam_member.default]
}
# [END integrationconnectors_connection_example]
20 changes: 20 additions & 0 deletions integrationconnectors/advanced/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: blueprints.cloud.google.com/v1alpha1
kind: BlueprintTest
metadata:
name: integration_connectors_add_tag
spec:
skip: true
3 changes: 2 additions & 1 deletion test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module "projects" {
"secretmanager.googleapis.com",
"sqladmin.googleapis.com",
"workflows.googleapis.com",
"osconfig.googleapis.com"
"osconfig.googleapis.com",
"connectors.googleapis.com"
]
}

0 comments on commit 24645bf

Please sign in to comment.