Skip to content

Commit

Permalink
Ensure all modules have an id output (#1410)
Browse files Browse the repository at this point in the history
* net-vpc

* a-d

* complete modules

* fix error
  • Loading branch information
ludoo authored Jun 2, 2023
1 parent f069562 commit 884cb8b
Show file tree
Hide file tree
Showing 91 changed files with 362 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module "common-datacatalog" {
tags = var.data_catalog_tags
}

# To create KMS keys in the common projet: uncomment this section and assigne key links accondingly in local.service_encryption_keys variable
# To create KMS keys in the common project: uncomment this section and assigne key links accondingly in local.service_encryption_keys variable

# module "cmn-kms-0" {
# source = "../../../modules/kms"
Expand Down
2 changes: 1 addition & 1 deletion modules/artifact-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module "docker_artifact_registry" {

| name | description | sensitive |
|---|---|:---:|
| [id](outputs.tf#L17) | Repository id. | |
| [id](outputs.tf#L17) | Fully qualified repository id. | |
| [name](outputs.tf#L22) | Repository name. | |

<!-- END TFDOC -->
2 changes: 1 addition & 1 deletion modules/artifact-registry/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

output "id" {
description = "Repository id."
description = "Fully qualified repository id."
value = google_artifact_registry_repository.registry.id
}

Expand Down
2 changes: 1 addition & 1 deletion modules/bigtable-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ module "bigtable-instance" {

| name | description | sensitive |
|---|---|:---:|
| [id](outputs.tf#L17) | An identifier for the resource with format projects/{{project}}/instances/{{name}}. | |
| [id](outputs.tf#L17) | Fully qualified instance id. | |
| [instance](outputs.tf#L26) | BigTable intance. | |
| [table_ids](outputs.tf#L35) | Map of fully qualified table ids keyed by table name. | |
| [tables](outputs.tf#L40) | Table resources. | |
Expand Down
2 changes: 1 addition & 1 deletion modules/bigtable-instance/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

output "id" {
description = "An identifier for the resource with format projects/{{project}}/instances/{{name}}."
description = "Fully qualified instance id."
value = google_bigtable_instance.default.id
depends_on = [
google_bigtable_instance_iam_binding.default,
Expand Down
2 changes: 1 addition & 1 deletion modules/billing-budget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ module "pubsub" {
| name | description | sensitive |
|---|---|:---:|
| [budget](outputs.tf#L17) | Budget resource. | |
| [id](outputs.tf#L22) | Budget ID. | |
| [id](outputs.tf#L22) | Fully qualified budget id. | |

<!-- END TFDOC -->
2 changes: 1 addition & 1 deletion modules/billing-budget/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ output "budget" {
}

output "id" {
description = "Budget ID."
description = "Fully qualified budget id."
value = google_billing_budget.budget.id
}
2 changes: 1 addition & 1 deletion modules/binauthz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module "binauthz" {
| name | description | sensitive |
|---|---|:---:|
| [attestors](outputs.tf#L17) | Attestors. | |
| [id](outputs.tf#L25) | Binary Authorization policy ID. | |
| [id](outputs.tf#L25) | Fully qualified Binary Authorization policy ID. | |
| [notes](outputs.tf#L30) | Notes. | |

<!-- END TFDOC -->
2 changes: 1 addition & 1 deletion modules/binauthz/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ output "attestors" {
}

output "id" {
description = "Binary Authorization policy ID."
description = "Fully qualified Binary Authorization policy ID."
value = google_binary_authorization_policy.policy.id
}

Expand Down
5 changes: 3 additions & 2 deletions modules/cloud-dataplex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ module "dataplex" {
| name | description | sensitive |
|---|---|:---:|
| [assets](outputs.tf#L17) | Assets attached to the lake of Dataplex Lake. | |
| [lake](outputs.tf#L22) | The lake name of Dataplex Lake. | |
| [zones](outputs.tf#L27) | The zone name of Dataplex Lake. | |
| [id](outputs.tf#L22) | Fully qualified Dataplex Lake id. | |
| [lake](outputs.tf#L27) | The lake name of Dataplex Lake. | |
| [zones](outputs.tf#L32) | The zone name of Dataplex Lake. | |

<!-- END TFDOC -->
5 changes: 5 additions & 0 deletions modules/cloud-dataplex/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ output "assets" {
value = local.zone_assets[*]["asset_name"]
}

output "id" {
description = "Fully qualified Dataplex Lake id."
value = google_dataplex_lake.basic_lake.id
}

output "lake" {
description = "The lake name of Dataplex Lake."
value = google_dataplex_lake.basic_lake.name
Expand Down
17 changes: 9 additions & 8 deletions modules/cloud-function/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,14 @@ module "cf-http-two" {
| [bucket_name](outputs.tf#L24) | Bucket name. | |
| [function](outputs.tf#L29) | Cloud function resources. | |
| [function_name](outputs.tf#L34) | Cloud function name. | |
| [service_account](outputs.tf#L39) | Service account resource. | |
| [service_account_email](outputs.tf#L44) | Service account email. | |
| [service_account_iam_email](outputs.tf#L49) | Service account email. | |
| [trigger_service_account](outputs.tf#L57) | Service account resource. | |
| [trigger_service_account_email](outputs.tf#L62) | Service account email. | |
| [trigger_service_account_iam_email](outputs.tf#L67) | Service account email. | |
| [uri](outputs.tf#L75) | Cloud function service uri. | |
| [vpc_connector](outputs.tf#L80) | VPC connector resource if created. | |
| [id](outputs.tf#L39) | Fully qualified function id. | |
| [service_account](outputs.tf#L44) | Service account resource. | |
| [service_account_email](outputs.tf#L49) | Service account email. | |
| [service_account_iam_email](outputs.tf#L54) | Service account email. | |
| [trigger_service_account](outputs.tf#L62) | Service account resource. | |
| [trigger_service_account_email](outputs.tf#L67) | Service account email. | |
| [trigger_service_account_iam_email](outputs.tf#L72) | Service account email. | |
| [uri](outputs.tf#L80) | Cloud function service uri. | |
| [vpc_connector](outputs.tf#L85) | VPC connector resource if created. | |

<!-- END TFDOC -->
5 changes: 5 additions & 0 deletions modules/cloud-function/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ output "function_name" {
value = local.function.name
}

output "id" {
description = "Fully qualified function id."
value = local.function.id
}

output "service_account" {
description = "Service account resource."
value = try(google_service_account.service_account[0], null)
Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-identity-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module "group" {

| name | description | sensitive |
|---|---|:---:|
| [id](outputs.tf#L17) | Group ID. | |
| [id](outputs.tf#L17) | Fully qualified group id. | |
| [name](outputs.tf#L22) | Group name. | |

<!-- END TFDOC -->
2 changes: 1 addition & 1 deletion modules/cloud-identity-group/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

output "id" {
description = "Group ID."
description = "Fully qualified group id."
value = google_cloud_identity_group.group.id
}

Expand Down
13 changes: 7 additions & 6 deletions modules/cloud-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ module "cloud_run" {

| name | description | sensitive |
|---|---|:---:|
| [service](outputs.tf#L18) | Cloud Run service. | |
| [service_account](outputs.tf#L23) | Service account resource. | |
| [service_account_email](outputs.tf#L28) | Service account email. | |
| [service_account_iam_email](outputs.tf#L33) | Service account email. | |
| [service_name](outputs.tf#L41) | Cloud Run service name. | |
| [vpc_connector](outputs.tf#L47) | VPC connector resource if created. | |
| [id](outputs.tf#L18) | Fully qualified service id. | |
| [service](outputs.tf#L23) | Cloud Run service. | |
| [service_account](outputs.tf#L28) | Service account resource. | |
| [service_account_email](outputs.tf#L33) | Service account email. | |
| [service_account_iam_email](outputs.tf#L38) | Service account email. | |
| [service_name](outputs.tf#L46) | Cloud Run service name. | |
| [vpc_connector](outputs.tf#L52) | VPC connector resource if created. | |

<!-- END TFDOC -->
5 changes: 5 additions & 0 deletions modules/cloud-run/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
* limitations under the License.
*/

output "id" {
description = "Fully qualified service id."
value = google_cloud_run_service.service.id
}

output "service" {
description = "Cloud Run service."
value = google_cloud_run_service.service
Expand Down
5 changes: 2 additions & 3 deletions modules/cloudsql-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ module "db" {
}
# tftest modules=1 resources=2 inventory=public-ip.yaml
```

<!-- BEGIN TFDOC -->

## Variables
Expand Down Expand Up @@ -198,8 +197,8 @@ module "db" {
|---|---|:---:|
| [connection_name](outputs.tf#L24) | Connection name of the primary instance. | |
| [connection_names](outputs.tf#L29) | Connection names of all instances. | |
| [id](outputs.tf#L37) | ID of the primary instance. | |
| [ids](outputs.tf#L42) | IDs of all instances. | |
| [id](outputs.tf#L37) | Fully qualified primary instance id. | |
| [ids](outputs.tf#L42) | Fully qualified ids of all instances. | |
| [instances](outputs.tf#L50) | Cloud SQL instance resources. ||
| [ip](outputs.tf#L56) | IP address of the primary instance. | |
| [ips](outputs.tf#L61) | IP addresses of all instances. | |
Expand Down
18 changes: 9 additions & 9 deletions modules/cloudsql-instance/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

locals {
_all_intances = merge(
_all_instances = merge(
{ primary = google_sql_database_instance.primary },
google_sql_database_instance.replicas
)
Expand All @@ -29,27 +29,27 @@ output "connection_name" {
output "connection_names" {
description = "Connection names of all instances."
value = {
for id, instance in local._all_intances :
for id, instance in local._all_instances :
id => instance.connection_name
}
}

output "id" {
description = "ID of the primary instance."
description = "Fully qualified primary instance id."
value = google_sql_database_instance.primary.private_ip_address
}

output "ids" {
description = "IDs of all instances."
description = "Fully qualified ids of all instances."
value = {
for id, instance in local._all_intances :
for id, instance in local._all_instances :
id => instance.id
}
}

output "instances" {
description = "Cloud SQL instance resources."
value = local._all_intances
value = local._all_instances
sensitive = true
}

Expand All @@ -61,7 +61,7 @@ output "ip" {
output "ips" {
description = "IP addresses of all instances."
value = {
for id, instance in local._all_intances :
for id, instance in local._all_instances :
id => instance.private_ip_address
}
}
Expand All @@ -74,7 +74,7 @@ output "name" {
output "names" {
description = "Names of all instances."
value = {
for id, instance in local._all_intances :
for id, instance in local._all_instances :
id => instance.name
}
}
Expand All @@ -93,7 +93,7 @@ output "self_link" {
output "self_links" {
description = "Self links of all instances."
value = {
for id, instance in local._all_intances :
for id, instance in local._all_instances :
id => instance.self_link
}
}
Expand Down
1 change: 1 addition & 0 deletions modules/compute-mig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,5 +444,6 @@ module "nginx-mig" {
| [autoscaler](outputs.tf#L17) | Auto-created autoscaler resource. | |
| [group_manager](outputs.tf#L26) | Instance group resource. | |
| [health_check](outputs.tf#L35) | Auto-created health-check resource. | |
| [id](outputs.tf#L44) | Fully qualified group manager id. | |

<!-- END TFDOC -->
9 changes: 9 additions & 0 deletions modules/compute-mig/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ output "health_check" {
: google_compute_health_check.default.0
)
}

output "id" {
description = "Fully qualified group manager id."
value = try(
google_compute_instance_group_manager.default.0.id,
google_compute_region_instance_group_manager.default.0.id,
null
)
}
19 changes: 10 additions & 9 deletions modules/compute-vm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -541,15 +541,16 @@ module "instance-group" {
|---|---|:---:|
| [external_ip](outputs.tf#L17) | Instance main interface external IP addresses. | |
| [group](outputs.tf#L26) | Instance group resource. | |
| [instance](outputs.tf#L31) | Instance resource. | |
| [internal_ip](outputs.tf#L36) | Instance main interface internal IP address. | |
| [internal_ips](outputs.tf#L44) | Instance interfaces internal IP addresses. | |
| [self_link](outputs.tf#L52) | Instance self links. | |
| [service_account](outputs.tf#L57) | Service account resource. | |
| [service_account_email](outputs.tf#L64) | Service account email. | |
| [service_account_iam_email](outputs.tf#L69) | Service account email. | |
| [template](outputs.tf#L77) | Template resource. | |
| [template_name](outputs.tf#L82) | Template name. | |
| [id](outputs.tf#L31) | Fully qualified instance id. | |
| [instance](outputs.tf#L36) | Instance resource. | |
| [internal_ip](outputs.tf#L41) | Instance main interface internal IP address. | |
| [internal_ips](outputs.tf#L49) | Instance interfaces internal IP addresses. | |
| [self_link](outputs.tf#L57) | Instance self links. | |
| [service_account](outputs.tf#L62) | Service account resource. | |
| [service_account_email](outputs.tf#L69) | Service account email. | |
| [service_account_iam_email](outputs.tf#L74) | Service account email. | |
| [template](outputs.tf#L82) | Template resource. | |
| [template_name](outputs.tf#L87) | Template name. | |

<!-- END TFDOC -->
## TODO
Expand Down
5 changes: 5 additions & 0 deletions modules/compute-vm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ output "group" {
value = try(google_compute_instance_group.unmanaged.0, null)
}

output "id" {
description = "Fully qualified instance id."
value = try(google_compute_instance.default.0.id, null)
}

output "instance" {
description = "Instance resource."
value = try(google_compute_instance.default.0, null)
Expand Down
2 changes: 1 addition & 1 deletion modules/container-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ module "container_registry" {

| name | description | sensitive |
|---|---|:---:|
| [bucket_id](outputs.tf#L17) | ID of the GCS bucket created. | |
| [id](outputs.tf#L17) | Fully qualified id of the registry bucket. | |

<!-- END TFDOC -->
4 changes: 2 additions & 2 deletions modules/container-registry/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

output "bucket_id" {
description = "ID of the GCS bucket created."
output "id" {
description = "Fully qualified id of the registry bucket."
value = google_container_registry.registry.id
}
4 changes: 2 additions & 2 deletions modules/data-catalog-policy-tag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ module "cmn-dc" {

| name | description | sensitive |
|---|---|:---:|
| [tags](outputs.tf#L17) | Policy Tags. | |
| [taxonomy_id](outputs.tf#L22) | Taxonomy id. | |
| [id](outputs.tf#L17) | Fully qualified taxonomy id. | |
| [tags](outputs.tf#L22) | Policy Tags. | |

<!-- END TFDOC -->
## TODO
Expand Down
10 changes: 5 additions & 5 deletions modules/data-catalog-policy-tag/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

output "id" {
description = "Fully qualified taxonomy id."
value = google_data_catalog_taxonomy.default.id
}

output "tags" {
description = "Policy Tags."
value = { for k, v in google_data_catalog_policy_tag.default : k => v.id }
}

output "taxonomy_id" {
description = "Taxonomy id."
value = google_data_catalog_taxonomy.default.id
}
2 changes: 1 addition & 1 deletion modules/datafusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module "datafusion" {

| name | description | sensitive |
|---|---|:---:|
| [id](outputs.tf#L17) | DataFusion instance ID. | |
| [id](outputs.tf#L17) | Fully qualified instance id. | |
| [ip_allocation](outputs.tf#L22) | IP range reserved for Data Fusion instance in case of a private instance. | |
| [resource](outputs.tf#L27) | DataFusion resource. | |
| [service_account](outputs.tf#L32) | DataFusion Service Account. | |
Expand Down
2 changes: 1 addition & 1 deletion modules/datafusion/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

output "id" {
description = "DataFusion instance ID."
description = "Fully qualified instance id."
value = google_data_fusion_instance.default.id
}

Expand Down
Loading

0 comments on commit 884cb8b

Please sign in to comment.