Skip to content

Commit 288e10d

Browse files
JohannesRudolphmeshkodiak[bot]
authored andcommitted
refactor: replace kraken manual setup information in outputs with vars
this way an operator deploying the module will discover them sooner. also mention them in the readme
1 parent 783b3b7 commit 288e10d

File tree

8 files changed

+27
-46
lines changed

8 files changed

+27
-46
lines changed

README.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ To run this module, you need the following:
3434
"cloudfunctions.functions.setIamPolicy",
3535
3636
# Only required for the optional submodule for exporting carbon data
37-
"resourcemanager.projects.update",
38-
"serviceusage.services.enable",
39-
"bigquery.datasets.get",
40-
"bigquery.datasets.update"
37+
"resourcemanager.projects.update"
4138
```
4239
4340
Organization-level:
@@ -55,9 +52,7 @@ To run this module, you need the following:
5552
"billing.accounts.setIamPolicy",
5653
# Only required when you need your landing zone to access the bucket containing your GDM templates
5754
"storage.buckets.getIamPolicy",
58-
"storage.buckets.setIamPolicy",
59-
# Only required for the optional submodule for exporting carbon data
60-
"billing.accounts.getCarbonInformation"
55+
"storage.buckets.setIamPolicy"
6156
```
6257
6358
You can create [custom roles](./custom-roles/main.tf) and assign them to the identity applying those modules.
@@ -82,6 +77,11 @@ resource "google_project" "meshstack_root" {
8277
}
8378
```
8479

80+
To provide some of the required variables, you will need to
81+
82+
- setup GCP Cloud Billing Export, see [cloud_billing_export_dataset_id](#input_cloud_billing_export_dataset_id)
83+
- *optionally* setup GCP Cloud Carbon Footprint Exports, see [cloud_carbon_export_dataset_id](#input_cloud_carbon_export_dataset_id)
84+
8585
### Using CLI
8686

8787
1. login with your gcloud account.
@@ -119,12 +119,6 @@ resource "google_project" "meshstack_root" {
119119
The replicator service account needs the "Groups Admin" role from the Admin Console (Workspace) to manage permissions for managed GCP projects.
120120
To authorize the Service Account **via the Google Admin Console** navigate to `@Account` in the sidebar and then `Admin Roles -> Groups Admin` and click `Assign Service Accounts`. In the prompt that appears, enter the service account email, which looks like `user@project.iam.gserviceaccount.com`.
121121

122-
6. Optional: Enable GCP Cloud Carbon Footprint Export Transfer
123-
124-
When configuring the module with `carbon_export_module_enabled = true`, you need to manually set up the GCP
125-
data transfer config.
126-
127-
128122
## Example Usages
129123

130124
Check [examples](./examples/) for different use cases. As a quick start we recommend using [basic-gcp-integration](./examples/basic-gcp-integration) example.
@@ -169,10 +163,10 @@ No resources.
169163
| <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 |
170164
| <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 |
171165
| <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 |
172-
| <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. | `string` | n/a | yes |
166+
| <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.<br><br> **ATTENTION**<br> You need to manually configure the billing account big query export before exceuting this module.<br> See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#set-up-gcp-billing-data-export for instructions. | `string` | n/a | yes |
173167
| <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 |
174168
| <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 |
175-
| <a name="input_cloud_carbon_export_dataset_id"></a> [cloud\_carbon\_export\_dataset\_id](#input\_cloud\_carbon\_export\_dataset\_id) | GCP BigQuery dataset containing the Cloud Carbon Footprint BigQuery export. | `string` | n/a | yes |
169+
| <a name="input_cloud_carbon_export_dataset_id"></a> [cloud\_carbon\_export\_dataset\_id](#input\_cloud\_carbon\_export\_dataset\_id) | GCP BigQuery dataset containing the Carbon Footprint BigQuery export.<br><br> **ATTENTION**<br> You need to manually configure the carbon footprint export transfer config before exceuting this module.<br> See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#optional-enable-gcp-cloud-carbon-footprint-export for instructions." | `string` | n/a | yes |
176170
| <a name="input_cloud_carbon_export_project_id"></a> [cloud\_carbon\_export\_project\_id](#input\_cloud\_carbon\_export\_project\_id) | GCP Project where the BiqQuery table resides that holds the Cloud Carbon Footprint export to BigQuery. | `string` | n/a | yes |
177171
| <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 |
178172
| <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 |
@@ -184,9 +178,7 @@ No resources.
184178

185179
| Name | Description |
186180
|------|-------------|
187-
| <a name="output_carbon_footprint_export_manual_setup"></a> [carbon\_footprint\_export\_manual\_setup](#output\_carbon\_footprint\_export\_manual\_setup) | GCP Cloud Carbon Footprint BigQuery export manual setup information. |
188181
| <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. |
189-
| <a name="output_cloud_billing_export_manual_setup"></a> [cloud\_billing\_export\_manual\_setup](#output\_cloud\_billing\_export\_manual\_setup) | GCP Cloud Billing BigQuery export manual setup information. |
190182
| <a name="output_cloud_billing_export_table_name"></a> [cloud\_billing\_export\_table\_name](#output\_cloud\_billing\_export\_table\_name) | The BigQuery table name containing the GCP Cloud Billing BigQuery export. |
191183
| <a name="output_kraken_sa_email"></a> [kraken\_sa\_email](#output\_kraken\_sa\_email) | Kraken service account email. |
192184
| <a name="output_kraken_sa_key"></a> [kraken\_sa\_key](#output\_kraken\_sa\_key) | Kraken service account key. |

modules/meshcloud-carbon-export/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ No modules.
2525

2626
| Name | Description | Type | Default | Required |
2727
|------|-------------|------|---------|:--------:|
28-
| <a name="input_cloud_carbon_export_dataset_id"></a> [cloud\_carbon\_export\_dataset\_id](#input\_cloud\_carbon\_export\_dataset\_id) | GCP BigQuery dataset containing the Carbon Footprint BigQuery export | `string` | n/a | yes |
29-
| <a name="input_cloud_carbon_export_project_id"></a> [cloud\_carbon\_export\_project\_id](#input\_cloud\_carbon\_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 |
28+
| <a name="input_cloud_carbon_export_dataset_id"></a> [cloud\_carbon\_export\_dataset\_id](#input\_cloud\_carbon\_export\_dataset\_id) | GCP BigQuery dataset containing the Carbon Footprint BigQuery export. | `string` | n/a | yes |
29+
| <a name="input_cloud_carbon_export_project_id"></a> [cloud\_carbon\_export\_project\_id](#input\_cloud\_carbon\_export\_project\_id) | GCP Project where the BiqQuery table resides that holds the Carbon Footprint export to BigQuery. | `string` | n/a | yes |
3030
| <a name="input_kraken_sa_email"></a> [kraken\_sa\_email](#input\_kraken\_sa\_email) | Kraken Service account email address. | `string` | n/a | yes |
3131

3232
## Outputs
3333

3434
| Name | Description |
3535
|------|-------------|
36-
| <a name="output_carbon_footprint_export_manual_setup"></a> [carbon\_footprint\_export\_manual\_setup](#output\_carbon\_footprint\_export\_manual\_setup) | GCP Cloud Carbon Footprint BigQuery export manual setup information. |
3736
| <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. |
3837
<!-- END_TF_DOCS -->

modules/meshcloud-carbon-export/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ output "carbon_footprint_export_table_name" {
55
# we can't control this via terraform right now
66
value = "${var.cloud_carbon_export_project_id}.${var.cloud_carbon_export_dataset_id}.carbon_footprint"
77
}
8-
9-
output "carbon_footprint_export_manual_setup" {
10-
description = "GCP Cloud Carbon Footprint BigQuery export manual setup information."
11-
value = "Attention. You need to manually configure the carbon footprint export transfer config before exceuting this module. See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#optional-enable-gcp-cloud-carbon-footprint-export for instructions."
12-
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
variable "cloud_carbon_export_project_id" {
22
type = string
3-
description = "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"
3+
description = "GCP Project where the BiqQuery table resides that holds the Carbon Footprint export to BigQuery."
44
}
55

66
variable "cloud_carbon_export_dataset_id" {
77
type = string
8-
description = "GCP BigQuery dataset containing the Carbon Footprint BigQuery export"
8+
description = "GCP BigQuery dataset containing the Carbon Footprint BigQuery export."
99
}
1010

1111
variable "kraken_sa_email" {
1212
type = string
1313
description = "Kraken Service account email address."
14-
1514
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ No modules.
4242

4343
| Name | Description |
4444
|------|-------------|
45-
| <a name="output_billing_export_manual_setup"></a> [billing\_export\_manual\_setup](#output\_billing\_export\_manual\_setup) | GCP Cloud Billing BigQuery export manual setup information. |
4645
| <a name="output_sa_email"></a> [sa\_email](#output\_sa\_email) | Service account email. |
4746
| <a name="output_sa_key"></a> [sa\_key](#output\_sa\_key) | Service account key (base64 encoded credential.json). |
4847
<!-- END_TF_DOCS -->

modules/meshcloud-kraken-service-account/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@ output "sa_email" {
88
value = google_service_account.meshcloud_kraken_sa.email
99
description = "Service account email."
1010
}
11-
12-
output "billing_export_manual_setup" {
13-
description = "GCP Cloud Billing BigQuery export manual setup information."
14-
value = "Attention. You need to manually configure the billing account big query export before exceuting this module. See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#set-up-gcp-billing-data-export for instructions."
15-
}

outputs.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,7 @@ output "cloud_billing_export_table_name" {
3030
value = "${var.cloud_billing_export_project_id}.${var.cloud_billing_export_dataset_id}.${var.cloud_billing_export_table_id}"
3131
}
3232

33-
output "cloud_billing_export_manual_setup" {
34-
description = "GCP Cloud Billing BigQuery export manual setup information."
35-
value = module.kraken_sa.billing_export_manual_setup
36-
}
37-
3833
output "carbon_footprint_export_table_name" {
3934
description = "The BigQuery table name containing the GCP Carbon Footprint BigQuery export."
4035
value = try(module.carbon_export[0].carbon_footprint_export_table_name, null)
4136
}
42-
43-
output "carbon_footprint_export_manual_setup" {
44-
description = "GCP Cloud Carbon Footprint BigQuery export manual setup information."
45-
value = try(module.carbon_export[0].carbon_footprint_export_manual_setup, null)
46-
}

variables.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ variable "cloud_billing_export_project_id" {
3030

3131
variable "cloud_billing_export_dataset_id" {
3232
type = string
33-
description = "GCP BigQuery dataset containing the Cloud Billing BigQuery export."
33+
description = <<EOF
34+
GCP BigQuery dataset containing the Cloud Billing BigQuery export.
35+
36+
**ATTENTION**
37+
You need to manually configure the billing account big query export before exceuting this module.
38+
See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#set-up-gcp-billing-data-export for instructions.
39+
EOF
3440
}
3541

3642
variable "cloud_billing_export_table_id" {
@@ -72,5 +78,11 @@ variable "cloud_carbon_export_project_id" {
7278

7379
variable "cloud_carbon_export_dataset_id" {
7480
type = string
75-
description = "GCP BigQuery dataset containing the Cloud Carbon Footprint BigQuery export."
81+
description = <<EOF
82+
GCP BigQuery dataset containing the Carbon Footprint BigQuery export.
83+
84+
**ATTENTION**
85+
You need to manually configure the carbon footprint export transfer config before exceuting this module.
86+
See https://docs.meshcloud.io/docs/meshstack.how-to.integrate-meshplatform-gcp-manually.html#optional-enable-gcp-cloud-carbon-footprint-export for instructions."
87+
EOF
7688
}

0 commit comments

Comments
 (0)