Skip to content

Commit 04cef76

Browse files
authored
feat!: Rename project input variable to project_id (#243)
1 parent 424b40a commit 04cef76

File tree

21 files changed

+231
-24
lines changed

21 files changed

+231
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module "memorystore" {
5555
| memory\_size\_gb | Redis memory size in GiB. Defaulted to 1 GiB | `number` | `1` | no |
5656
| name | The ID of the instance or a fully qualified identifier for the instance. | `string` | n/a | yes |
5757
| persistence\_config | The Redis persistence configuration parameters. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#persistenceconfig | <pre>object({<br> persistence_mode = string<br> rdb_snapshot_period = string<br> })</pre> | `null` | no |
58-
| project | The ID of the project in which the resource belongs to. | `string` | n/a | yes |
58+
| project\_id | The ID of the project in which the resource belongs to. | `string` | n/a | yes |
5959
| read\_replicas\_mode | Read replicas mode. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#readreplicasmode | `string` | `"READ_REPLICAS_DISABLED"` | no |
6060
| redis\_configs | The Redis configuration parameters. See [more details](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs) | `map(any)` | `{}` | no |
6161
| redis\_version | The version of Redis software. | `string` | `null` | no |

docs/upgrading_to_v12.0.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Upgrading to v12.0
2+
3+
The v12.0 release contains backwards-incompatible changes.
4+
5+
## Use `project_id` instead of `project`
6+
7+
This release renames `project` to `project_id`. The required input variable `project_id` will be used to configure the project for the resource creation.
8+
9+
10+
```diff
11+
module "memorystore" {
12+
source = "terraform-google-modules/memorystore/google"
13+
version = "~> 11.0"
14+
15+
name = "memorystore"
16+
- project = "memorystore"
17+
+ project_id = "memorystore"
18+
memory_size_gb = "1"
19+
enable_apis = "true"
20+
}
21+
```
22+
23+
To be backward compatible, user needs to set `project_id` instead of `project` input variable.

examples/basic/memorystore.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module "memorystore" {
1919
version = "~> 11.0"
2020

2121
name = "memorystore"
22-
project = "memorystore"
22+
project_id = "memorystore"
2323
memory_size_gb = "1"
2424
enable_apis = "true"
2525
}

examples/memcache/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module "memcache" {
2929
version = "~> 11.0"
3030

3131
name = "example-memcache"
32-
project = var.project_id
32+
project_id = var.project_id
3333
memory_size_mb = "1024"
3434
enable_apis = true
3535
cpu_count = "1"

examples/minimal/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module "memstore" {
1919
version = "~> 11.0"
2020

2121
name = "test-minimal"
22-
project = var.project_id
22+
project_id = var.project_id
2323
region = "us-east1"
2424
location_id = "us-east1-b"
2525
enable_apis = true

examples/redis-cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module "redis_cluster" {
3838
version = "~> 11.0"
3939

4040
name = "test-redis-cluster"
41-
project = var.project_id
41+
project_id = var.project_id
4242
region = "us-central1"
4343
network = ["projects/${var.project_id}/global/networks/${local.network_name}"]
4444
node_type = "REDIS_STANDARD_SMALL"

examples/redis/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module "memstore" {
2020

2121
name = "test-redis"
2222

23-
project = var.project_id
23+
project_id = var.project_id
2424
region = "us-east1"
2525
location_id = "us-east1-b"
2626
alternative_location_id = "us-east1-d"

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
resource "google_redis_instance" "default" {
1818
depends_on = [module.enable_apis]
1919

20-
project = var.project
20+
project = var.project_id
2121
name = var.name
2222
tier = var.tier
2323
replica_count = var.tier == "STANDARD_HA" ? var.replica_count : null
@@ -72,7 +72,7 @@ module "enable_apis" {
7272
source = "terraform-google-modules/project-factory/google//modules/project_services"
7373
version = "~> 17.0"
7474

75-
project_id = var.project
75+
project_id = var.project_id
7676
enable_apis = var.enable_apis
7777
disable_services_on_destroy = false
7878
disable_dependent_services = false

metadata.display.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@ spec:
9696
transit_encryption_mode:
9797
name: transit_encryption_mode
9898
title: Transit Encryption Mode
99+
runtime:
100+
outputs:
101+
host:
102+
visibility: VISIBILITY_ROOT
103+
port:
104+
visibility: VISIBILITY_ROOT

metadata.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ spec:
3535
location: modules/memcache
3636
- name: redis-cluster
3737
location: modules/redis-cluster
38+
- name: valkey
39+
location: modules/valkey
3840
examples:
3941
- name: basic
4042
location: examples/basic
@@ -46,12 +48,14 @@ spec:
4648
location: examples/redis
4749
- name: redis-cluster
4850
location: examples/redis-cluster
51+
- name: valkey
52+
location: examples/valkey
4953
interfaces:
5054
variables:
5155
- name: region
5256
description: The GCP region to use.
5357
varType: string
54-
- name: project
58+
- name: project_id
5559
description: The ID of the project in which the resource belongs to.
5660
varType: string
5761
required: true
@@ -69,7 +73,7 @@ spec:
6973
connections:
7074
- source:
7175
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
72-
version: v9.1.0
76+
version: ">= 9.1.0"
7377
spec:
7478
outputExpr: network_name
7579
- name: tier
@@ -157,7 +161,7 @@ spec:
157161
type:
158162
- object
159163
- REDIS_HOST: string
160-
REDIS_PORT: number
164+
REDIS_PORT: string
161165
- name: host
162166
description: The IP address of the instance.
163167
type: string

0 commit comments

Comments
 (0)