fixed variables and outputs

This commit is contained in:
Christoph Grotz 2023-02-24 17:49:51 +00:00
parent 7021682746
commit 12d70832d2
4 changed files with 40 additions and 18 deletions

View File

@ -99,13 +99,19 @@ The above command will delete the associated resources so there will be no billa
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
| [consumer_project_id](variables.tf#L32) | The consumer project, in which the GCLB and Cloud Armor should be created. | <code>string</code> | ✓ | |
| [prefix](variables.tf#L17) | Prefix used for resource names. | <code>string</code> | ✓ | |
| [producer_project_id](variables.tf#L37) | The producer project, in which the ILB, PSC Service Attachment and Cloud Run service should be created | <code>string</code> | ✓ | |
| [project_create](variables.tf#L26) | Create project instead of using an existing one. | <code>bool</code> | | <code>false</code> |
| [consumer_project_id](variables.tf#L17) | The consumer project, in which the GCLB and Cloud Armor should be created. | <code>string</code> | ✓ | |
| [prefix](variables.tf#L22) | Prefix used for resource names. | <code>string</code> | ✓ | |
| [producer_project_id](variables.tf#L31) | The producer project, in which the ILB, PSC Service Attachment and Cloud Run service should be created | <code>string</code> | ✓ | |
| [project_create](variables.tf#L36) | Create project instead of using an existing one. | <code>bool</code> | | <code>false</code> |
| [region](variables.tf#L42) | The GCP region in which the resources should be deployed. | <code>string</code> | | <code>&#34;europe-west1&#34;</code> |
| [zone](variables.tf#L48) | The GCP zone for the VM. | <code>string</code> | | <code>&#34;europe-west1-b&#34;</code> |
## Outputs
| name | description | sensitive |
|---|---|:---:|
| [lb_ip](outputs.tf#L17) | Load balancer IP address. | |
<!-- END TFDOC -->
## Test

View File

@ -43,10 +43,6 @@ resource "google_compute_global_forwarding_rule" "default" {
port_range = "80"
}
output "lb_ip" {
value = google_compute_global_forwarding_rule.default.ip_address
}
resource "google_compute_target_http_proxy" "default" {
project = module.consumer_project.project_id
name = "target-proxy"

View File

@ -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.
*/
output "lb_ip" {
description = "Load balancer IP address."
value = google_compute_global_forwarding_rule.default.ip_address
}

View File

@ -14,6 +14,11 @@
* limitations under the License.
*/
variable "consumer_project_id" {
description = "The consumer project, in which the GCLB and Cloud Armor should be created."
type = string
}
variable "prefix" {
description = "Prefix used for resource names."
type = string
@ -23,22 +28,17 @@ variable "prefix" {
}
}
variable "producer_project_id" {
description = "The producer project, in which the ILB, PSC Service Attachment and Cloud Run service should be created"
type = string
}
variable "project_create" {
description = "Create project instead of using an existing one."
type = bool
default = false
}
variable "consumer_project_id" {
description = "The consumer project, in which the GCLB and Cloud Armor should be created."
type = string
}
variable "producer_project_id" {
description = "The producer project, in which the ILB, PSC Service Attachment and Cloud Run service should be created"
type = string
}
variable "region" {
description = "The GCP region in which the resources should be deployed."
type = string