Skip to content

Commit ccc3126

Browse files
authored
Merge branch 'main' into ap/dir-specific-tests
2 parents 962856d + b4d3cbf commit ccc3126

File tree

67 files changed

+520
-168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+520
-168
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
# Overall sample owners
22

33
* @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/terraform-samples-reviewers
4-
/.github/ @terraform-google-modules/terraform-samples-git-admins
5-
/test/ @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/cft-admins
6-
/build/ @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/cft-admins
4+
/* @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/terraform-samples-reviewers @terraform-google-modules/cloud-samples-infra
5+
/.github/ @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/cloud-samples-infra
6+
/test/ @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/cft-admins @terraform-google-modules/cloud-samples-infra
7+
/build/ @terraform-google-modules/terraform-samples-git-admins @terraform-google-modules/cft-admins @terraform-google-modules/cloud-samples-infra
8+
79
/bigquery/ @terraform-google-modules/bigquery-terraform-swe @terraform-google-modules/terraform-samples-reviewers
8-
/cloud_scheduler/ @terraform-google-modules/terraform-samples-reviewers
910
/cloud_sql/ @terraform-google-modules/infra-db-sdk @terraform-google-modules/terraform-samples-reviewers
1011
/cloudvpn/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
1112
/composer/ @terraform-google-modules/cloud-dpes-composer @terraform-google-modules/terraform-samples-reviewers
1213
/compute/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
1314
/dns/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
14-
/eventarc/ @terraform-google-modules/torus-dpe @terraform-google-modules/terraform-samples-reviewers
15-
/functions/ @terraform-google-modules/torus-dpe @terraform-google-modules/terraform-samples-reviewers
1615
/gke/ @terraform-google-modules/eks-team @terraform-google-modules/terraform-samples-reviewers
1716
/lb/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
1817
/looker/ @terraform-google-modules/cloud-looker-docs @terraform-google-modules/terraform-samples-reviewers
1918
/media_cdn/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
2019
/network_connectivity/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
2120
/privateca/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
22-
/run/ @terraform-google-modules/torus-dpe @terraform-google-modules/terraform-samples-reviewers
2321
/storage/ @terraform-google-modules/cloud-storage-dpe @terraform-google-modules/terraform-samples-reviewers
2422
/traffic_director/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
25-
/vertex_ai/ @terraform-google-modules/dee-data-ai @terraform-google-modules/terraform-samples-reviewers
2623
/vpc/ @terraform-google-modules/dee-infra @terraform-google-modules/terraform-samples-reviewers
27-
/workflows/ @terraform-google-modules/torus-dpe @terraform-google-modules/terraform-samples-reviewers
2824
/managedkafka/ @terraform-google-modules/managedkafka-dev-team @terraform-google-modules/terraform-samples-reviewers

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343
REGISTRY=$(grep "REGISTRY_URL := " $MAKEFILE | cut -d\ -f3)
4444
echo dev-tools=${REGISTRY}/${IMAGE}:${VERSION} >> "$GITHUB_OUTPUT"
4545
fi
46-
- run: docker run --rm -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
46+
- run: docker run --rm -e ENABLE_PARALLEL=1 -v ${{ github.workspace }}:/workspace ${{ steps.variables.outputs.dev-tools }} /usr/local/bin/test_lint.sh
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START bigquery_create_dataset_attach_tag]
18+
19+
# Create tag keys and values
20+
data "google_project" "default" {}
21+
22+
resource "google_tags_tag_key" "env_tag_key" {
23+
parent = "projects/${data.google_project.default.project_id}"
24+
short_name = "env2"
25+
}
26+
27+
resource "google_tags_tag_key" "department_tag_key" {
28+
parent = "projects/${data.google_project.default.project_id}"
29+
short_name = "department2"
30+
}
31+
32+
resource "google_tags_tag_value" "env_tag_value" {
33+
parent = "tagKeys/${google_tags_tag_key.env_tag_key.name}"
34+
short_name = "prod"
35+
}
36+
37+
resource "google_tags_tag_value" "department_tag_value" {
38+
parent = "tagKeys/${google_tags_tag_key.department_tag_key.name}"
39+
short_name = "sales"
40+
}
41+
42+
# Create a dataset
43+
resource "google_bigquery_dataset" "default" {
44+
dataset_id = "my_dataset"
45+
default_partition_expiration_ms = 2592000000 # 30 days
46+
default_table_expiration_ms = 31536000000 # 365 days
47+
description = "dataset description"
48+
location = "US"
49+
max_time_travel_hours = 96 # 4 days
50+
51+
# Attach tags to the dataset
52+
resource_tags = {
53+
(google_tags_tag_key.env_tag_key.namespaced_name) : google_tags_tag_value.env_tag_value.short_name,
54+
(google_tags_tag_key.department_tag_key.namespaced_name) : google_tags_tag_value.department_tag_value.short_name
55+
}
56+
}
57+
# [END bigquery_create_dataset_attach_tag]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START bigquery_create_reservation_assignment_none]
18+
data "google_project" "project" {}
19+
20+
resource "google_bigquery_reservation_assignment" "default" {
21+
assignee = "projects/${data.google_project.project.project_id}"
22+
job_type = "QUERY"
23+
reservation = "projects/${data.google_project.project.project_id}/locations/us/reservations/none"
24+
}
25+
# [END bigquery_create_reservation_assignment_none]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START bigquery_create_table_attach_tag]
18+
19+
# Create tag keys and values
20+
data "google_project" "default" {}
21+
22+
resource "google_tags_tag_key" "env_tag_key" {
23+
parent = "projects/${data.google_project.default.project_id}"
24+
short_name = "env3"
25+
}
26+
27+
resource "google_tags_tag_key" "department_tag_key" {
28+
parent = "projects/${data.google_project.default.project_id}"
29+
short_name = "department3"
30+
}
31+
32+
resource "google_tags_tag_value" "env_tag_value" {
33+
parent = "tagKeys/${google_tags_tag_key.env_tag_key.name}"
34+
short_name = "prod"
35+
}
36+
37+
resource "google_tags_tag_value" "department_tag_value" {
38+
parent = "tagKeys/${google_tags_tag_key.department_tag_key.name}"
39+
short_name = "sales"
40+
}
41+
42+
# Create a dataset
43+
resource "google_bigquery_dataset" "default" {
44+
dataset_id = "MyDataset"
45+
default_partition_expiration_ms = 2592000000 # 30 days
46+
default_table_expiration_ms = 31536000000 # 365 days
47+
description = "dataset description"
48+
location = "US"
49+
max_time_travel_hours = 96 # 4 days
50+
}
51+
52+
# Create a table
53+
resource "google_bigquery_table" "default" {
54+
dataset_id = google_bigquery_dataset.default.dataset_id
55+
table_id = "mytable"
56+
description = "table description"
57+
deletion_protection = false # set to "true" in production
58+
59+
# Attach tags to the table
60+
resource_tags = {
61+
(google_tags_tag_key.env_tag_key.namespaced_name) : google_tags_tag_value.env_tag_value.short_name,
62+
(google_tags_tag_key.department_tag_key.namespaced_name) : google_tags_tag_value.department_tag_value.short_name
63+
}
64+
}
65+
# [END bigquery_create_table_attach_tag]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintTest
17+
metadata:
18+
name: bigquery_bigquery_create_table_attach_tag
19+
spec:
20+
skip: true
21+
22+
# https://github.com/hashicorp/terraform-provider-google/issues/19362
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START bigquery_tags_tag_key]
18+
data "google_project" "default" {}
19+
20+
resource "google_tags_tag_key" "env_tag_key" {
21+
parent = "projects/${data.google_project.default.project_id}"
22+
short_name = "env"
23+
}
24+
25+
resource "google_tags_tag_key" "department_tag_key" {
26+
parent = "projects/${data.google_project.default.project_id}"
27+
short_name = "department"
28+
}
29+
# [END bigquery_tags_tag_key]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START bigquery_tags_tag_value]
18+
data "google_project" "default" {}
19+
20+
resource "google_tags_tag_key" "env_tag_key" {
21+
parent = "projects/${data.google_project.default.project_id}"
22+
short_name = "env1"
23+
}
24+
25+
resource "google_tags_tag_key" "department_tag_key" {
26+
parent = "projects/${data.google_project.default.project_id}"
27+
short_name = "department1"
28+
}
29+
30+
resource "google_tags_tag_value" "env_tag_value" {
31+
parent = "tagKeys/${google_tags_tag_key.env_tag_key.name}"
32+
short_name = "prod"
33+
}
34+
35+
resource "google_tags_tag_value" "department_tag_value" {
36+
parent = "tagKeys/${google_tags_tag_key.department_tag_key.name}"
37+
short_name = "sales"
38+
}
39+
# [END bigquery_tags_tag_value]

cloud_sql/instance_ssl_cert/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resource "google_sql_database_instance" "mysql_instance" {
2222
settings {
2323
tier = "db-f1-micro"
2424
ip_configuration {
25-
require_ssl = "true"
25+
ssl_mode = "ENCRYPTED_ONLY"
2626
}
2727
}
2828
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
@@ -46,7 +46,7 @@ resource "google_sql_database_instance" "postgres_instance" {
4646
settings {
4747
tier = "db-custom-2-7680"
4848
ip_configuration {
49-
require_ssl = "true"
49+
ssl_mode = "ENCRYPTED_ONLY"
5050
}
5151
}
5252
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
@@ -71,7 +71,7 @@ resource "google_sql_database_instance" "sqlserver_instance" {
7171
settings {
7272
tier = "db-custom-2-7680"
7373
ip_configuration {
74-
require_ssl = "true"
74+
ssl_mode = "ENCRYPTED_ONLY"
7575
}
7676
}
7777
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by

cloud_sql/mysql_instance_ssl_cert/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ resource "google_sql_database_instance" "mysql_instance" {
2525
# The following SSL enforcement options only allow connections encrypted with SSL/TLS and with
2626
# valid client certificates. Please check the API reference for other SSL enforcement options:
2727
# https://cloud.google.com/sql/docs/postgres/admin-api/rest/v1beta4/instances#ipconfiguration
28-
require_ssl = "true"
29-
ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
28+
ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
3029
}
3130
}
3231
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by

0 commit comments

Comments
 (0)