Skip to content

Commit

Permalink
feat: Added variable for service dependency in binary_authorization s…
Browse files Browse the repository at this point in the history
…ub module (#584)
  • Loading branch information
imrannayer authored and morgante committed Jul 8, 2020
1 parent a5213c4 commit e3e5458
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions modules/binary-authorization/README.md
Expand Up @@ -35,6 +35,8 @@ module "quality-attestor" {
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attestor-name | Name of the attestor | string | n/a | yes |
| 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 |
| 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 |
| project\_id | Project ID to apply services into | string | n/a | yes |

## Outputs
Expand Down
6 changes: 4 additions & 2 deletions modules/binary-authorization/main.tf
Expand Up @@ -27,9 +27,11 @@ module "project-services" {
source = "terraform-google-modules/project-factory/google//modules/project_services"
version = "~> 8.0"

project_id = var.project_id

project_id = var.project_id
activate_apis = local.required_enabled_apis

disable_services_on_destroy = var.disable_services_on_destroy
disable_dependent_services = var.disable_dependent_services
}

resource "google_binary_authorization_attestor" "attestor" {
Expand Down
12 changes: 12 additions & 0 deletions modules/binary-authorization/variables.tf
Expand Up @@ -34,3 +34,15 @@ variable crypto-algorithm {
default = "RSA_SIGN_PKCS1_4096_SHA512"
description = "Algorithm used for the async signing keys"
}

variable "disable_services_on_destroy" {
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"
default = false
type = bool
}

variable "disable_dependent_services" {
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"
default = false
type = bool
}

0 comments on commit e3e5458

Please sign in to comment.