-
Notifications
You must be signed in to change notification settings - Fork 286
feat: Adding examples for integrationconnectors endpointattachment and managed zone #751
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Copyright 2024 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. | ||
*/ | ||
|
||
# [START integrationconnectors_endpoint_attachment_example] | ||
resource "google_integration_connectors_endpoint_attachment" "default" { | ||
glasnt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name = "test-endpoint-attachment" | ||
location = "us-central1" | ||
description = "tf created description" | ||
service_attachment = "projects/connectors-example/regions/us-central1/serviceAttachments/test" | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
labels = { | ||
foo = "bar" | ||
} | ||
} | ||
# [END integrationconnectors_endpoint_attachment_example] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Copyright 2024 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. | ||
*/ | ||
|
||
# This is the target project where you host the cloud DNS mapping, this can also be the current project | ||
data "google_project" "target_project" { | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
resource "google_project_iam_member" "default" { | ||
project = data.google_project.target_project.project_id | ||
role = "roles/dns.peer" | ||
member = "serviceAccount:service-${data.google_project.test_project.number}@gcp-sa-connectors.iam.gserviceaccount.com" | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
resource "google_compute_network" "default" { | ||
project = data.google_project.target_project.project_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After renaming to |
||
name = "test" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are showing that you should be creating a custom network in this example, you should suggest a better name than "test". (While this code is example code, it should have production best practices, as it is intended to be copied by users) |
||
auto_create_subnetworks = false | ||
} | ||
|
||
resource "google_dns_managed_zone" "default" { | ||
name = "test-dns" | ||
dns_name = "private.example.com." | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
visibility = "private" | ||
|
||
private_visibility_config { | ||
networks { | ||
network_url = google_compute_network.default.id | ||
} | ||
} | ||
} | ||
|
||
# This is the current project. | ||
data "google_project" "test_project" { | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
# [START integrationconnectors_managed_zone_example] | ||
balanaguharsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
resource "google_integration_connectors_managed_zone" "test_managed_zone" { | ||
name = "test-managed-zone" | ||
description = "tf created resource" | ||
labels = { | ||
intent = "example" | ||
} | ||
target_project = data.google_project.target_project.project_id | ||
target_vpc = "test" | ||
dns = google_dns_managed_zone.default.dns_name | ||
depends_on = [google_project_iam_member.default] | ||
} | ||
# [END integrationconnectors_managed_zone_example] |
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 |
Uh oh!
There was an error while loading. Please reload this page.