Skip to content

Commit fc22676

Browse files
authored
Merge pull request #188 from alexkonkin/bug/project_add_disable_dependent_services
disable_dependent_services argument/variable have been added
2 parents c212232 + 59993ec commit fc22676

File tree

13 files changed

+39
-6
lines changed

13 files changed

+39
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Extending the adopted spec, each change should have a link to its corresponding
99
## [Unreleased]
1010

1111
### Added
12-
1312
- The ability to change bucket location. [#170]
13+
- The argument disable_dependent_services and corresponding variable [#188]
1414

1515
## [2.1.3] - 2019-04-03
1616

@@ -133,6 +133,7 @@ Extending the adopted spec, each change should have a link to its corresponding
133133
[0.2.1]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v0.2.0...v0.2.1
134134
[0.2.0]: https://github.com/terraform-google-modules/terraform-google-project-factory/compare/v0.1.0...v0.2.0
135135

136+
[#188]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/188
136137
[#170]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/170
137138
[#180]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/180
138139
[#178]: https://github.com/terraform-google-modules/terraform-google-project-factory/pull/178

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ determining that location is as follows:
112112
| bucket\_name | A name for a GCS bucket to create (in the bucket_project project), useful for Terraform state (optional) | string | `""` | no |
113113
| bucket\_project | A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional) | string | `""` | no |
114114
| 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 |
115+
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. | string | `"true"` | no |
115116
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | string | `"true"` | no |
116117
| domain | The domain name (optional). | string | `""` | no |
117118
| folder\_id | The ID of a folder to host this project | string | `""` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ module "project-factory" {
5050
bucket_name = "${var.bucket_name}"
5151
auto_create_network = "${var.auto_create_network}"
5252
disable_services_on_destroy = "${var.disable_services_on_destroy}"
53+
disable_dependent_services = "${var.disable_dependent_services}"
5354
}

modules/core_project_factory/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
| bucket\_name | A name for a GCS bucket to create (in the bucket_project project), useful for Terraform state (optional) | string | `""` | no |
1414
| bucket\_project | A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional) | string | `""` | no |
1515
| 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 |
16+
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. | string | `"true"` | no |
1617
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | string | `"true"` | no |
1718
| folder\_id | The ID of a folder to host this project | string | `""` | no |
1819
| group\_email | The email address of a group to control the project by being assigned group_role. | string | n/a | yes |

modules/core_project_factory/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ resource "google_project_service" "project_services" {
106106
project = "${google_project.main.project_id}"
107107
service = "${element(var.activate_apis, count.index)}"
108108

109-
disable_on_destroy = "${var.disable_services_on_destroy}"
109+
disable_on_destroy = "${var.disable_services_on_destroy}"
110+
disable_dependent_services = "${var.disable_dependent_services}"
110111

111112
depends_on = ["google_project.main"]
112113
}

modules/core_project_factory/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,9 @@ variable "disable_services_on_destroy" {
129129
default = "true"
130130
type = "string"
131131
}
132+
133+
variable "disable_dependent_services" {
134+
description = "Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed."
135+
default = "true"
136+
type = "string"
137+
}

modules/gsuite_enabled/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ The roles granted are specifically:
6767
| bucket\_project | A project to create a GCS bucket (bucket_name) in, useful for Terraform state (optional) | string | `""` | no |
6868
| create\_group | Whether to create the group or not | string | `"false"` | no |
6969
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | string | n/a | yes |
70+
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. | string | `"true"` | no |
7071
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | string | `"true"` | no |
7172
| domain | The domain name (optional). | string | `""` | no |
7273
| folder\_id | The ID of a folder to host this project | string | `""` | no |

modules/gsuite_enabled/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ module "project-factory" {
8787
bucket_name = "${var.bucket_name}"
8888
auto_create_network = "${var.auto_create_network}"
8989
disable_services_on_destroy = "${var.disable_services_on_destroy}"
90+
disable_dependent_services = "${var.disable_dependent_services}"
9091
}

modules/gsuite_enabled/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,9 @@ variable "disable_services_on_destroy" {
139139
default = "true"
140140
type = "string"
141141
}
142+
143+
variable "disable_dependent_services" {
144+
description = "Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed."
145+
default = "true"
146+
type = "string"
147+
}

modules/project_services/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ See [examples/project_services](./examples/project_services) for an example.
2828
| Name | Description | Type | Default | Required |
2929
|------|-------------|:----:|:-----:|:-----:|
3030
| activate\_apis | The list of apis to activate within the project | list | n/a | yes |
31+
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. https://www.terraform.io/docs/providers/google/r/google_project_service.html#disable_dependent_services | string | `"true"` | no |
3132
| 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 |
3233
| enable\_apis | Whether to actually enable the APIs. If false, this module is a no-op. | string | `"true"` | no |
3334
| project\_id | The GCP project you want to enable APIs on | string | n/a | yes |

0 commit comments

Comments
 (0)