-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ee445e
commit 66100cd
Showing
6 changed files
with
573 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
mmv1/templates/terraform/examples/developer_connect_connection_bbc.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { | ||
location = "us-central1" | ||
connection_id = "{{index $.Vars "connection_name"}}" | ||
|
||
bitbucket_cloud_config { | ||
workspace = "proctor-test-dc" | ||
webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/bbc-webhook/versions/latest" | ||
|
||
read_authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/bbc-read-token/versions/latest" | ||
} | ||
|
||
authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/bbc-auth-token/versions/latest" | ||
} | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
mmv1/templates/terraform/examples/developer_connect_connection_bbc_doc.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
resource "google_secret_manager_secret" "bbc-read-cred-secret" { | ||
secret_id = "bbc-read-cred" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbc-read-cred-secret-version" { | ||
secret = google_secret_manager_secret.bbc-read-cred-secret.id | ||
secret_data = file("my-bbc-read-cred.txt") | ||
} | ||
|
||
resource "google_secret_manager_secret" "bbc-auth-cred-secret" { | ||
secret_id = "bbc-auth-cred" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbc-auth-cred-secret-version" { | ||
secret = google_secret_manager_secret.bbc-auth-cred-secret.id | ||
secret_data = file("my-bbc-auth-cred.txt") | ||
} | ||
|
||
resource "google_secret_manager_secret" "bbc-webhook-secret-secret" { | ||
secret_id = "bbc-webhook-secret" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbc-webhook-secret-secret-version" { | ||
secret = google_secret_manager_secret.bbc-webhook-secret-secret.id | ||
secret_data = file("my-bbc-webhook-secret.txt") | ||
|
||
data "google_iam_policy" "p4sa-secretAccessor" { | ||
binding { | ||
role = "roles/secretmanager.secretAccessor" | ||
// Here, 123456789 is the Google Cloud project number for the project that contains the connection. | ||
members = ["serviceAccount:[email protected]"] | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-rc" { | ||
secret_id = google_secret_manager_secret.bbc-read-cred-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-ac" { | ||
secret_id = google_secret_manager_secret.bbc-auth-cred-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-wh" { | ||
secret_id = google_secret_manager_secret.bbc-webhook-secret-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_developer_connect_connection" "my-connection" { | ||
|
||
location = "us-central1" | ||
connection_id = "my-connection" | ||
|
||
bitbucket_cloud_config { | ||
workspace = "test-workspace" | ||
|
||
webhook_secret_secret_version = google_secret_manager_secret_version.bbc-webhook-secret-secret-version.id | ||
|
||
read_authorizer_credential { | ||
user_token_secret_version = google_secret_manager_secret_version.bbc-read-cred-secret-version.id | ||
} | ||
|
||
authorizer_credential { | ||
user_token_secret_version = google_secret_manager_secret_version.bbc-auth-cred-secret-version.id | ||
} | ||
} | ||
|
||
depends_on = [ | ||
google_secret_manager_secret_iam_policy.policy-rc, | ||
google_secret_manager_secret_iam_policy.policy-ac, | ||
google_secret_manager_secret_iam_policy.policy-wh | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
mmv1/templates/terraform/examples/developer_connect_connection_bbdc.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { | ||
location = "us-central1" | ||
connection_id = "{{index $.Vars "connection_name"}}" | ||
|
||
bitbucket_data_center_config { | ||
host_uri = "https://bitbucket-us-central.gcb-test.com" | ||
|
||
webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/bbdc-webhook/versions/latest" | ||
|
||
read_authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/bbdc-read-token/versions/latest" | ||
} | ||
|
||
authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/bbdc-auth-token/versions/latest" | ||
} | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
mmv1/templates/terraform/examples/developer_connect_connection_bbdc_doc.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
resource "google_secret_manager_secret" "bbdc-read-cred-secret" { | ||
secret_id = "bbdc-read-cred" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbdc-read-cred-secret-version" { | ||
secret = google_secret_manager_secret.bbdc-read-cred-secret.id | ||
secret_data = file("my-bbdc-read-cred.txt") | ||
} | ||
|
||
resource "google_secret_manager_secret" "bbdc-auth-cred-secret" { | ||
secret_id = "bbdc-auth-cred" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbdc-auth-cred-secret-version" { | ||
secret = google_secret_manager_secret.bbdc-auth-cred-secret.id | ||
secret_data = file("my-bbdc-auth-cred.txt") | ||
} | ||
|
||
resource "google_secret_manager_secret" "bbdc-webhook-secret-secret" { | ||
secret_id = "bbdc-webhook-secret" | ||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "bbdc-webhook-secret-secret-version" { | ||
secret = google_secret_manager_secret.bbdc-webhook-secret-secret.id | ||
secret_data = file("my-bbdc-webhook-secret.txt") | ||
|
||
data "google_iam_policy" "p4sa-secretAccessor" { | ||
binding { | ||
role = "roles/secretmanager.secretAccessor" | ||
// Here, 123456789 is the Google Cloud project number for the project that contains the connection. | ||
members = ["serviceAccount:[email protected]"] | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-rc" { | ||
secret_id = google_secret_manager_secret.bbdc-read-cred-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-ac" { | ||
secret_id = google_secret_manager_secret.bbdc-auth-cred-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-wh" { | ||
secret_id = google_secret_manager_secret.bbdc-webhook-secret-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_developer_connect_connection" "my-connection" { | ||
|
||
location = "us-central1" | ||
connection_id = "my-connection" | ||
|
||
bitbucket_data_center_config { | ||
host_uri = "https://bitbucket-test-server.com" | ||
|
||
webhook_secret_secret_version = google_secret_manager_secret_version.bbdc-webhook-secret-secret-version.id | ||
|
||
read_authorizer_credential { | ||
user_token_secret_version = google_secret_manager_secret_version.bbdc-read-cred-secret-version.id | ||
} | ||
|
||
authorizer_credential { | ||
user_token_secret_version = google_secret_manager_secret_version.bbdc-auth-cred-secret-version.id | ||
} | ||
} | ||
|
||
depends_on = [ | ||
google_secret_manager_secret_iam_policy.policy-rc, | ||
google_secret_manager_secret_iam_policy.policy-ac, | ||
google_secret_manager_secret_iam_policy.policy-wh | ||
] | ||
} |
Oops, something went wrong.