Skip to content

Commit

Permalink
Merge pull request #1175 from juliodiez/serverless-program
Browse files Browse the repository at this point in the history
Serverless networking program
  • Loading branch information
juliodiez authored Feb 25, 2023
2 parents df9e332 + b1e37f6 commit 463dc41
Show file tree
Hide file tree
Showing 14 changed files with 1,090 additions and 0 deletions.
287 changes: 287 additions & 0 deletions blueprints/serverless/cloud-run-corporate/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
608 changes: 608 additions & 0 deletions blueprints/serverless/cloud-run-corporate/main.tf

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions blueprints/serverless/cloud-run-corporate/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

output "default_URL_cart" {
description = "Cloud Run service 'cart' default URL."
value = (var.custom_domain != null ?
module.cloud_run_cart[0].service.status[0].url : "none")
}

output "default_URL_checkout" {
description = "Cloud Run service 'checkout' default URL."
value = (var.custom_domain != null ?
module.cloud_run_checkout[0].service.status[0].url : "none")
}

output "default_URL_hello" {
description = "Cloud Run service 'hello' default URL."
value = module.cloud_run_hello.service.status[0].url
}

output "load_balancer_ip" {
description = "Load Balancer IP address."
value = var.custom_domain != null ? module.ilb-l7[0].address : "none"
}
20 changes: 20 additions & 0 deletions blueprints/serverless/cloud-run-corporate/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

provider "google" {
user_project_override = true
billing_project = var.prj_main_id
}
138 changes: 138 additions & 0 deletions blueprints/serverless/cloud-run-corporate/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/**
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

variable "access_policy" {
description = "VPC SC access policy, if it exists."
type = string
default = null
}

variable "access_policy_create" {
description = "Parameters for the creation of a VPC SC access policy."
type = object({
parent = string
title = string
})
default = null
}

variable "custom_domain" {
description = "Custom domain for the Load Balancer."
type = string
default = null
}

variable "image" {
description = "Container image to deploy."
type = string
default = "us-docker.pkg.dev/cloudrun/container/hello"
}

variable "ingress_settings" {
description = "Ingress traffic sources allowed to call the service."
type = string
default = "internal"
}

variable "ip_ranges" {
description = "IPs or IP ranges used by VPCs."
type = map(map(string))
default = {
main = {
subnet = "10.0.1.0/24"
subnet_proxy = "10.10.0.0/24"
psc_addr = "10.0.0.100"
}
onprem = {
subnet = "172.16.1.0/24"
}
prj1 = {
subnet = "10.0.2.0/24"
psc_addr = "10.0.0.200"
}
}
}

variable "prj_main_create" {
description = "Parameters for the creation of the main project."
type = object({
billing_account_id = string
parent = string
})
default = null
}

variable "prj_main_id" {
description = "Main Project ID."
type = string
}

variable "prj_onprem_create" {
description = "Parameters for the creation of an 'onprem' project."
type = object({
billing_account_id = string
parent = string
})
default = null
}

variable "prj_onprem_id" {
description = "Onprem Project ID."
type = string
default = null
}

variable "prj_prj1_create" {
description = "Parameters for the creation of project 1."
type = object({
billing_account_id = string
parent = string
})
default = null
}

variable "prj_prj1_id" {
description = "Project 1 ID."
type = string
default = null
}

variable "prj_svc1_create" {
description = "Parameters for the creation of service project 1."
type = object({
billing_account_id = string
parent = string
})
default = null
}

variable "prj_svc1_id" {
description = "Service Project 1 ID."
type = string
default = null
}

variable "region" {
description = "Cloud region where resource will be deployed."
type = string
default = "europe-west1"
}

variable "tf_identity" {
description = "Terraform identity to include in VPC SC perimeter."
type = string
default = null
}

0 comments on commit 463dc41

Please sign in to comment.