Project Module: add VPC-SC support (#212)
* Add VPC-SC support for Regions, device policy and access policy dependency. * fix compute mig module test * Fixes * Fix example * Add VPC-SC support in the project module. Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
parent
404d7efcaa
commit
2916f4e078
|
@ -176,6 +176,8 @@ module "project-host" {
|
|||
| *prefix* | Prefix used to generate project id and name. | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *project_create* | Create project. When set to false, uses a data source to reference existing project. | <code title="">bool</code> | | <code title="">true</code> |
|
||||
| *service_config* | Configure service API activation. | <code title="object({ disable_on_destroy = bool disable_dependent_services = bool })">object({...})</code> | | <code title="{ disable_on_destroy = true disable_dependent_services = true }">...</code> |
|
||||
| *service_perimeter_bridges* | Name of VPC-SC Bridge perimeters to add project into. Specify the name in the form of 'accessPolicies/ACCESS_POLICY_NAME/servicePerimeters/PERIMETER_NAME'. | <code title="list(string)">list(string)</code> | | <code title="">null</code> |
|
||||
| *service_perimeter_standard* | Name of VPC-SC Standard perimeter to add project into. Specify the name in the form of 'accessPolicies/ACCESS_POLICY_NAME/servicePerimeters/PERIMETER_NAME'. | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *services* | Service APIs to enable. | <code title="list(string)">list(string)</code> | | <code title="">[]</code> |
|
||||
| *shared_vpc_host_config* | Configures this project as a Shared VPC host project (mutually exclusive with shared_vpc_service_project). | <code title="object({ enabled = bool service_projects = list(string) })">object({...})</code> | | <code title="{ enabled = false service_projects = [] }">...</code> |
|
||||
| *shared_vpc_service_config* | Configures this project as a Shared VPC service project (mutually exclusive with shared_vpc_host_config). | <code title="object({ attach = bool host_project = string })">object({...})</code> | | <code title="{ attach = false host_project = "" }">...</code> |
|
||||
|
|
|
@ -316,3 +316,21 @@ resource "google_essential_contacts_contact" "contact" {
|
|||
language_tag = "en"
|
||||
notification_category_subscriptions = each.value
|
||||
}
|
||||
|
||||
resource "google_access_context_manager_service_perimeter_resource" "service-perimeter-resource-standard" {
|
||||
count = var.service_perimeter_standard != null ? 1 : 0
|
||||
|
||||
# If used, remember to uncomment 'lifecycle' block in the
|
||||
# modules/vpc-sc/google_access_context_manager_service_perimeter resource.
|
||||
perimeter_name = var.service_perimeter_standard
|
||||
resource = "projects/${local.project.number}"
|
||||
}
|
||||
|
||||
resource "google_access_context_manager_service_perimeter_resource" "service-perimeter-resource-bridges" {
|
||||
for_each = toset(var.service_perimeter_bridges != null ? var.service_perimeter_bridges : [])
|
||||
|
||||
# If used, remember to uncomment 'lifecycle' block in the
|
||||
# modules/vpc-sc/google_access_context_manager_service_perimeter resource.
|
||||
perimeter_name = each.value
|
||||
resource = "projects/${local.project.number}"
|
||||
}
|
||||
|
|
|
@ -192,3 +192,16 @@ variable "contacts" {
|
|||
type = map(list(string))
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "service_perimeter_standard" {
|
||||
description = "Name of VPC-SC Standard perimeter to add project into. Specify the name in the form of 'accessPolicies/ACCESS_POLICY_NAME/servicePerimeters/PERIMETER_NAME'."
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
|
||||
variable "service_perimeter_bridges" {
|
||||
description = "Name of VPC-SC Bridge perimeters to add project into. Specify the name in the form of 'accessPolicies/ACCESS_POLICY_NAME/servicePerimeters/PERIMETER_NAME'."
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue