Skip to content

Commit

Permalink
Make project_id output depend on project services
Browse files Browse the repository at this point in the history
  • Loading branch information
morgante committed Apr 3, 2019
1 parent 8d10c31 commit 5971223
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/core_project_factory/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ output "project_name" {
}

output "project_id" {
value = "${google_project.main.project_id}"
value = "${element(concat(google_project_service.project_services.*.project, list(local.project_id)), 0)}"
}

output "project_number" {
Expand Down
8 changes: 4 additions & 4 deletions modules/project_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ See [examples/project_services](./examples/project_services) for an example.

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| activate\_apis | The list of apis to activate within the project | list | n/a | yes |
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed. https://www.terraform.io/docs/providers/google/r/google_project_service.html#disable_on_destroy | string | `"true"` | no |
| enable\_apis | Whether to actually enable the APIs. If false, this module is a no-op. | string | `"true"` | no |
| project\_id | The GCP project you want to enable APIs on | string | n/a | yes |
| activate\_apis | The list of apis to activate within the project | list | - | yes |
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed. https://www.terraform.io/docs/providers/google/r/google_project_service.html#disable_on_destroy | string | `true` | no |
| enable\_apis | Whether to actually enable the APIs. If false, this module is a no-op. | string | `true` | no |
| project\_id | The GCP project you want to enable APIs on | string | - | yes |

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions modules/project_services/examples/project_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Expected variables:

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | string | `""` | no |
| project\_id | The GCP project you want to enable APIs on | string | n/a | yes |
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | - | yes |
| project\_id | The GCP project you want to enable APIs on | string | - | yes |

## Outputs

Expand Down
2 changes: 1 addition & 1 deletion modules/project_services/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

output "project_id" {
description = "The GCP project you want to enable APIs on"
value = "${element(concat(google_project_service.project_services.*.project, list("")),0)}"
value = "${element(concat(google_project_service.project_services.*.project, list("")), 0)}"
}

0 comments on commit 5971223

Please sign in to comment.