-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: use remote state to read data from previous steps (#782)
* add output for remote state information * use remote state in step 1-org * fix integration test * use remote state date in step 5 * fix disable script * add force destroy on bootstrap * update outputs for step 1-org * update tests * add remote state to step 2-envs * move backend initialization to the end of apply phase * user remote state in step 4-projects * add remote state to 3-networks-dual-svpc * add remote state to 3-networks-hub-and-spoke * update test to use remote state in step 3-networks * fix bootstrap apply stage in integration test * fix soft link cyclo * update script to disable tf files * fix step 5-app-infra test * remove extra vars from test initialization * remove terraform service account from the var in step 4 integration test * remove project service account from test vars * split projects test into test for shared and test for envs * fix READMEs and tfvars files * restore 5-app-infra * remove remote_state.tf file * fix null provider version * restore gcloud beta terraform vet info * remove interpolation from backend_bucket usage * organize remote state values * add explanation of usage of remote state output values Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
- Loading branch information
1 parent
f35dcc5
commit a761a99
Showing
203 changed files
with
1,474 additions
and
2,142 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
// These values are retrieved from the saved terraform state of the execution | ||
// of step 0-bootstrap using the terraform_remote_state data source. | ||
// These values can be overridden here if needed. | ||
// Some values, like org_id, parent_folder, and parent, must be consistent in all steps. | ||
locals { | ||
org_id = data.terraform_remote_state.bootstrap.outputs.common_config.org_id | ||
parent_folder = data.terraform_remote_state.bootstrap.outputs.common_config.parent_folder | ||
parent = data.terraform_remote_state.bootstrap.outputs.common_config.parent_id | ||
billing_account = data.terraform_remote_state.bootstrap.outputs.common_config.billing_account | ||
default_region = data.terraform_remote_state.bootstrap.outputs.common_config.default_region | ||
project_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.project_prefix | ||
folder_prefix = data.terraform_remote_state.bootstrap.outputs.common_config.folder_prefix | ||
} | ||
|
||
data "terraform_remote_state" "bootstrap" { | ||
backend = "gcs" | ||
|
||
config = { | ||
bucket = var.backend_bucket | ||
prefix = "terraform/bootstrap/state" | ||
} | ||
} |
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
Oops, something went wrong.