|
| 1 | +# Copyright 2024 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +--- |
| 15 | +name: 'ClusterUserCreatedConnections' |
| 16 | +api_resource_type_kind: Cluster |
| 17 | +description: | |
| 18 | + Manages user created connections for Redis cluster |
| 19 | +docs: |
| 20 | + note: | |
| 21 | + If you remove a connections item from the resource, the corresponding forwarding rule will no longer be functioning. |
| 22 | + If the corresponding forwarding rule is represented in your terraform configuration it is recommended to delete that |
| 23 | + `google_compute_forwarding_rule` resource at the same time. |
| 24 | +references: |
| 25 | + guides: |
| 26 | + api: 'https://cloud.google.com/memorystore/docs/cluster/reference/rest/v1/projects.locations.clusters' |
| 27 | +id_format: 'projects/{{project}}/locations/{{region}}/clusters/{{name}}' |
| 28 | +base_url: 'projects/{{project}}/locations/{{region}}/clusters' |
| 29 | +self_link: 'projects/{{project}}/locations/{{region}}/clusters/{{name}}' |
| 30 | +create_url: 'projects/{{project}}/locations/{{region}}/clusters/{{name}}?updateMask=cluster_endpoints' |
| 31 | +create_verb: PATCH |
| 32 | +update_verb: 'PATCH' |
| 33 | +update_url: 'projects/{{project}}/locations/{{region}}/clusters/{{name}}?updateMask=cluster_endpoints' |
| 34 | +update_mask: true |
| 35 | +custom_code: |
| 36 | + custom_delete: 'templates/terraform/custom_delete/redis_cluster_user_created_connections.go.tmpl' |
| 37 | +timeouts: |
| 38 | + insert_minutes: 60 |
| 39 | + update_minutes: 120 |
| 40 | + delete_minutes: 30 |
| 41 | +autogen_async: true |
| 42 | +async: |
| 43 | + actions: ['create', 'delete', 'update'] |
| 44 | + type: 'OpAsync' |
| 45 | + operation: |
| 46 | + base_url: '{{op_id}}' |
| 47 | + result: |
| 48 | + resource_inside_response: false |
| 49 | +examples: |
| 50 | + - name: 'redis_cluster_user_created_connections' |
| 51 | + primary_resource_id: 'cluster-user-conn' |
| 52 | + vars: |
| 53 | + cluster_name: 'cluster-user-conn' |
| 54 | + network1_name: 'net1' |
| 55 | + subnet_network1_name: 'subnet-net1' |
| 56 | + ip1_network1_name: 'ip1-net1' |
| 57 | + ip2_network1_name: 'ip2-net1' |
| 58 | + forwarding_rule1_network1_name: 'fwd1-net1' |
| 59 | + forwarding_rule2_network1_name: 'fwd2-net1' |
| 60 | + network2_name: 'network2' |
| 61 | + subnet_network2_name: 'subnet-net2' |
| 62 | + ip1_network2_name: 'ip1-net2' |
| 63 | + ip2_network2_name: 'ip2-net2' |
| 64 | + forwarding_rule1_network2_name: 'fwd1-net2' |
| 65 | + forwarding_rule2_network2_name: 'fwd2-net2' |
| 66 | + - name: 'redis_cluster_user_and_auto_created_connections' |
| 67 | + primary_resource_id: 'cluster-user-auto-conn' |
| 68 | + vars: |
| 69 | + cluster_name: 'cluster-user-auto-conn' |
| 70 | + network1_name: 'net1' |
| 71 | + subnet_network1_name: 'subnet-net1' |
| 72 | + policy_name: 'scpolicy' |
| 73 | + network2_name: 'network2' |
| 74 | + subnet_network2_name: 'subnet-net2' |
| 75 | + ip1_network2_name: 'ip1-net2' |
| 76 | + ip2_network2_name: 'ip2-net2' |
| 77 | + forwarding_rule1_network2_name: 'fwd1-net2' |
| 78 | + forwarding_rule2_network2_name: 'fwd2-net2' |
| 79 | +parameters: |
| 80 | + - name: 'name' |
| 81 | + type: String |
| 82 | + description: | |
| 83 | + The name of the Redis cluster these endpoints should be added to. |
| 84 | + required: true |
| 85 | + url_param_only: true |
| 86 | + - name: 'region' |
| 87 | + type: String |
| 88 | + description: | |
| 89 | + The name of the region of the Redis cluster these endpoints should be added to. |
| 90 | + url_param_only: true |
| 91 | + required: true |
| 92 | +properties: |
| 93 | + - name: 'clusterEndpoints' |
| 94 | + type: Array |
| 95 | + description: "A list of cluster endpoints" |
| 96 | + item_type: |
| 97 | + type: NestedObject |
| 98 | + description: | |
| 99 | + ClusterEndpoint consists of PSC connections that are created |
| 100 | + as a group in each VPC network for accessing the cluster. In each group, |
| 101 | + there shall be one connection for each service attachment in the cluster. |
| 102 | + properties: |
| 103 | + - name: connections |
| 104 | + type: Array |
| 105 | + item_type: |
| 106 | + type: NestedObject |
| 107 | + name: 'connections' |
| 108 | + properties: |
| 109 | + - name: 'pscConnection' |
| 110 | + type: NestedObject |
| 111 | + description: | |
| 112 | + Detailed information of a PSC connection that is created by the customer |
| 113 | + who owns the cluster. |
| 114 | + properties: |
| 115 | + - name: 'pscConnectionId' |
| 116 | + type: String |
| 117 | + description: |
| 118 | + "The PSC connection id of the forwarding rule connected |
| 119 | + to the\nservice attachment." |
| 120 | + required: true |
| 121 | + - name: 'address' |
| 122 | + type: String |
| 123 | + description: |
| 124 | + "The IP allocated on the consumer network for the |
| 125 | + PSC forwarding rule. " |
| 126 | + required: true |
| 127 | + - name: 'forwardingRule' |
| 128 | + type: String |
| 129 | + description: "The URI of the consumer side forwarding rule.\nFormat:\nprojects/{project}/regions/{region}/forwardingRules/{forwarding_rule} " |
| 130 | + required: true |
| 131 | + - name: 'projectId' |
| 132 | + type: String |
| 133 | + description: |
| 134 | + "The consumer project_id where the forwarding rule is |
| 135 | + created from. " |
| 136 | + default_from_api: true |
| 137 | + - name: 'network' |
| 138 | + type: String |
| 139 | + description: |
| 140 | + "The consumer network where the IP address resides, in |
| 141 | + the form of\nprojects/{project_id}/global/networks/{network_id}. " |
| 142 | + required: true |
| 143 | + - name: 'serviceAttachment' |
| 144 | + type: String |
| 145 | + description: |
| 146 | + "The service attachment which is the target of the PSC connection, in the form of |
| 147 | + projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}." |
| 148 | + required: true |
| 149 | + - name: 'pscConnectionStatus' |
| 150 | + type: Enum |
| 151 | + description: |
| 152 | + "Output Only. The status of the PSC connection: whether a connection exists and ACTIVE or it no longer exists. |
| 153 | + \n Possible values:\n ACTIVE \n NOT_FOUND" |
| 154 | + output: true |
| 155 | + enum_values: |
| 156 | + - 'ACTIVE' |
| 157 | + - 'NOT_FOUND' |
| 158 | + - name: 'connectionType' |
| 159 | + type: Enum |
| 160 | + description: |
| 161 | + "Output Only. Type of a PSC Connection. |
| 162 | + \n Possible values:\n CONNECTION_TYPE_DISCOVERY \n CONNECTION_TYPE_PRIMARY \n CONNECTION_TYPE_READER" |
| 163 | + output: true |
| 164 | + enum_values: |
| 165 | + - 'CONNECTION_TYPE_READER' |
| 166 | + - 'CONNECTION_TYPE_PRIMARY' |
| 167 | + - 'CONNECTION_TYPE_DISCOVERY' |
0 commit comments