Skip to content

Commit d6d9ec7

Browse files
committed
removing unused variable, assuming existing VPC is already peered
1 parent a777c7a commit d6d9ec7

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

grafana_v2/kickstart_v2/terraform/gcp/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The Redis Cloud Grafana Kickstarter automates the deployment of a complete obser
55
## What This Kickstarter Does
66

77
- **Network Infrastructure**: Creates a new VPC and subnet in GCP (or uses existing ones if provided)
8-
- **VPC Peering**: Establishes secure peering between your GCP VPC and Redis Cloud Pro subscription
8+
- **VPC Peering**: Establishes secure peering between your GCP VPC and Redis Cloud Pro subscription (If you bring your own VCP it's assumed it's already peered)
99
- **Monitoring Stack**: Deploys a VM with Prometheus and Grafana pre-configured for Redis monitoring
1010
- **Dashboard Integration**: Automatically installs Redis Cloud dashboards from this repository
1111
- **SSL & Domain Setup**: Configures nginx reverse proxy with Let's Encrypt SSL certificates

grafana_v2/kickstart_v2/terraform/gcp/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,18 @@ resource "google_compute_firewall" "redispeer_allow_egress" {
121121

122122

123123
resource "rediscloud_subscription_peering" "redispeer-sub-vpc-peering" {
124+
count = var.existing_vpc_id == null ? 1 : 0
124125
subscription_id = var.subscription_id
125126
provider_name="GCP"
126127
gcp_project_id = var.gcp_project
127128
gcp_network_name = local.vpc_name
128129
}
129130

130131
resource "google_compute_network_peering" "redispeer-gcp-vpc-peering" {
132+
count = var.existing_vpc_id == null ? 1 : 0
131133
name = "redispeer-gcp-vpc-peering"
132134
network = local.vpc_id
133-
peer_network = "https://www.googleapis.com/compute/v1/projects/${rediscloud_subscription_peering.redispeer-sub-vpc-peering.gcp_redis_project_id}/global/networks/${rediscloud_subscription_peering.redispeer-sub-vpc-peering.gcp_redis_network_name}"
135+
peer_network = "https://www.googleapis.com/compute/v1/projects/${rediscloud_subscription_peering.redispeer-sub-vpc-peering[0].gcp_redis_project_id}/global/networks/${rediscloud_subscription_peering.redispeer-sub-vpc-peering[0].gcp_redis_network_name}"
134136
}
135137

136138
resource "google_compute_instance" "redispeerr-vm"{

grafana_v2/kickstart_v2/terraform/gcp/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ variable "redis_cloud_api_key" {
2828
description = "The Redis Cloud API key"
2929
}
3030

31-
variable "sub_name" {
32-
type = string
33-
description = "The name of the subscription"
34-
}
35-
3631
variable "db_name" {
3732
type = string
3833
description = "The name of the database"

0 commit comments

Comments
 (0)