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 1 commit
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
3 changes: 3 additions & 0 deletions modules/binary-authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module "quality-attestor" {
|------|-------------|:----:|:-----:|:-----:|
| attestor-name | Name of the attestor | string | n/a | yes |
| project\_id | Project ID to apply services into | string | n/a | yes |
| crypto-algorithm | Algorithm used for the async signing keys | string | n/a | yes |
| disable_services_on_destroy | Whether project services will be disabled when the resources are destroyed | 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 | string | n/a | yes |

## Outputs

Expand Down
8 changes: 5 additions & 3 deletions modules/binary-authorization/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ 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" {
project = var.project_id
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"
imrannayer marked this conversation as resolved.
Show resolved Hide resolved
type = string
}

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 = string
}