Skip to content

Commit 572726a

Browse files
authored
Merge branch 'main' into fix-root-ca-sample
2 parents ee34cf8 + 01fdda0 commit 572726a

File tree

78 files changed

+794
-164
lines changed

Some content is hidden

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

78 files changed

+794
-164
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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.21
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424
DOCKER_BIN ?= docker
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]

bigquery/bigquery_create_reservation/main.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
# [START bigquery_create_reservation_assignment]
1718
# [START bigquery_create_reservation]
1819
resource "google_bigquery_reservation" "default" {
1920
name = "my-reservation"
@@ -27,3 +28,12 @@ resource "google_bigquery_reservation" "default" {
2728
}
2829
}
2930
# [END bigquery_create_reservation]
31+
32+
data "google_project" "project" {}
33+
34+
resource "google_bigquery_reservation_assignment" "default" {
35+
assignee = "projects/${data.google_project.project.project_id}"
36+
job_type = "QUERY"
37+
reservation = google_bigquery_reservation.default.id
38+
}
39+
# [END bigquery_create_reservation_assignment]
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]

0 commit comments

Comments
 (0)