diff --git a/Makefile b/Makefile index c2571266..2b1c170c 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ docker_test_lint: .PHONY: docker_generate_docs docker_generate_docs: docker run --rm -it \ + -e ENABLE_BPMETADATA \ -v "$(CURDIR)":/workspace \ $(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \ /bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs' diff --git a/README.md b/README.md index 1c9b8eb5..9bb97470 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ module "memorystore" { | 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 | | redis\_version | The version of Redis software. | `string` | `null` | no | | region | The GCP region to use. | `string` | `null` | no | -| replica\_count | The number of replicas. can | `number` | `null` | no | +| replica\_count | The number of replicas. | `number` | `null` | no | | reserved\_ip\_range | The CIDR range of internal addresses that are reserved for this instance. | `string` | `null` | no | | secondary\_ip\_range | Optional. Additional IP range for node placement. Required when enabling read replicas on an existing instance. | `string` | `null` | no | | tier | The service tier of the instance. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier | `string` | `"STANDARD_HA"` | no | diff --git a/metadata.display.yaml b/metadata.display.yaml index 199da21e..7548c5cc 100644 --- a/metadata.display.yaml +++ b/metadata.display.yaml @@ -36,15 +36,18 @@ spec: authorized_network: name: authorized_network title: Authorized Network + invisible: false connect_mode: name: connect_mode title: Connect Mode + invisible: false customer_managed_key: name: customer_managed_key title: Customer Managed Key display_name: name: display_name title: Display Name + invisible: false enable_apis: name: enable_apis title: Enable Apis @@ -60,9 +63,12 @@ spec: memory_size_gb: name: memory_size_gb title: Memory Size Gb + invisible: false name: name: name title: Name + regexValidation: ^[a-z][a-z0-9-]{0,38}[a-z0-9]$ + validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 40 characters or fewer. persistence_config: name: persistence_config title: Persistence Config @@ -78,12 +84,15 @@ spec: redis_version: name: redis_version title: Redis Version + invisible: false region: name: region title: Region + invisible: false replica_count: name: replica_count title: Replica Count + invisible: false reserved_ip_range: name: reserved_ip_range title: Reserved Ip Range @@ -93,6 +102,12 @@ spec: tier: name: tier title: Tier + invisible: false + enumValueLabels: + - label: STANDARD_HA + value: STANDARD_HA + - label: BASIC + value: BASIC transit_encryption_mode: name: transit_encryption_mode title: Transit Encryption Mode diff --git a/metadata.yaml b/metadata.yaml index b3a8466e..97a9870d 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -52,30 +52,20 @@ spec: location: examples/valkey interfaces: variables: - - name: region - description: The GCP region to use. - varType: string - name: project_id description: The ID of the project in which the resource belongs to. varType: string required: true - - name: enable_apis - description: Flag for enabling redis.googleapis.com in your project - varType: bool - defaultValue: true + - name: region + description: The GCP region to use. + varType: string - name: name description: The ID of the instance or a fully qualified identifier for the instance. varType: string required: true - - name: authorized_network - description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used. + - name: display_name + description: An arbitrary and optional user-provided name for the instance. varType: string - connections: - - source: - source: github.com/terraform-google-modules/terraform-google-network//modules/vpc - version: ">= 9.1.0" - spec: - outputExpr: network_name - name: tier description: The service tier of the instance. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Tier varType: string @@ -85,8 +75,27 @@ spec: varType: number defaultValue: 1 - name: replica_count - description: The number of replicas. can + description: The number of replicas. varType: number + - name: authorized_network + description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used. + varType: string + connections: + - source: + source: github.com/terraform-google-modules/terraform-google-network//modules/vpc + version: ">= 9.1.0" + spec: + outputExpr: network_name + - name: redis_version + description: The version of Redis software. + varType: string + - name: connect_mode + description: The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING. + varType: string + - name: enable_apis + description: Flag for enabling redis.googleapis.com in your project + varType: bool + defaultValue: true - name: read_replicas_mode description: "Read replicas mode. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#readreplicasmode " varType: string @@ -97,25 +106,16 @@ spec: - name: alternative_location_id description: The alternative zone where the instance will be provisioned. varType: string - - name: redis_version - description: The version of Redis software. - varType: string - name: redis_configs description: The Redis configuration parameters. See [more details](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs) varType: map(any) defaultValue: {} - - name: display_name - description: An arbitrary and optional user-provided name for the instance. - varType: string - name: reserved_ip_range description: The CIDR range of internal addresses that are reserved for this instance. varType: string - name: secondary_ip_range description: Optional. Additional IP range for node placement. Required when enabling read replicas on an existing instance. varType: string - - name: connect_mode - description: The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING. - varType: string - name: labels description: The resource labels to represent user provided metadata. varType: map(string) diff --git a/modules/memcache/metadata.yaml b/modules/memcache/metadata.yaml index 3454d1c7..946633ee 100644 --- a/modules/memcache/metadata.yaml +++ b/modules/memcache/metadata.yaml @@ -46,24 +46,53 @@ spec: location: examples/valkey interfaces: variables: + - name: region + description: The GCP region to use. + varType: string + required: true + - name: project_id + description: The ID of the project in which the resource belongs to. + varType: string + required: true + - name: enable_apis + description: Flag for enabling memcache.googleapis.com in your project + varType: bool + defaultValue: true + - name: name + description: The ID of the instance or a fully qualified identifier for the instance. + varType: string + required: true + - name: memcache_version + description: The major version of Memcached software. + varType: string - name: authorized_network description: The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used. varType: string + - name: node_count + description: Number of nodes in the memcache instance. + varType: number + defaultValue: 1 - name: cpu_count description: Number of CPUs per node varType: number defaultValue: 1 + - name: memory_size_mb + description: Memcache memory size in MiB. Defaulted to 1024 + varType: number + defaultValue: 1024 + - name: zones + description: Zones where memcache nodes should be provisioned. If not provided, all zones will be used. + varType: list(string) - name: display_name description: An arbitrary and optional user-provided name for the instance. varType: string - - name: enable_apis - description: Flag for enabling memcache.googleapis.com in your project - varType: bool - defaultValue: true - name: labels description: The resource labels to represent user provided metadata. varType: map(string) defaultValue: {} + - name: params + description: Parameters for the memcache process + varType: map(string) - name: maintenance_policy description: The maintenance policy for an instance. varType: |- @@ -77,35 +106,6 @@ spec: nanos = number }) }) - - name: memcache_version - description: The major version of Memcached software. - varType: string - - name: memory_size_mb - description: Memcache memory size in MiB. Defaulted to 1024 - varType: number - defaultValue: 1024 - - name: name - description: The ID of the instance or a fully qualified identifier for the instance. - varType: string - required: true - - name: node_count - description: Number of nodes in the memcache instance. - varType: number - defaultValue: 1 - - name: params - description: Parameters for the memcache process - varType: map(string) - - name: project_id - description: The ID of the project in which the resource belongs to. - varType: string - required: true - - name: region - description: The GCP region to use. - varType: string - required: true - - name: zones - description: Zones where memcache nodes should be provisioned. If not provided, all zones will be used. - varType: list(string) outputs: - name: discovery description: The memorystore discovery endpoint. @@ -128,3 +128,8 @@ spec: - serviceconsumermanagement.googleapis.com - networkconnectivity.googleapis.com - compute.googleapis.com + providerVersions: + - source: hashicorp/google + version: ">= 4.23.0, < 7" + - source: hashicorp/google-beta + version: ">= 4.23.0, < 7" diff --git a/modules/redis-cluster/metadata.yaml b/modules/redis-cluster/metadata.yaml index 30a834aa..634a4f19 100644 --- a/modules/redis-cluster/metadata.yaml +++ b/modules/redis-cluster/metadata.yaml @@ -46,52 +46,42 @@ spec: location: examples/valkey interfaces: variables: - - name: authorization_mode - description: "The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. Default value is AUTH_MODE_DISABLED. Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED" - varType: string - defaultValue: AUTH_MODE_DISABLED - - name: deletion_protection_enabled - description: " Indicates if the cluster is deletion protected or not. If the value if set to true, any delete cluster operation will fail. Default value is true" - varType: bool - defaultValue: true - - name: enable_apis - description: Flag for enabling memcache.googleapis.com in your project - varType: bool - defaultValue: true - name: name description: The ID of the instance or a fully qualified identifier for the instance. must be 1 to 63 characters and use only lowercase letters, numbers, or hyphens. It must start with a lowercase letter and end with a lowercase letter or number varType: string required: true - - name: network - description: List of consumer network where the network address of the discovery endpoint will be reserved, in the form of projects/{network_project_id_or_number}/global/networks/{network_id}. Currently, only one item is supported - varType: list(string) - required: true - - name: node_type - description: "The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL." - varType: string - name: project_id description: The ID of the project in which the resource belongs to. varType: string required: true - - name: redis_configs - description: Configure Redis Cluster behavior using a subset of native Redis configuration parameters - varType: |- - object({ - maxmemory-clients = optional(string) - maxmemory = optional(string) - maxmemory-policy = optional(string) - notify-keyspace-events = optional(string) - slowlog-log-slower-than = optional(number) - maxclients = optional(number) - }) - name: region description: The name of the region of the Redis cluster varType: string required: true + - name: enable_apis + description: Flag for enabling memcache.googleapis.com in your project + varType: bool + defaultValue: true + - name: shard_count + description: Required. Number of shards for the Redis cluster. The minimum number of shards in a Memorystore cluster is 3 shards + varType: number + defaultValue: 3 - name: replica_count description: The number of replica nodes per shard. Each shard can have 0, 1, or 2 replica nodes. Replicas provide high availability and additional read throughput, and are evenly distributed across zones varType: number defaultValue: 0 + - name: transit_encryption_mode + description: "The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster. Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION" + varType: string + defaultValue: TRANSIT_ENCRYPTION_MODE_DISABLED + - name: authorization_mode + description: "The authorization mode of the Redis cluster. If not provided, auth feature is disabled for the cluster. Default value is AUTH_MODE_DISABLED. Possible values are: AUTH_MODE_UNSPECIFIED, AUTH_MODE_IAM_AUTH, AUTH_MODE_DISABLED" + varType: string + defaultValue: AUTH_MODE_DISABLED + - name: network + description: List of consumer network where the network address of the discovery endpoint will be reserved, in the form of projects/{network_project_id_or_number}/global/networks/{network_id}. Currently, only one item is supported + varType: list(string) + required: true - name: service_connection_policies description: The Service Connection Policies to create varType: |- @@ -104,14 +94,20 @@ spec: labels = optional(map(string), {}) })) defaultValue: {} - - name: shard_count - description: Required. Number of shards for the Redis cluster. The minimum number of shards in a Memorystore cluster is 3 shards - varType: number - defaultValue: 3 - - name: transit_encryption_mode - description: "The in-transit encryption for the Redis cluster. If not provided, encryption is disabled for the cluster. Default value is TRANSIT_ENCRYPTION_MODE_DISABLED. Possible values are: TRANSIT_ENCRYPTION_MODE_UNSPECIFIED, TRANSIT_ENCRYPTION_MODE_DISABLED, TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION" + - name: node_type + description: "The nodeType for the Redis cluster. If not provided, REDIS_HIGHMEM_MEDIUM will be used as default Possible values are: REDIS_SHARED_CORE_NANO, REDIS_HIGHMEM_MEDIUM, REDIS_HIGHMEM_XLARGE, REDIS_STANDARD_SMALL." varType: string - defaultValue: TRANSIT_ENCRYPTION_MODE_DISABLED + - name: redis_configs + description: Configure Redis Cluster behavior using a subset of native Redis configuration parameters + varType: |- + object({ + maxmemory-clients = optional(string) + maxmemory = optional(string) + maxmemory-policy = optional(string) + notify-keyspace-events = optional(string) + slowlog-log-slower-than = optional(number) + maxclients = optional(number) + }) - name: zone_distribution_config_mode description: "The mode for zone distribution for Memorystore Redis cluster (Immutable). If not provided, MULTI_ZONE will be used as default value. Possible values are: MULTI_ZONE, SINGLE_ZONE" varType: string @@ -119,6 +115,10 @@ spec: - name: zone_distribution_config_zone description: The zone for single zone Memorystore Redis cluster (Immutable) varType: string + - name: deletion_protection_enabled + description: " Indicates if the cluster is deletion protected or not. If the value if set to true, any delete cluster operation will fail. Default value is true" + varType: bool + defaultValue: true outputs: - name: discovery_endpoints description: Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one endpoint is supported @@ -141,3 +141,6 @@ spec: - serviceconsumermanagement.googleapis.com - networkconnectivity.googleapis.com - compute.googleapis.com + providerVersions: + - source: hashicorp/google + version: ">= 6.0, < 7" diff --git a/modules/valkey/metadata.yaml b/modules/valkey/metadata.yaml index aedc1f10..bb3e89ae 100644 --- a/modules/valkey/metadata.yaml +++ b/modules/valkey/metadata.yaml @@ -46,18 +46,77 @@ spec: location: examples/valkey interfaces: variables: + - name: project_id + description: The ID of the project in which the resource belongs to. + varType: string + required: true + - name: instance_id + description: The ID to use for the instance, which will become the final component of the instance's resource name. Must be 4-63 characters in length with lowercase letters, digits, and hyphens. Must not end with a hyphen. Must be unique within a location + varType: string + required: true + - name: shard_count + description: Number of shards for the instance + varType: number + defaultValue: 3 + - name: location + description: The region where valkey cluster will be created + varType: string + required: true + - name: labels + description: The resource labels to represent user provided metadata. + varType: map(string) + defaultValue: {} + - name: replica_count + description: Number of replica nodes per shard. If omitted the default is 0 replicas + varType: number + defaultValue: 0 - name: authorization_mode description: "The Immutable. Authorization mode of the instance. Possible values: AUTH_DISABLED IAM_AUTH" varType: string defaultValue: AUTH_DISABLED + - name: transit_encryption_mode + description: "Immutable. In-transit encryption mode of the instance. Possible values: TRANSIT_ENCRYPTION_DISABLED SERVER_AUTHENTICATION" + varType: string + defaultValue: TRANSIT_ENCRYPTION_DISABLED + - name: node_type + description: "The nodeType for the valkey cluster. Possible values are: SHARED_CORE_NANO, HIGHMEM_MEDIUM, HIGHMEM_XLARGE, STANDARD_SMALL" + varType: string - name: deletion_protection_enabled description: If set to true deletion of the instance will fail varType: bool defaultValue: true + - name: zone_distribution_config_mode + description: "The mode for zone distribution for Memorystore valkey cluster (Immutable). If not provided, MULTI_ZONE will be used as default value. Possible values are: MULTI_ZONE, SINGLE_ZONE" + varType: string + defaultValue: MULTI_ZONE + - name: zone_distribution_config_zone + description: The zone for single zone Memorystore valkey cluster (Immutable) + varType: string + - name: engine_version + description: Immutable. Engine version of the instance + varType: string + defaultValue: VALKEY_8_0 - name: enable_apis description: Flag for enabling memcache.googleapis.com in your project varType: bool defaultValue: false + - name: network + description: Name of the consumer network where the network address of the discovery endpoint will be reserved + varType: string + required: true + - name: network_project + description: project ID of the consumer network where the network address of the discovery endpoint will be reserved. Required for Shared VPC host + varType: string + - name: service_connection_policies + description: The Service Connection Policies to create. Required to create service connection policy. Not needed if service connection policy already exist + varType: |- + map(object({ + subnet_names = list(string) + description = optional(string) + limit = optional(number) + labels = optional(map(string), {}) + })) + defaultValue: {} - name: engine_configs description: User-provided engine configurations for the instance varType: |- @@ -69,32 +128,6 @@ spec: slowlog-log-slower-than = optional(number) maxclients = optional(number) }) - - name: engine_version - description: Immutable. Engine version of the instance - varType: string - defaultValue: VALKEY_8_0 - - name: instance_id - description: The ID to use for the instance, which will become the final component of the instance's resource name. Must be 4-63 characters in length with lowercase letters, digits, and hyphens. Must not end with a hyphen. Must be unique within a location - varType: string - required: true - - name: labels - description: The resource labels to represent user provided metadata. - varType: map(string) - defaultValue: {} - - name: location - description: The region where valkey cluster will be created - varType: string - required: true - - name: network - description: Name of the consumer network where the network address of the discovery endpoint will be reserved - varType: string - required: true - - name: network_project - description: project ID of the consumer network where the network address of the discovery endpoint will be reserved. Required for Shared VPC host - varType: string - - name: node_type - description: "The nodeType for the valkey cluster. Possible values are: SHARED_CORE_NANO, HIGHMEM_MEDIUM, HIGHMEM_XLARGE, STANDARD_SMALL" - varType: string - name: persistence_config description: User-provided persistence configurations for the instance varType: |- @@ -109,39 +142,6 @@ spec: }), null) }) defaultValue: {} - - name: project_id - description: The ID of the project in which the resource belongs to. - varType: string - required: true - - name: replica_count - description: Number of replica nodes per shard. If omitted the default is 0 replicas - varType: number - defaultValue: 0 - - name: service_connection_policies - description: The Service Connection Policies to create. Required to create service connection policy. Not needed if service connection policy already exist - varType: |- - map(object({ - subnet_names = list(string) - description = optional(string) - limit = optional(number) - labels = optional(map(string), {}) - })) - defaultValue: {} - - name: shard_count - description: Number of shards for the instance - varType: number - defaultValue: 3 - - name: transit_encryption_mode - description: "Immutable. In-transit encryption mode of the instance. Possible values: TRANSIT_ENCRYPTION_DISABLED SERVER_AUTHENTICATION" - varType: string - defaultValue: TRANSIT_ENCRYPTION_DISABLED - - name: zone_distribution_config_mode - description: "The mode for zone distribution for Memorystore valkey cluster (Immutable). If not provided, MULTI_ZONE will be used as default value. Possible values are: MULTI_ZONE, SINGLE_ZONE" - varType: string - defaultValue: MULTI_ZONE - - name: zone_distribution_config_zone - description: The zone for single zone Memorystore valkey cluster (Immutable) - varType: string outputs: - name: discovery_endpoints description: Endpoints created on each given network, for valkey clients to connect to the cluster. Currently only one endpoint is supported @@ -164,3 +164,8 @@ spec: - serviceconsumermanagement.googleapis.com - networkconnectivity.googleapis.com - compute.googleapis.com + providerVersions: + - source: hashicorp/google + version: ">= 6.3, < 7" + - source: hashicorp/google-beta + version: ">= 6.3, < 7" diff --git a/variables.tf b/variables.tf index 2814f3fe..923f8198 100644 --- a/variables.tf +++ b/variables.tf @@ -14,21 +14,15 @@ * limitations under the License. */ -variable "region" { - description = "The GCP region to use." - type = string - default = null -} - variable "project_id" { description = "The ID of the project in which the resource belongs to." type = string } -variable "enable_apis" { - description = "Flag for enabling redis.googleapis.com in your project" - type = bool - default = true +variable "region" { + description = "The GCP region to use." + type = string + default = null } variable "name" { @@ -36,8 +30,8 @@ variable "name" { type = string } -variable "authorized_network" { - description = "The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used." +variable "display_name" { + description = "An arbitrary and optional user-provided name for the instance." type = string default = null } @@ -55,11 +49,35 @@ variable "memory_size_gb" { } variable "replica_count" { - description = "The number of replicas. can" + description = "The number of replicas." type = number default = null } +variable "authorized_network" { + description = "The full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used." + type = string + default = null +} + +variable "redis_version" { + description = "The version of Redis software." + type = string + default = null +} + +variable "connect_mode" { + description = "The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING." + type = string + default = null +} + +variable "enable_apis" { + description = "Flag for enabling redis.googleapis.com in your project" + type = bool + default = true +} + variable "read_replicas_mode" { description = "Read replicas mode. https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#readreplicasmode " type = string @@ -78,24 +96,12 @@ variable "alternative_location_id" { default = null } -variable "redis_version" { - description = "The version of Redis software." - type = string - default = null -} - variable "redis_configs" { description = "The Redis configuration parameters. See [more details](https://cloud.google.com/memorystore/docs/redis/reference/rest/v1/projects.locations.instances#Instance.FIELDS.redis_configs)" type = map(any) default = {} } -variable "display_name" { - description = "An arbitrary and optional user-provided name for the instance." - type = string - default = null -} - variable "reserved_ip_range" { description = "The CIDR range of internal addresses that are reserved for this instance." type = string @@ -108,12 +114,6 @@ variable "secondary_ip_range" { default = null } -variable "connect_mode" { - description = "The connection mode of the Redis instance. Can be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS. The default connect mode if not provided is DIRECT_PEERING." - type = string - default = null -} - variable "labels" { description = "The resource labels to represent user provided metadata." type = map(string)