Skip to content

Commit e3e5458

Browse files
imrannayermorgante
authored andcommitted
feat: Added variable for service dependency in binary_authorization sub module (#584)
1 parent a5213c4 commit e3e5458

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

modules/binary-authorization/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ module "quality-attestor" {
3535
| Name | Description | Type | Default | Required |
3636
|------|-------------|:----:|:-----:|:-----:|
3737
| attestor-name | Name of the attestor | string | n/a | yes |
38+
| 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 | bool | `"false"` | no |
39+
| 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 | bool | `"false"` | no |
3840
| project\_id | Project ID to apply services into | string | n/a | yes |
3941

4042
## Outputs

modules/binary-authorization/main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ module "project-services" {
2727
source = "terraform-google-modules/project-factory/google//modules/project_services"
2828
version = "~> 8.0"
2929

30-
project_id = var.project_id
31-
30+
project_id = var.project_id
3231
activate_apis = local.required_enabled_apis
32+
33+
disable_services_on_destroy = var.disable_services_on_destroy
34+
disable_dependent_services = var.disable_dependent_services
3335
}
3436

3537
resource "google_binary_authorization_attestor" "attestor" {

modules/binary-authorization/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,15 @@ variable crypto-algorithm {
3434
default = "RSA_SIGN_PKCS1_4096_SHA512"
3535
description = "Algorithm used for the async signing keys"
3636
}
37+
38+
variable "disable_services_on_destroy" {
39+
description = "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"
40+
default = false
41+
type = bool
42+
}
43+
44+
variable "disable_dependent_services" {
45+
description = "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"
46+
default = false
47+
type = bool
48+
}

0 commit comments

Comments
 (0)