Skip to content

Commit 9b3b4b8

Browse files
j0g3scmeshkodiak[bot]
authored andcommitted
adds variable to enable/disable optional carbon export module and applies tf docs generation
1 parent dc17754 commit 9b3b4b8

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

TERRAFORM_DOCS.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ No providers.
1212

1313
| Name | Source | Version |
1414
|------|--------|---------|
15+
| <a name="module_carbon_export"></a> [carbon\_export](#module\_carbon\_export) | ./modules/meshcloud-carbon-export/ | n/a |
1516
| <a name="module_kraken_sa"></a> [kraken\_sa](#module\_kraken\_sa) | ./modules/meshcloud-kraken-service-account/ | n/a |
1617
| <a name="module_replicator_sa"></a> [replicator\_sa](#module\_replicator\_sa) | ./modules/meshcloud-replicator-service-account/ | n/a |
1718

@@ -25,8 +26,11 @@ No resources.
2526
|------|-------------|------|---------|:--------:|
2627
| <a name="input_billing_account_id"></a> [billing\_account\_id](#input\_billing\_account\_id) | The GCP billing account in your organization. | `string` | n/a | yes |
2728
| <a name="input_billing_org_id"></a> [billing\_org\_id](#input\_billing\_org\_id) | GCP organization ID that holds billing account. | `string` | n/a | yes |
29+
| <a name="input_carbon_export_module_enabled"></a> [carbon\_export\_module\_enabled](#input\_carbon\_export\_module\_enabled) | Determines whether or not to include the resources of the carbon footprint export module. | `bool` | `false` | no |
30+
| <a name="input_carbon_footprint_dataset_id"></a> [carbon\_footprint\_dataset\_id](#input\_carbon\_footprint\_dataset\_id) | Id of BigQuery dataset for carbon footprint. | `string` | `"carbon_footprint_data"` | no |
31+
| <a name="input_carbon_footprint_dataset_location"></a> [carbon\_footprint\_dataset\_location](#input\_carbon\_footprint\_dataset\_location) | Location of BigQuery dataset for carbon footprint. | `string` | `"us-west1"` | no |
2832
| <a name="input_cloud_billing_export_dataset_id"></a> [cloud\_billing\_export\_dataset\_id](#input\_cloud\_billing\_export\_dataset\_id) | GCP BigQuery dataset containing the Cloud Billing BigQuery export. This variable is only required to form the output for meshPlatform configuration. No resources are created or attached. | `string` | n/a | yes |
29-
| <a name="input_cloud_billing_export_project_id"></a> [cloud\_billing\_export\_project\_id](#input\_cloud\_billing\_export\_project\_id) | GCP Project where the BiqQery table resides that holds the Cloud Billing export to BigQuery. See https://cloud.google.com/billing/docs/how-to/export-data-bigquery | `string` | n/a | yes |
33+
| <a name="input_cloud_billing_export_project_id"></a> [cloud\_billing\_export\_project\_id](#input\_cloud\_billing\_export\_project\_id) | GCP Project where the BiqQuery table resides that holds the Cloud Billing export to BigQuery. See https://cloud.google.com/billing/docs/how-to/export-data-bigquery | `string` | n/a | yes |
3034
| <a name="input_cloud_billing_export_table_id"></a> [cloud\_billing\_export\_table\_id](#input\_cloud\_billing\_export\_table\_id) | GCP BigQuery table containing the Cloud Billing BigQuery export. This variable is only required to form the output for meshPlatform configuration. No resources are created or attached. | `string` | n/a | yes |
3135
| <a name="input_kraken_sa_name"></a> [kraken\_sa\_name](#input\_kraken\_sa\_name) | Name of the service account to create for Kraken. | `string` | `"mesh-kraken-service-tf"` | no |
3236
| <a name="input_landing_zone_folder_ids"></a> [landing\_zone\_folder\_ids](#input\_landing\_zone\_folder\_ids) | GCP Folders that make up the Landing Zone. The service account will only receive permissions on these folders. | `list(string)` | n/a | yes |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module "replicator_sa" {
2323

2424
module "carbon_export" {
2525
source = "./modules/meshcloud-carbon-export/"
26+
count = var.carbon_export_module_enabled ? 1 : 0
2627

2728
carbon_data_export_dataset_id = var.carbon_footprint_dataset_id
2829
carbon_data_export_project_id = var.cloud_billing_export_project_id # using the same project as for billing

modules/meshcloud-carbon-export/README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,24 @@ No modules.
1616

1717
## Resources
1818

19-
| Name | Type |
20-
|---------------------------------------------------------------------------|------|
21-
| [google_project_service.bigquery_api](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/google_project_service) | resource |
22-
| [google_project_service.bigquerydatatransfer_api](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/google_project_service) | resource |
23-
| [google_bigquery_dataset.carbon_data_export_dataset](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/bigquery_dataset) | resource |
19+
| Name | Type |
20+
|------|------|
2421
| [google_bigquery_data_transfer_config.carbon_footprint_transfer_config](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/bigquery_data_transfer_config) | resource |
25-
22+
| [google_bigquery_dataset.carbon_data_export_dataset](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/bigquery_dataset) | resource |
23+
| [google_project_service.bigquery_api](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/project_service) | resource |
24+
| [google_project_service.bigquerydatatransfer_api](https://registry.terraform.io/providers/hashicorp/google/4.11.0/docs/resources/project_service) | resource |
2625

2726
## Inputs
2827

29-
| Name | Description | Type | Default | Required |
30-
|-----------------------------------------------------------------------------------------------------------------------------|-------------|------|---------|:--------:|
31-
| <a name="carbon_dataset_region"></a> [carbon\_dataset\_region](#input\_ccarbon\_dataset\_region) | The location of the BigQuery dataset for carbon data exports. | `string` | n/a | yes |
32-
| <a name="billing_account_id"></a> [billing\_account\_id](#input\_billing\_account\_id) | The GCP Billing Account in your organization. | `set(string)` | n/a | yes |
33-
| <a name="carbon_data_export_project_id"></a> [carbon\_data\_export\_project\_id](#input\_carbon\_data\_export\project\_id) | GCP Project where the BiqQuery table resides that holds the Carbon Footprint export to BigQuery. See https://cloud.google.com/billing/docs/how-to/export-data-bigquery | `string` | n/a | yes |
34-
| <a name="carbon_data_export_dataset_id"></a> [carbon\_data\_export\_dataset\_id](#input\_carbon\_data\_export\_dataset\_id) | GCP BigQuery dataset containing the Carbon Footprint BigQuery export. | `string` | n/a | yes |
35-
28+
| Name | Description | Type | Default | Required |
29+
|------|-------------|------|---------|:--------:|
30+
| <a name="input_billing_account_id"></a> [billing\_account\_id](#input\_billing\_account\_id) | The GCP Billing Account in your organization. | `string` | n/a | yes |
31+
| <a name="input_carbon_data_export_dataset_id"></a> [carbon\_data\_export\_dataset\_id](#input\_carbon\_data\_export\_dataset\_id) | GCP BigQuery dataset containing the Carbon Footprint BigQuery export | `string` | n/a | yes |
32+
| <a name="input_carbon_data_export_project_id"></a> [carbon\_data\_export\_project\_id](#input\_carbon\_data\_export\_project\_id) | GCP Project where the BiqQuery table resides that holds the Carbon Footprint export to BigQuery. See https://cloud.google.com/billing/docs/how-to/export-data-bigquery | `string` | n/a | yes |
33+
| <a name="input_carbon_dataset_region"></a> [carbon\_dataset\_region](#input\_carbon\_dataset\_region) | The location of the BigQuery dataset for carbon data exports. | `string` | n/a | yes |
3634

3735
## Outputs
3836

39-
| Name | Description |
40-
|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------|
37+
| Name | Description |
38+
|------|-------------|
4139
| <a name="output_carbon_footprint_export_table_name"></a> [carbon\_footprint\_export\_table\_name](#output\_carbon\_footprint\_export\_table\_name) | The BigQuery table name containing the GCP Carbon Footprint BigQuery export. |

modules/meshcloud-kraken-service-account/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ No modules.
3030

3131
| Name | Description | Type | Default | Required |
3232
|------|-------------|------|---------|:--------:|
33-
| <a name="input_cloud_billing_export_project_id"></a> [cloud\_billing\_export\_project\_id](#input\_cloud\_billing\_export\_project\_id) | GCP Project where the BiqQery table resides that holds the Cloud Billing export to BigQuery. | `string` | n/a | yes |
33+
| <a name="input_cloud_billing_export_project_id"></a> [cloud\_billing\_export\_project\_id](#input\_cloud\_billing\_export\_project\_id) | GCP Project where the BigQuery table resides that holds the Cloud Billing export to BigQuery. | `string` | n/a | yes |
3434
| <a name="input_landing_zone_folder_ids"></a> [landing\_zone\_folder\_ids](#input\_landing\_zone\_folder\_ids) | GCP Folders that make up the Landing Zone. The service account will only receive permissions on these folders. | `set(string)` | n/a | yes |
3535
| <a name="input_meshstack_root_project_id"></a> [meshstack\_root\_project\_id](#input\_meshstack\_root\_project\_id) | GCP Project ID where to create the service account. This is typically a 'meshstack-root' project. | `string` | n/a | yes |
3636
| <a name="input_org_id"></a> [org\_id](#input\_org\_id) | GCP Organization ID that holds the projects that generate billing data that the service account should import. | `string` | n/a | yes |

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ variable "cloud_billing_export_table_id" {
3838
description = "GCP BigQuery table containing the Cloud Billing BigQuery export. This variable is only required to form the output for meshPlatform configuration. No resources are created or attached."
3939
}
4040

41+
# ---------------------------------------------------------------------------------------------------------------------
42+
# PARAMETERS to enable optional modules
43+
# ---------------------------------------------------------------------------------------------------------------------
44+
45+
variable "carbon_export_module_enabled" {
46+
type = bool
47+
description = "Determines whether or not to include the resources of the carbon footprint export module."
48+
default = false
49+
}
50+
4151
# ---------------------------------------------------------------------------------------------------------------------
4252
# OPTIONAL PARAMETERS
4353
# These parameters have reasonable defaults.

0 commit comments

Comments
 (0)