-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand Terraform for Developer Connect #12391
Open
ihnarayanan
wants to merge
16
commits into
GoogleCloudPlatform:main
Choose a base branch
from
ihnarayanan:dc-terraform
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c95c0f8
Add terraform GitHub Enterprise, GitLab, and GitLab Enterprise to Dev…
ihnarayanan 42d47c5
Add fix for Gitlab connection tests
ihnarayanan a9ef9bc
Add fix for Gitlab Connection test
ihnarayanan 61d2f7a
Add fix for Gitlab Connection test
ihnarayanan 10f5d1f
Add fixes for all tests
ihnarayanan 7adb99b
Add fix for GHE Connection test
ihnarayanan 3593a30
Add update tests
ihnarayanan 24c628c
Adding update tests
ihnarayanan dd286ee
Add fix for GHE and GLE priv connection
ihnarayanan d31e1b7
Merge branch 'main' into dc-terraform
ihnarayanan ae3bb93
Merge branch 'GoogleCloudPlatform:main' into dc-terraform
ihnarayanan 75b0abd
Fix breaking changes
ihnarayanan dfe76f6
fix yaml formatting
ihnarayanan 0a6f24d
Add updated doc examples
ihnarayanan d9f5d97
remove changes to git repository link resource
ihnarayanan 5c5268f
remove all changes to file
ihnarayanan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
1 change: 0 additions & 1 deletion
1
...eveloper_connect_connection_basic.tf.tmpl → ...veloper_connect_connection_github.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
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
12 changes: 12 additions & 0 deletions
12
mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise.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,12 @@ | ||
resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { | ||
location = "us-central1" | ||
connection_id = "{{index $.Vars "connection_name"}}" | ||
|
||
github_enterprise_config { | ||
host_uri = "https://ghe.proctor-staging-test.com" | ||
app_id = 864434 | ||
private_key_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-private-key-f522d2/versions/latest" | ||
webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/tf-test-ghe-do-not-change-ghe-webhook-secret-3c806f/versions/latest" | ||
app_installation_id = 837537 | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
mmv1/templates/terraform/examples/developer_connect_connection_github_enterprise_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,61 @@ | ||
resource "google_secret_manager_secret" "private-key-secret" { | ||
secret_id = "ghe-pk-secret" | ||
|
||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "private-key-secret-version" { | ||
secret = google_secret_manager_secret.private-key-secret.id | ||
secret_data = file("private-key.pem") | ||
} | ||
|
||
resource "google_secret_manager_secret" "webhook-secret-secret" { | ||
secret_id = "ghe-token-secret" | ||
|
||
replication { | ||
auto {} | ||
} | ||
} | ||
|
||
resource "google_secret_manager_secret_version" "webhook-secret-secret-version" { | ||
secret = google_secret_manager_secret.webhook-secret-secret.id | ||
secret_data = "<webhook-secret-data>" | ||
} | ||
|
||
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-pk" { | ||
secret_id = google_secret_manager_secret.private-key-secret.secret_id | ||
policy_data = data.google_iam_policy.p4sa-secretAccessor.policy_data | ||
} | ||
|
||
resource "google_secret_manager_secret_iam_policy" "policy-whs" { | ||
secret_id = google_secret_manager_secret.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" | ||
|
||
github_enterprise_config { | ||
host_uri = "https://ghe.com" | ||
private_key_secret_version = google_secret_manager_secret_version.private-key-secret-version.id | ||
webhook_secret_secret_version = google_secret_manager_secret_version.webhook-secret-secret-version.id | ||
app_id = 100 | ||
app_installation_id = 123123 | ||
} | ||
|
||
depends_on = [ | ||
google_secret_manager_secret_iam_policy.policy-pk, | ||
google_secret_manager_secret_iam_policy.policy-whs | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
mmv1/templates/terraform/examples/developer_connect_connection_gitlab.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,16 @@ | ||
resource "google_developer_connect_connection" "{{$.PrimaryResourceId}}" { | ||
location = "us-central1" | ||
connection_id = "{{index $.Vars "connection_name"}}" | ||
|
||
gitlab_config { | ||
webhook_secret_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-webhook/versions/latest" | ||
|
||
read_authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-read-cred/versions/latest" | ||
} | ||
|
||
authorizer_credential { | ||
user_token_secret_version = "projects/devconnect-terraform-creds/secrets/gitlab-auth-cred/versions/latest" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind moving the changes of this file to a separate PR? This PR is too large and difficult to review. It is easy to missing something during the code review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed all changes and associated test files. Kept file in PR to promote to GA so as to not break the provider.