Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added variable for service dependency in binary_authorization sub module #584

Merged
merged 6 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/binary-authorization/README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
}