Skip to content

Commit e088d50

Browse files
committed
change variable name in valkey
1 parent d928f70 commit e088d50

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

examples/valkey/main.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,12 @@ module "enable_apis" {
3434

3535

3636
module "valkey_cluster" {
37-
# source = "terraform-google-modules/memorystore/google//modules/valkey"
38-
# version = "~> 11.0"
37+
source = "terraform-google-modules/memorystore/google//modules/valkey"
38+
version = "~> 11.0"
3939

40-
source = "../../modules/valkey"
4140

4241
instance_id = "test-valkey-cluster"
43-
project = var.project_id
42+
project_id = var.project_id
4443
location = "us-central1"
4544
node_type = "HIGHMEM_MEDIUM"
4645
deletion_protection_enabled = false

modules/valkey/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ module "valkey_cluster" {
5353
| network\_project | project ID of the consumer network where the network address of the discovery endpoint will be reserved. Required for Shared VPC host | `string` | `null` | no |
5454
| node\_type | The nodeType for the valkey cluster. Possible values are: SHARED\_CORE\_NANO, HIGHMEM\_MEDIUM, HIGHMEM\_XLARGE, STANDARD\_SMALL | `string` | `null` | no |
5555
| persistence\_config | User-provided persistence configurations for the instance | <pre>object({<br> mode = optional(string)<br> rdb_config = optional(object({<br> rdb_snapshot_period = optional(string)<br> rdb_snapshot_start_time = optional(string)<br> }), null)<br> aof_config = optional(object({<br> append_fsync = string<br> }), null)<br> })</pre> | `{}` | no |
56-
| project | The ID of the project in which the resource belongs to. | `string` | n/a | yes |
56+
| project\_id | The ID of the project in which the resource belongs to. | `string` | n/a | yes |
5757
| replica\_count | Number of replica nodes per shard. If omitted the default is 0 replicas | `number` | `0` | no |
5858
| service\_connection\_policies | The Service Connection Policies to create. Required to create service connection policy. Not needed if service connection policy already exist | <pre>map(object({<br> subnet_names = list(string)<br> description = optional(string)<br> limit = optional(number)<br> labels = optional(map(string), {})<br> }))</pre> | `{}` | no |
5959
| shard\_count | Number of shards for the instance | `number` | `3` | no |

modules/valkey/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
resource "google_memorystore_instance" "valkey_cluster" {
1818
provider = google-beta
19-
project = var.project
19+
project = var.project_id
2020
instance_id = var.instance_id
2121
shard_count = var.shard_count
2222

2323
desired_psc_auto_connections {
24-
network = "projects/${coalesce(var.network_project, var.project)}/global/networks/${var.network}"
25-
project_id = var.project
24+
network = "projects/${coalesce(var.network_project, var.project_id)}/global/networks/${var.network}"
25+
project_id = var.project_id
2626
}
2727

2828
location = var.location
@@ -72,16 +72,16 @@ resource "google_memorystore_instance" "valkey_cluster" {
7272

7373
resource "google_network_connectivity_service_connection_policy" "service_connection_policies" {
7474
for_each = var.service_connection_policies
75-
project = coalesce(var.network_project, var.project)
75+
project = coalesce(var.network_project, var.project_id)
7676
name = each.key
7777
location = var.location
7878
service_class = "gcp-memorystore"
7979
description = lookup(each.value, "description", null)
80-
network = "projects/${coalesce(var.network_project, var.project)}/global/networks/${var.network}"
80+
network = "projects/${coalesce(var.network_project, var.project_id)}/global/networks/${var.network}"
8181
labels = each.value.labels
8282

8383
psc_config {
84-
subnetworks = [for x in each.value.subnet_names : "projects/${coalesce(var.network_project, var.project)}/regions/${var.location}/subnetworks/${x}"]
84+
subnetworks = [for x in each.value.subnet_names : "projects/${coalesce(var.network_project, var.project_id)}/regions/${var.location}/subnetworks/${x}"]
8585
limit = lookup(each.value, "limit", null)
8686
}
8787

@@ -91,7 +91,7 @@ module "enable_apis" {
9191
source = "terraform-google-modules/project-factory/google//modules/project_services"
9292
version = "~> 17.0"
9393

94-
project_id = var.project
94+
project_id = var.project_id
9595
enable_apis = var.enable_apis
9696

9797
disable_services_on_destroy = false

modules/valkey/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "project" {
17+
variable "project_id" {
1818
description = "The ID of the project in which the resource belongs to."
1919
type = string
2020
}

0 commit comments

Comments
 (0)