-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ci: Initial Terraform configurations (Work in Progress) #8436
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
Closed
Closed
Changes from 94 commits
Commits
Show all changes
111 commits
Select commit
Hold shift + click to select a range
1d3f47c
ci: Initial Terraform configurations (Work in Progress)
burkedavison fb6b240
ci: Add Terraform scripts and configurations for java-accessapproval,…
burkedavison fe40718
fix: Remove hardcoded project prefix, and replace with environment va…
burkedavison 65ff848
fix: Ensure 'set-quota-project' is set to the created GCP project. De…
burkedavison 6f89ea6
fix: Workaround set-quota-project not working when previous quota pro…
burkedavison dad488e
chore: Add 'auto_create_subnetworks' to container network configuration.
burkedavison 3959735
fix: Add predestroy stage. Remove container network from tfstate to a…
burkedavison 3fbf756
chore: Refactor script to split project and module provisioning. Supp…
burkedavison 061b666
chore: Add java-compute terraform config
burkedavison 9eaac54
chore: Add java-containeranalysis terraform config
burkedavison 1ddad88
chore: Add java-datacatalog terraform config
burkedavison 638566e
chore: Add java-datalabeling terraform config
burkedavison 45dfae5
chore: Add java-errorreporting terraform config
burkedavison 1aee4e1
chore: Add java-game-servers terraform config
burkedavison 57a1ef3
chore: Add java-iot terraform config
burkedavison 52b4884
chore: Add java-kms terraform config
burkedavison fdf8198
chore: Add java-monitoring terraform config
burkedavison 4c93bcb
chore: Add java-resourcemanager terraform config
burkedavison d8d5727
chore: Add java-secretmanager terraform config
burkedavison cbe9b98
chore: Add java-speech terraform config
burkedavison cf3c219
chore: Add java-trace terraform config
burkedavison f7543ae
chore: Add java-translate terraform config
burkedavison d5b11ca
chore: Add java-video-intelligence terraform config
burkedavison 57aebd8
chore: Add java-vision terraform config
burkedavison 5e8a943
chore: Refactor solution to use single generated Terraform root modul…
burkedavison 3a817cf
chore: Add java-asset
burkedavison 85d4ace
chore: Add java-iam-admin
burkedavison e13a6e9
chore: Add java-notebooks
burkedavison 72a0d60
chore: Add java-texttospeech
burkedavison 8594ff7
chore: Add java-dataproc
burkedavison 51f1fd8
chore: Add java-tasks
burkedavison 8f27d2a
fix: Remove unintentional .kokoro/build.sh modification.
burkedavison 7efd5d4
fix: Ensure compute API is enabled prior to requesting compute defaul…
burkedavison cacbcec
chore: Create and Impersonate a Service Account on the Terraform-crea…
burkedavison 13c2f1b
chore: Add java-dns terraform configuration
burkedavison 329748c
chore: Add java-dialogflow and java-dialogflow-cx terraform configura…
burkedavison c75f5c8
fix: Ensure environment variables are correctly added when performing…
burkedavison 41f1325
fix: Fail fast if terraform apply fails.
burkedavison 8cecc8d
chore: Rework module output and env.sh design to eliminate need for f…
burkedavison ecfdd45
chore: Add java-notification support
burkedavison 327c613
fix: Ensure environment variables are set with script if not already …
burkedavison 977ce54
fix: Add time delay to allow role/permissions to apply to service acc…
burkedavison 6c25de7
fix: Relocate invocation of generated-env.sh to ensure consistent app…
burkedavison 3d4cc93
chore: Support 'y' argument to destroy.sh to destroy the project non-…
burkedavison 5b71c3f
fix: Destroy modules before project to ensure clean starting point fo…
burkedavison 36f146d
chore: Add test-individually.sh, which iterates through each terrafor…
burkedavison 1f86837
fix: Apply predestroy.sh to <root>/.terraform state.
burkedavison cd1b082
chore: Add java-scheduler, although not yet reliable.
burkedavison 03ef514
chore: Add java-oslogin. Not currently working.
burkedavison 9ae6b1a
fix: Rework of Terraform logic to use single root module. Project and…
burkedavison 74a6728
fix: cleanup
burkedavison 040d9a3
fix: Ensure cloudresourcemanager.googleapis.com is enabled prior to s…
burkedavison be9b07c
Merge branch 'main' into terraform
burkedavison a50e5fd
fix: Workaround for 'Resource Exhausted' error given first time runni…
burkedavison 01b0570
fix: Re-enable job and topic deletions during Scheduler IT clean up.
burkedavison 5e05e29
fix: Re-enable application-default login and add delay after enabling…
burkedavison 8d3ded0
fix: Apply retry to v1beta1 Scheduler IT
burkedavison 42e677d
fix: Sleep immediately after gcloud project creation to allow default…
burkedavison 30da4a1
fix: Add 10s delay after creating service account and before assignin…
burkedavison 6a8b09a
fix: Replace compound assertion statement with fine-grain assertions …
burkedavison 2529c10
Merge remote-tracking branch 'origin/terraform' into terraform
burkedavison 7ee1e2a
fix: Add delay to allow service account permissions to settle.
burkedavison 70ce173
chore: Handle generated-outputs.template.tf same as generated-main+va…
burkedavison e1f2f03
fix: Assign gcloud_account local variable before using it. Comment im…
burkedavison eb9a2f1
fix: Synchronize environment using common script when entering indivi…
burkedavison 68e6e14
fix: Fail ITHeadersTest if server does not respond to request, rather…
burkedavison 854dac7
fix: Sleep syntax, and no longer sync environment before apply.sh
burkedavison c800cdc
fix: DRY and remove unnecessary resources from template.
burkedavison 5c204bd
Revert "fix: Fail ITHeadersTest if server does not respond to request…
burkedavison 82de4ef
chore: Explicit error when headers is null.
burkedavison 3b8c01b
chore: Make API enabling and disabling behaviors variables, following…
burkedavison ff29a16
fix: Increase retries and retry delay in Scheduler IT to ensure enoug…
burkedavison 7eb3309
fix: Add region to submodule input object. Fix typo.
burkedavison dd7a68e
Merge branch 'main' into terraform
burkedavison acc1c28
fix: When running ITs with terraform, ignore os-login, recommender, a…
burkedavison 77fec0e
chore: DRY friendly output module name, and module output value parsing.
burkedavison 41bc320
fix: Randomize Dialogflow Agent name.
burkedavison 8629ecd
fix: Randomize Container Network name.
burkedavison cacb6ed
fix: Attempt to refresh Terraform's state if no project ID is in its …
burkedavison 69a760d
chore: Add java-recommender Terraform configuration, and adjust IT to…
burkedavison 75c031d
chore: Improve ./.terraform/README.md
burkedavison 92fa513
fix: Only invoke predestroy.sh for active modules.
burkedavison d6a936f
chore: Refactor all Terraform project setup steps into setup.sh
burkedavison fb6b69a
chore: Add java-talent Terraform configuration
burkedavison 09cf5cb
chore: Simplify
burkedavison 1a06ff9
fix: Consistent application of variable rename
burkedavison 8611e97
fix: Wait 60s after service account creation to mitigate errors due t…
burkedavison 3f18991
chore: Slightly lengthen initialization waiting time for service acco…
burkedavison b891f4d
fix: Additional delay and comment around scheduler retry.
burkedavison 5778d9b
chore: Remove ./.terraform/README.md while offline review continues.
burkedavison 8604095
Merge branch 'main' into terraform
burkedavison 0c917af
fix: Don't prepend "serviceAccount:" when using member "allAuthentica…
burkedavison f479750
Merge branch 'main' into terraform
burkedavison f8277b8
chore: Change module delimiter from ':' to ',' for consistency with .…
burkedavison 843c440
Merge branch 'main' into terraform
burkedavison 0fef18c
chore: Split 'gcloud' steps from 'terraform' steps in preparation for…
burkedavison 483dea6
fix: Return to previous working directory after plan.sh
burkedavison c5264f9
chore: Use set -eo pipefail rather than explicit "|| exit"
burkedavison 42b099b
Merge branch 'main' into terraform
burkedavison 70527ff
chore: Remove 'test-individually.sh'
burkedavison bc34548
fix: Ignore 'java-recommender' IT rather than modifying logic.
burkedavison 56abe0c
Merge branch 'main' into terraform
burkedavison 0db282c
chore: release main (#8610)
release-please[bot] 6420712
build: have release-please tag releases (#8615)
chingor13 023793d
Merge branch 'main' into terraform
burkedavison ddae556
Merge branch 'main' into terraform
burkedavison 3f9b482
fix: Revert ITHeadersTest changes to same as main
burkedavison 5ac7c07
fix: Remove unused import
burkedavison a6dfc72
fix: Apply mvn com.coveo:fmt-maven-plugin:format
burkedavison 09abe52
ci: Terraform now used in Kokoro integration tests
burkedavison 23c4a91
ci: Temporarily disable Terraform in integration tests
burkedavison 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
This file contains hidden or 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 hidden or 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,7 @@ | ||
| generated.tfplan | ||
| generated.tfplan.json | ||
| generated.auto.tfvars | ||
| generated-env.sh | ||
| generated-main.tf | ||
| generated-outputs.tf | ||
| generated-variables.tf |
This file contains hidden or 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 @@ | ||
| # | ||
| # 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 | ||
| # | ||
| # https://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. | ||
| # | ||
|
|
||
| scriptDir="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" | ||
| pushd "$scriptDir" >/dev/null || exit | ||
|
|
||
| # Ensure GCP project environment variables are initialized. | ||
| if [[ $(terraform state list) == "" ]]; then | ||
| echo "Nothing to destroy." | ||
| exit | ||
| fi | ||
|
|
||
| # @returns exit code 0 if list $1 contains entry $2. | ||
| function contains() { | ||
| echo "$1" | grep -w -q "$2" | ||
| } | ||
|
|
||
| source ./helpers/sync-env.sh | ||
|
|
||
| # Execute 'predestroy.sh' scripts for any active modules | ||
| allModules=$(source ./helpers/list-all-modules.sh) | ||
| activeModules=$(terraform state list | awk -F'[/.]' '{print $2}' | uniq) | ||
| IFS=',' | ||
| for module in $allModules; do | ||
| friendlyName=$(source ./helpers/get-output-friendly-name.sh "$module") | ||
| if ! contains "$activeModules" "$friendlyName"; then | ||
| continue # Skip unless active. | ||
| fi | ||
|
|
||
| if [[ -f "../$module/.terraform/predestroy.sh" ]]; then | ||
| # shellcheck disable=SC1090 | ||
| source "../$module/.terraform/predestroy.sh" | ||
| fi | ||
| done | ||
|
|
||
| terraform destroy -auto-approve || exit | ||
|
|
||
| # Always verify whether or not to destroy the project. | ||
| echo -n "Delete project ($terraform_project_id)? (y/N): " | ||
| read -r shouldDestroy | ||
| if [[ "$shouldDestroy" == y* ]] || [[ "$shouldDestroy" == Y* ]]; then | ||
| # Do not use service account when attempting to delete the project | ||
| unset GOOGLE_IMPERSONATE_SERVICE_ACCOUNT | ||
|
|
||
| source ./helpers/create-project.sh | ||
| deleteProject | ||
| rm ./generated.auto.tfvars | ||
| fi |
This file contains hidden or 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,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 | ||
| # | ||
| # https://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. | ||
| # | ||
|
|
||
| helperDir="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" | ||
| pushd "$helperDir/.." >/dev/null || exit | ||
| terraform apply "generated.tfplan" || exit | ||
| popd >/dev/null || exit |
This file contains hidden or 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,81 @@ | ||
| #!/bin/bash | ||
| # | ||
| # 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 | ||
| # | ||
| # https://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. | ||
| # | ||
|
|
||
| ##################### | ||
| # Expected Environment Variables: | ||
| # TF_VAR_folder_id : Folder in which new GCP projects will be created | ||
| # TF_VAR_billing_account : Billing account to be used for created GCP projects | ||
| # TF_VAR_project_prefix : Prefix to use for all created GCP projects | ||
| ##################### | ||
|
|
||
| function createProject() { | ||
| if [ -n "${GOOGLE_CLOUD_PROJECT}" ]; then | ||
| echo "Using current GOOGLE_CLOUD_PROJECT: $GOOGLE_CLOUD_PROJECT" | ||
| return | ||
| fi | ||
|
|
||
| currentProject=$(gcloud config get project) | ||
| if [ -n "${currentProject}" ]; then | ||
| echo -n "Do you want to use the current gcloud project ($currentProject)? (Y|n): " | ||
| read -r shouldUseCurrent | ||
| if [[ "$shouldUseCurrent" != n* ]] && [[ "$shouldUseCurrent" != N* ]]; then | ||
| GOOGLE_CLOUD_PROJECT=$currentProject | ||
| export GOOGLE_CLOUD_PROJECT | ||
| return | ||
| fi | ||
| fi | ||
|
|
||
| echo -n "GOOGLE_CLOUD_PROJECT not set. Do you want to create a project? (Y|n): " | ||
| read -r shouldCreate | ||
| if [[ "$shouldCreate" == n* ]] || [[ "$shouldCreate" == N* ]]; then | ||
| echo "Project required. Exiting." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Ensure required environment variables are set. | ||
| if [ -z "${GOOGLE_CLOUD_FOLDER_ID}" ]; then | ||
| echo -n "GOOGLE_CLOUD_FOLDER_ID not set. GCP Folder ID: " | ||
| read -r folder_id | ||
| export GOOGLE_CLOUD_FOLDER_ID="${folder_id}" | ||
| fi | ||
| if [ -z "${GOOGLE_CLOUD_BILLING_ACCOUNT}" ]; then | ||
| echo -n "GOOGLE_CLOUD_BILLING_ACCOUNT not set. GCP Billing Account ID: " | ||
| read -r billing_acct | ||
| export GOOGLE_CLOUD_BILLING_ACCOUNT="${billing_acct}" | ||
| fi | ||
| if [ -z "${GOOGLE_CLOUD_PROJECT_PREFIX}" ]; then | ||
| echo -n "GOOGLE_CLOUD_PROJECT_PREFIX not set. Prefix for New Project: " | ||
| read -r prefix | ||
| export GOOGLE_CLOUD_PROJECT_PREFIX="${prefix}" | ||
| fi | ||
|
|
||
| # Provision GCP Project | ||
| projectId="${GOOGLE_CLOUD_PROJECT_PREFIX}"-"$RANDOM" | ||
| gcloud projects create --folder="$GOOGLE_CLOUD_FOLDER_ID" "$projectId" || exit | ||
| gcloud config set project "$projectId" | ||
| gcloud services enable cloudresourcemanager.googleapis.com | ||
| gcloud beta billing projects link "$projectId" --billing-account="$GOOGLE_CLOUD_BILLING_ACCOUNT" | ||
| GOOGLE_CLOUD_PROJECT=$projectId | ||
| } | ||
|
|
||
| function deleteProject() { | ||
| if [ -n "${GOOGLE_CLOUD_PROJECT}" ]; then | ||
| gcloud projects delete "$GOOGLE_CLOUD_PROJECT" | ||
| gcloud config unset project | ||
| unset GOOGLE_CLOUD_PROJECT | ||
| fi | ||
| } |
This file contains hidden or 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,32 @@ | ||
| #!/bin/bash | ||
| # | ||
| # 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 | ||
| # | ||
| # https://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. | ||
| # | ||
|
|
||
| # Perform gcloud auth login if no current credentials are available. | ||
| if gcloud auth print-access-token &>/dev/null; then | ||
| true | ||
| else | ||
| if ! gcloud auth login; then | ||
| exit | ||
| fi | ||
| fi | ||
| if gcloud auth application-default print-access-token &>/dev/null; then | ||
| true | ||
| else | ||
| if ! gcloud auth application-default login; then | ||
| exit | ||
| fi | ||
| fi |
This file contains hidden or 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,65 @@ | ||
| # | ||
| # 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 | ||
| # | ||
| # https://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. | ||
| # | ||
| function initializeGeneratedFiles() { | ||
| cp ./helpers/generated-main.template.tf generated-main.tf | ||
| cp ./helpers/generated-outputs.template.tf generated-outputs.tf | ||
| cp ./helpers/generated-variables.template.tf generated-variables.tf | ||
| } | ||
|
|
||
| function appendModule() { | ||
| friendlyName=$(source ./helpers/get-output-friendly-name.sh "$1") | ||
|
|
||
| # Append the given module to the generated-main.tf configuration to be | ||
| # included in the project's resources during 'terraform apply'. | ||
| echo "module \"$friendlyName\" { | ||
| source = \"./../$1/.terraform\" | ||
| inputs = local.data | ||
| depends_on = [time_sleep.for_1m_allowBaseCloudApisToFullyEnable] | ||
| }" >>generated-main.tf | ||
|
|
||
| # Append the given module to the generated-output.tf file to provide | ||
| # all of this module's outputs as an object. | ||
| # See https://www.terraform.io/cli/commands/output | ||
| echo "output \"$friendlyName\" { | ||
| value = module.$friendlyName | ||
| sensitive = true | ||
| }" >>generated-outputs.tf | ||
| } | ||
|
|
||
| function appendAllModules() { | ||
| # Either use given module list, or get a list of all modules in the parent directory. | ||
| if [ -n "$1" ]; then | ||
| modules=$1 | ||
| else | ||
| modules=$(source ./helpers/list-all-modules.sh) | ||
| fi | ||
| IFS=',' | ||
| for module in $modules; do | ||
| # Only include modules with a .terraform subdirectory in the generated config. | ||
| if [ -d "../$module/.terraform" ]; then | ||
| appendModule "${module%/}" # Remove possible trailing '/' | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| # Ensure current directory is <root>/.terraform. | ||
| generateDir="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)" | ||
| pushd "$generateDir/.." >/dev/null || exit | ||
|
|
||
| initializeGeneratedFiles | ||
| appendAllModules "$1" | ||
|
|
||
| popd >/dev/null || exit |
This file contains hidden or 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,48 @@ | ||
| # Auto-generated by generate-config.sh | ||
| terraform { | ||
| required_providers { | ||
| google = { | ||
| source = "hashicorp/google" | ||
| } | ||
| } | ||
| } | ||
| provider "google" { | ||
| project = var.project_id | ||
| region = var.region | ||
| zone = var.zone | ||
| } | ||
| locals { | ||
| # Objects with additional key-value entries may be passed as variables | ||
| # to modules needing an object with only a subset of those entries. | ||
| # So this 'data' object is a superset of key-value entries that may be | ||
| # needed, and we pass it to every module. | ||
| data = { | ||
| project_id = var.project_id | ||
| project_number = var.project_number | ||
| region = var.region | ||
| zone = var.zone | ||
| service_account = var.service_account | ||
| should_enable_apis_on_apply = var.should_enable_apis_on_apply | ||
| should_disable_apis_on_destroy = var.should_disable_apis_on_destroy | ||
| } | ||
| } | ||
| module "project-services" { | ||
| source = "terraform-google-modules/project-factory/google//modules/project_services" | ||
|
|
||
| project_id = local.data.project_id | ||
| enable_apis = local.data.should_enable_apis_on_apply | ||
| disable_services_on_destroy = local.data.should_disable_apis_on_destroy | ||
| activate_apis = [ | ||
| "cloudresourcemanager.googleapis.com", | ||
| "iam.googleapis.com", | ||
| "iamcredentials.googleapis.com", | ||
| "serviceusage.googleapis.com", | ||
| ] | ||
| } | ||
| resource "time_sleep" "for_1m_allowBaseCloudApisToFullyEnable" { | ||
| create_duration = "1m" | ||
| depends_on = [module.project-services] | ||
| triggers = { | ||
| when_project_created = local.data.project_id | ||
| } | ||
| } | ||
This file contains hidden or 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,8 @@ | ||
| # Auto-generated by generate-config.sh | ||
| # See https://www.terraform.io/cli/commands/output | ||
| output "project_id" { | ||
| value = local.data.project_id | ||
| } | ||
| output "service_account" { | ||
| value = local.data.service_account | ||
| } |
This file contains hidden or 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,37 @@ | ||
| # Auto-generated by generate-config.sh | ||
| variable "gcloud_account" { | ||
| type = string | ||
| description = "Account email associated with the gcloud session" | ||
| } | ||
| variable "project_id" { | ||
| type = string | ||
| description = "GCP Project ID of the project being used" | ||
| } | ||
| variable "project_number" { | ||
| type = string | ||
| description = "GCP Project number of the project being used" | ||
| } | ||
| variable "region" { | ||
| type = string | ||
| description = "GCP region used to deploy resources" | ||
| default = "us-central1" # NOTE: Some integration tests have hardcoded this region. | ||
| } | ||
| variable "service_account" { | ||
| type = string | ||
| description = "Service account email associated with this gcloud session" | ||
| } | ||
| variable "should_enable_apis_on_apply" { | ||
| type = bool | ||
| default = true | ||
| description = "If true, required APIs for active client libraries will be automatically enabled on apply." | ||
| } | ||
| variable "should_disable_apis_on_destroy" { | ||
| type = bool | ||
| default = false | ||
| description = "If true, any APIs enabled by Terraform during apply will be disabled on destroy." | ||
| } | ||
| variable "zone" { | ||
| type = string | ||
| description = "GCP zone used to deploy resources. Must be a zone in the chosen region." | ||
| default = "us-central1-c" | ||
| } |
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.
What if we don't add generated files. Would this PR becomes much smaller?
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.
These three 'template' files aren't actually generated -- they're used to copy and then append to the "actual" generated files which are not in git.