Skip to content

Commit

Permalink
add example to test
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody committed Jun 6, 2024
1 parent 8c67e92 commit 06c45ea
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,29 @@ module "service-project-c" {
grant_network_role = false
}

/******************************************
Fourth Service Project Creation
To test shared_vpc_deletion_policy
*****************************************/
module "service-project-d" {
source = "terraform-google-modules/project-factory/google//modules/svpc_service_project"
version = "~> 15.0"

name = "d-${var.service_project_name}"
random_project_id = false

org_id = var.organization_id
folder_id = var.folder_id
billing_account = var.billing_account

shared_vpc = module.host-project.project_id
shared_vpc_subnets = module.vpc.subnets_self_links

svpc_deletion_policy = "ABANDON"

disable_services_on_destroy = false
}

/******************************************
Example dependency on service-project
*****************************************/
Expand Down
1 change: 1 addition & 0 deletions modules/svpc_service_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module "service-project" {
| sa\_role | A role to give the default Service Account for the project (defaults to none) | `string` | `""` | no |
| shared\_vpc | The ID of the host project which hosts the shared VPC | `string` | `""` | no |
| shared\_vpc\_subnets | List of subnets fully qualified subnet IDs (ie. projects/$project\_id/regions/$region/subnetworks/$subnet\_id) | `list(string)` | `[]` | no |
| svpc\_deletion\_policy | The deletion policy for the service project shared VPC. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: null, "ABANDON". | `string` | `null` | no |
| usage\_bucket\_name | Name of a GCS bucket to store GCE usage reports in (optional) | `string` | `""` | no |
| usage\_bucket\_prefix | Prefix in the GCS bucket to store GCE usage reports in (optional) | `string` | `""` | no |

Expand Down
1 change: 1 addition & 0 deletions modules/svpc_service_project/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module "project-factory" {
project_id = var.project_id
shared_vpc = var.shared_vpc
enable_shared_vpc_service_project = true
shared_vpc_deletion_policy = var.svpc_deletion_policy
grant_network_role = var.grant_network_role
billing_account = var.billing_account
folder_id = var.folder_id
Expand Down
6 changes: 6 additions & 0 deletions modules/svpc_service_project/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,9 @@ variable "default_network_tier" {
type = string
default = ""
}

variable "svpc_deletion_policy" {
description = "The deletion policy for the service project shared VPC. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: null, \"ABANDON\"."
type = string
default = null
}

0 comments on commit 06c45ea

Please sign in to comment.