Skip to content
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

use remote state to read data from previous steps #782

Merged
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
58184da
add output for remote state information
daniel-cit Jul 25, 2022
3f1164f
use remote state in step 1-org
daniel-cit Jul 25, 2022
ec1427e
Merge remote-tracking branch 'origin/master' into 2022-use-remote-state
daniel-cit Jul 25, 2022
d909f5b
fix integration test
daniel-cit Aug 3, 2022
3eb48ef
use remote state date in step 5
daniel-cit Aug 4, 2022
7bd8f35
fix disable script
daniel-cit Aug 4, 2022
3a20bdf
add force destroy on bootstrap
daniel-cit Aug 4, 2022
e56803e
update outputs for step 1-org
daniel-cit Aug 4, 2022
c9ffd76
update tests
daniel-cit Aug 4, 2022
15da669
add remote state to step 2-envs
daniel-cit Aug 5, 2022
c107e82
move backend initialization to the end of apply phase
daniel-cit Aug 5, 2022
375a85b
user remote state in step 4-projects
daniel-cit Aug 5, 2022
a352703
Merge remote-tracking branch 'origin/master' into 2022-use-remote-state
daniel-cit Aug 19, 2022
4077aa3
add remote state to 3-networks-dual-svpc
daniel-cit Aug 23, 2022
8bb1a44
add remote state to 3-networks-hub-and-spoke
daniel-cit Aug 23, 2022
64ae323
update test to use remote state in step 3-networks
daniel-cit Aug 23, 2022
13dd1f5
fix bootstrap apply stage in integration test
daniel-cit Aug 23, 2022
432dbfa
fix soft link cyclo
daniel-cit Aug 24, 2022
ba40a20
update script to disable tf files
daniel-cit Aug 24, 2022
dbc360e
fix step 5-app-infra test
daniel-cit Aug 24, 2022
58db361
remove extra vars from test initialization
daniel-cit Aug 24, 2022
51bc453
Merge remote-tracking branch 'origin/master' into 2022-use-remote-state
daniel-cit Aug 24, 2022
9d15021
remove terraform service account from the var in step 4 integration test
daniel-cit Aug 25, 2022
2886dba
remove project service account from test vars
daniel-cit Aug 25, 2022
df858ea
split projects test into test for shared and test for envs
daniel-cit Aug 25, 2022
c96d661
fix READMEs and tfvars files
daniel-cit Aug 26, 2022
7d2647a
Merge remote-tracking branch 'origin/master' into 2022-use-remote-state
daniel-cit Aug 26, 2022
05e567a
restore 5-app-infra
daniel-cit Aug 26, 2022
03ecd12
remove remote_state.tf file
daniel-cit Aug 26, 2022
5378ee2
fix null provider version
daniel-cit Aug 26, 2022
c8ec10c
restore gcloud beta terraform vet info
daniel-cit Aug 26, 2022
28d7f94
remove interpolation from backend_bucket usage
daniel-cit Aug 27, 2022
8d17600
organize remote state values
daniel-cit Aug 27, 2022
c763021
add explanation of usage of remote state output values
daniel-cit Aug 27, 2022
5f44161
Merge branch 'master' into 2022-use-remote-state
bharathkkb Aug 31, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 0-bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ the following steps:
| Name | Description |
|------|-------------|
| cloudbuild\_project\_id | Project where CloudBuild configuration and terraform container image will reside. |
| common\_config | Common configuration data to be used in other steps. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: After this is merged lets update docs to call out how we will use this common config created here though out the rest of SFB.

| csr\_repos | List of Cloud Source Repos created by the module, linked to Cloud Build triggers. |
| environment\_step\_terraform\_service\_account\_email | Environment Step Terraform Account |
| gcs\_bucket\_cloudbuild\_artifacts | Bucket used to store Cloud/Build artifacts in CloudBuild project. |
Expand Down
17 changes: 13 additions & 4 deletions 0-bootstrap/modules/parent-iam-member/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,31 @@
*/

locals {
org_id = var.parent_type == "organization" ? var.parent_id : ""
folder_id = var.parent_type == "folder" ? var.parent_id : ""
org_id = var.parent_type == "organization" ? var.parent_id : ""
folder_id = var.parent_type == "folder" ? var.parent_id : ""
project_id = var.parent_type == "project" ? var.parent_id : ""
}

resource "google_organization_iam_member" "org_parent_iam" {
for_each = toset(local.org_id != "" ? var.roles : [])
for_each = toset(var.parent_type == "organization" ? var.roles : [])

org_id = local.org_id
role = each.key
member = var.member
}

resource "google_folder_iam_member" "folder_parent_iam" {
for_each = toset(local.folder_id != "" ? var.roles : [])
for_each = toset(var.parent_type == "folder" ? var.roles : [])

folder = local.folder_id
role = each.key
member = var.member
}

resource "google_project_iam_member" "project_parent_iam" {
for_each = toset(var.parent_type == "project" ? var.roles : [])

project = local.project_id
role = each.key
member = var.member
}
6 changes: 3 additions & 3 deletions 0-bootstrap/modules/parent-iam-member/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/

variable "parent_type" {
description = "Type of the parent resource. valid values are `organization` and `folder`."
description = "Type of the parent resource. valid values are `organization`, `folder`, and `project`."
type = string

validation {
condition = var.parent_type == "organization" || var.parent_type == "folder"
error_message = "For parent_type only `organization` and `folder` are valid."
condition = var.parent_type == "organization" || var.parent_type == "folder" || var.parent_type == "project"
error_message = "For parent_type only `organization`, `folder`, and `project` are valid."
}
}

Expand Down
14 changes: 14 additions & 0 deletions 0-bootstrap/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ output "gcs_bucket_tfstate" {
value = module.seed_bootstrap.gcs_bucket_tfstate
}

output "common_config" {
description = "Common configuration data to be used in other steps."
value = {
org_id = var.org_id,
parent_folder = var.parent_folder,
billing_account = var.billing_account,
default_region = var.default_region,
project_prefix = var.project_prefix,
folder_prefix = var.folder_prefix
parent_id = local.parent
bootstrap_folder_name = google_folder.bootstrap.name
}
}

/* ----------------------------------------
Specific to cloudbuild_module
---------------------------------------- */
Expand Down
25 changes: 25 additions & 0 deletions 0-bootstrap/sa.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ locals {
"roles/compute.xpnAdmin",
],
}

granular_sa_seed_project = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment here this will allow individual stages to access state for all other stages (incase users want to restrict this)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

actually, these roles are redundant with the role roles/storage.admin granted in the bucket in the tf_cloudbuild_workspace module
since we are using a single tf state bucket created in the seed project to host all the states like we did before using the workspace module.

to be able to revoke the access of the others service accounts to one of the state buckets, we will need to:

  • stop using the tf state bucket from the seed project
  • create a tf state bucket for each workspace in the CI/CD project, setting var.create_state_bucket to true
  • grant read roles in a bucket for the other service accounts that need to read the outputs

@bharathkkb should we do this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I think we can keep this in the PR now and track it in a separate PR. My hope with the workspace module was in the future we can split this out for more granular permissions.

"org" = [
"roles/storage.objectAdmin",
],
"env" = [
"roles/storage.objectAdmin"
],
"net" = [
"roles/storage.objectAdmin",
],
"proj" = [
"roles/storage.objectAdmin",
],
}
}

resource "google_service_account" "terraform-env-sa" {
Expand Down Expand Up @@ -97,6 +112,16 @@ module "parent_iam_member" {
roles = each.value
}

module "project_iam_member" {
source = "./modules/parent-iam-member"
for_each = local.granular_sa_seed_project

member = "serviceAccount:${google_service_account.terraform-env-sa[each.key].email}"
parent_type = "project"
parent_id = module.seed_bootstrap.seed_project_id
roles = each.value
}

resource "google_billing_account_iam_member" "tf_billing_user" {
for_each = local.granular_sa

Expand Down
8 changes: 2 additions & 6 deletions 1-org/envs/shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@
| audit\_data\_users | Google Workspace or Cloud Identity group that have access to audit logs. | `string` | n/a | yes |
| audit\_logs\_table\_delete\_contents\_on\_destroy | (Optional) If set to true, delete all the tables in the dataset when destroying the resource; otherwise, destroying the resource will fail if tables are present. | `bool` | `false` | no |
| audit\_logs\_table\_expiration\_days | Period before tables expire for all audit logs in milliseconds. Default is 30 days. | `number` | `30` | no |
| backend\_bucket | Backend bucket to load remote state information from previous steps. | `string` | n/a | yes |
| base\_net\_hub\_project\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` for the base net hub project. | `string` | `null` | no |
| base\_net\_hub\_project\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded for the base net hub project. | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no |
| base\_net\_hub\_project\_budget\_amount | The amount to use as the budget for the base net hub project. | `number` | `1000` | no |
| billing\_account | The ID of the billing account to associate this project with | `string` | n/a | yes |
| billing\_data\_users | Google Workspace or Cloud Identity group that have access to billing data set. | `string` | n/a | yes |
| create\_access\_context\_manager\_access\_policy | Whether to create access context manager access policy | `bool` | `true` | no |
| data\_access\_logs\_enabled | Enable Data Access logs of types DATA\_READ, DATA\_WRITE for all GCP services. Enabling Data Access logs might result in your organization being charged for the additional logs usage. See https://cloud.google.com/logging/docs/audit#data-access The ADMIN\_READ logs are enabled by default. | `bool` | `false` | no |
| default\_region | Default region for BigQuery resources. | `string` | n/a | yes |
| dns\_hub\_project\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` for the DNS hub project. | `string` | `null` | no |
| dns\_hub\_project\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded for the DNS hub project. | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no |
| dns\_hub\_project\_budget\_amount | The amount to use as the budget for the DNS hub project. | `number` | `1000` | no |
| domains\_to\_allow | The list of domains to allow users from in IAM. Used by Domain Restricted Sharing Organization Policy. Must include the domain of the organization you are deploying the foundation. To add other domains you must also grant access to these domains to the terraform service account used in the deploy. | `list(string)` | n/a | yes |
| enable\_hub\_and\_spoke | Enable Hub-and-Spoke architecture. | `bool` | `false` | no |
| enable\_os\_login\_policy | Enable OS Login Organization Policy. | `bool` | `false` | no |
| folder\_prefix | Name prefix to use for folders created. Should be the same in all steps. | `string` | `"fldr"` | no |
| gcp\_audit\_viewer | Members are part of an audit team and view audit logs in the logging project. | `string` | `null` | no |
| gcp\_billing\_admin\_user | Identity that has billing administrator permissions | `string` | `null` | no |
| gcp\_billing\_creator\_user | Identity that can create billing accounts. | `string` | `null` | no |
Expand All @@ -44,12 +42,9 @@
| org\_billing\_logs\_project\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` for the org billing logs project. | `string` | `null` | no |
| org\_billing\_logs\_project\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded for the org billing logs project. | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no |
| org\_billing\_logs\_project\_budget\_amount | The amount to use as the budget for the org billing logs project. | `number` | `1000` | no |
| org\_id | The organization id for the associated services | `string` | n/a | yes |
| org\_secrets\_project\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` for the org secrets project. | `string` | `null` | no |
| org\_secrets\_project\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded for the org secrets project. | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no |
| org\_secrets\_project\_budget\_amount | The amount to use as the budget for the org secrets project. | `number` | `1000` | no |
| parent\_folder | Optional - for an organization with existing projects or for development/validation. It will place all the example foundation resources under the provided folder instead of the root organization. The value is the numeric folder ID. The folder must already exist. Must be the same value used in previous step. | `string` | `""` | no |
| project\_prefix | Name prefix to use for projects created. Should be the same in all steps. Max size is 3 characters. | `string` | `"prj"` | no |
| restricted\_net\_hub\_project\_alert\_pubsub\_topic | The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form of `projects/{project_id}/topics/{topic_id}` for the restricted net hub project. | `string` | `null` | no |
| restricted\_net\_hub\_project\_alert\_spent\_percents | A list of percentages of the budget to alert on when threshold is exceeded for the restricted net hub project. | `list(number)` | <pre>[<br> 0.5,<br> 0.75,<br> 0.9,<br> 0.95<br>]</pre> | no |
| restricted\_net\_hub\_project\_budget\_amount | The amount to use as the budget for the restricted net hub project. | `number` | `1000` | no |
Expand Down Expand Up @@ -78,6 +73,7 @@
| parent\_resource\_id | The parent resource id |
| parent\_resource\_type | The parent resource type |
| restricted\_net\_hub\_project\_id | The Restricted Network hub project ID |
| restricted\_net\_hub\_project\_number | The Restricted Network hub project number |
| scc\_notification\_name | Name of SCC Notification |
| scc\_notifications\_project\_id | The SCC notifications project ID |

Expand Down
6 changes: 1 addition & 5 deletions 1-org/envs/shared/folders.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@
* limitations under the License.
*/

locals {
parent = var.parent_folder != "" ? "folders/${var.parent_folder}" : "organizations/${var.org_id}"
}

/******************************************
Top level folders
*****************************************/

resource "google_folder" "common" {
display_name = "${var.folder_prefix}-common"
display_name = "${local.folder_prefix}-common"
parent = local.parent
}
48 changes: 24 additions & 24 deletions 1-org/envs/shared/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ locals {
}

resource "google_organization_iam_audit_config" "org_config" {
count = var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = local.parent_folder == "" ? 1 : 0
org_id = local.org_id
service = "allServices"

###################################################################################################
Expand All @@ -44,8 +44,8 @@ resource "google_organization_iam_audit_config" "org_config" {
}

resource "google_folder_iam_audit_config" "folder_config" {
count = var.parent_folder != "" ? 1 : 0
folder = "folders/${var.parent_folder}"
count = local.parent_folder != "" ? 1 : 0
folder = "folders/${local.parent_folder}"
service = "allServices"

###################################################################################################
Expand Down Expand Up @@ -97,7 +97,7 @@ resource "google_project_iam_member" "billing_bq_viewer" {
*****************************************/

resource "google_organization_iam_member" "billing_viewer" {
org_id = var.org_id
org_id = local.org_id
role = "roles/billing.viewer"
member = "group:${var.billing_data_users}"
}
Expand All @@ -107,43 +107,43 @@ resource "google_organization_iam_member" "billing_viewer" {
*****************************************/

resource "google_organization_iam_member" "organization_viewer" {
count = var.gcp_platform_viewer != null && var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = var.gcp_platform_viewer != null && local.parent_folder == "" ? 1 : 0
org_id = local.org_id
role = "roles/viewer"
member = "group:${var.gcp_platform_viewer}"
}

resource "google_folder_iam_member" "organization_viewer" {
count = var.gcp_platform_viewer != null && var.parent_folder != "" ? 1 : 0
folder = "folders/${var.parent_folder}"
count = var.gcp_platform_viewer != null && local.parent_folder != "" ? 1 : 0
folder = "folders/${local.parent_folder}"
role = "roles/viewer"
member = "group:${var.gcp_platform_viewer}"
}

resource "google_organization_iam_member" "security_reviewer" {
count = var.gcp_security_reviewer != null && var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = var.gcp_security_reviewer != null && local.parent_folder == "" ? 1 : 0
org_id = local.org_id
role = "roles/iam.securityReviewer"
member = "group:${var.gcp_security_reviewer}"
}

resource "google_folder_iam_member" "security_reviewer" {
count = var.gcp_security_reviewer != null && var.parent_folder != "" ? 1 : 0
folder = "folders/${var.parent_folder}"
count = var.gcp_security_reviewer != null && local.parent_folder != "" ? 1 : 0
folder = "folders/${local.parent_folder}"
role = "roles/iam.securityReviewer"
member = "group:${var.gcp_security_reviewer}"
}

resource "google_organization_iam_member" "network_viewer" {
count = var.gcp_network_viewer != null && var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = var.gcp_network_viewer != null && local.parent_folder == "" ? 1 : 0
org_id = local.org_id
role = "roles/compute.networkViewer"
member = "group:${var.gcp_network_viewer}"
}

resource "google_folder_iam_member" "network_viewer" {
count = var.gcp_network_viewer != null && var.parent_folder != "" ? 1 : 0
folder = "folders/${var.parent_folder}"
count = var.gcp_network_viewer != null && local.parent_folder != "" ? 1 : 0
folder = "folders/${local.parent_folder}"
role = "roles/compute.networkViewer"
member = "group:${var.gcp_network_viewer}"
}
Expand Down Expand Up @@ -188,29 +188,29 @@ resource "google_project_iam_member" "global_secrets_admin" {
*****************************************/

resource "google_organization_iam_member" "org_admin_user" {
count = var.gcp_org_admin_user != null && var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = var.gcp_org_admin_user != null && local.parent_folder == "" ? 1 : 0
org_id = local.org_id
role = "roles/resourcemanager.organizationAdmin"
member = "user:${var.gcp_org_admin_user}"
}

resource "google_folder_iam_member" "org_admin_user" {
count = var.gcp_org_admin_user != null && var.parent_folder != "" ? 1 : 0
folder = "folders/${var.parent_folder}"
count = var.gcp_org_admin_user != null && local.parent_folder != "" ? 1 : 0
folder = "folders/${local.parent_folder}"
role = "roles/resourcemanager.folderAdmin"
member = "user:${var.gcp_org_admin_user}"
}

resource "google_organization_iam_member" "billing_creator_user" {
count = var.gcp_billing_creator_user != null && var.parent_folder == "" ? 1 : 0
org_id = var.org_id
count = var.gcp_billing_creator_user != null && local.parent_folder == "" ? 1 : 0
org_id = local.org_id
role = "roles/billing.creator"
member = "user:${var.gcp_billing_creator_user}"
}

resource "google_billing_account_iam_member" "billing_admin_user" {
count = var.gcp_billing_admin_user != null ? 1 : 0
billing_account_id = var.billing_account
billing_account_id = local.billing_account
role = "roles/billing.admin"
member = "user:${var.gcp_billing_admin_user}"
}
6 changes: 3 additions & 3 deletions 1-org/envs/shared/log_sinks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*/

locals {
parent_resource_id = var.parent_folder != "" ? var.parent_folder : var.org_id
parent_resource_type = var.parent_folder != "" ? "folder" : "organization"
parent_resource_id = local.parent_folder != "" ? local.parent_folder : local.org_id
parent_resource_type = local.parent_folder != "" ? "folder" : "organization"
main_logs_filter = <<EOF
logName: /logs/cloudaudit.googleapis.com%2Factivity OR
logName: /logs/cloudaudit.googleapis.com%2Fsystem_event OR
Expand Down Expand Up @@ -125,5 +125,5 @@ resource "google_bigquery_dataset" "billing_dataset" {
dataset_id = "billing_data"
project = module.org_billing_logs.project_id
friendly_name = "GCP Billing Data"
location = var.default_region
location = local.default_region
}
25 changes: 25 additions & 0 deletions 1-org/envs/shared/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* 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.
*/

locals {
daniel-cit marked this conversation as resolved.
Show resolved Hide resolved
parent_folder = data.terraform_remote_state.bootstrap.outputs.common_config.parent_folder
daniel-cit marked this conversation as resolved.
Show resolved Hide resolved
org_id = data.terraform_remote_state.bootstrap.outputs.common_config.org_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
parent = data.terraform_remote_state.bootstrap.outputs.common_config.parent_id
}
8 changes: 4 additions & 4 deletions 1-org/envs/shared/org_policy.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
*/

locals {
organization_id = var.parent_folder != "" ? null : var.org_id
folder_id = var.parent_folder != "" ? var.parent_folder : null
policy_for = var.parent_folder != "" ? "folder" : "organization"
organization_id = local.parent_folder != "" ? null : local.org_id
folder_id = local.parent_folder != "" ? local.parent_folder : null
policy_for = local.parent_folder != "" ? "folder" : "organization"
}


Expand Down Expand Up @@ -174,6 +174,6 @@ module "org_enforce_bucket_level_access" {

resource "google_access_context_manager_access_policy" "access_policy" {
count = var.create_access_context_manager_access_policy ? 1 : 0
parent = "organizations/${var.org_id}"
parent = "organizations/${local.org_id}"
title = "default policy"
}
7 changes: 6 additions & 1 deletion 1-org/envs/shared/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

output "org_id" {
value = var.org_id
value = local.org_id
description = "The organization id"
}

Expand Down Expand Up @@ -79,6 +79,11 @@ output "restricted_net_hub_project_id" {
description = "The Restricted Network hub project ID"
}

output "restricted_net_hub_project_number" {
value = try(module.restricted_network_hub[0].project_number, null)
description = "The Restricted Network hub project number"
}

output "domains_to_allow" {
value = var.domains_to_allow
description = "The list of domains to allow users from in IAM."
Expand Down
Loading