From b1ba70bb29c3294c7003b04cd51975f1824dde73 Mon Sep 17 00:00:00 2001 From: Shubham Sahu Date: Thu, 22 Feb 2024 01:49:31 +0000 Subject: [PATCH] Add sample for secondary instance --- .../alloydb_v1beta1_alloydbcluster.yaml | 41 +++++++++++++++++++ .../alloydb_v1beta1_alloydbcluster4.yaml | 41 +++++++++++++++++++ .../alloydb_v1beta1_alloydbinstance.yaml | 31 ++++++++++++++ .../compute_v1beta1_computeaddress.yaml | 25 +++++++++++ .../compute_v1beta1_computenetwork.yaml | 20 +++++++++ ...g_v1beta1_servicenetworkingconnection.yaml | 24 +++++++++++ 6 files changed, 182 insertions(+) create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster.yaml create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster4.yaml create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbinstance.yaml create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computeaddress.yaml create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computenetwork.yaml create mode 100644 config/samples/resources/alloydbinstance/secondary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml diff --git a/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster.yaml b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster.yaml new file mode 100644 index 00000000000..d97bc0166eb --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster.yaml @@ -0,0 +1,41 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep1-secondary +spec: + location: us-central1 + networkConfig: + networkRef: + name: alloydbinstance-dep-secondary + projectRef: + external: ${PROJECT_ID?} +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: alloydbinstance-dep1-secondary +spec: + location: us-east1 + networkConfig: + networkRef: + name: alloydbinstance-dep-secondary + projectRef: + external: ${PROJECT_ID?} + clusterType: "SECONDARY" + secondaryConfig: + primaryClusterName: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep1-secondary + deletionPolicy: "FORCE" diff --git a/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster4.yaml b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster4.yaml new file mode 100644 index 00000000000..7c4a99f4674 --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbcluster4.yaml @@ -0,0 +1,41 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +# kind: AlloyDBCluster +# metadata: +# name: alloydbinstance-dep-secondary +# spec: +# location: us-central1 +# networkConfig: +# networkRef: +# name: alloydbinstance-dep-secondary +# projectRef: +# external: ${PROJECT_ID?} +# --- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBCluster +metadata: + name: rororo +spec: + location: us-east1 + networkConfig: + networkRef: + name: alloydbinstance-dep-read + projectRef: + external: shubhsahu-terraform + clusterType: "PRIMARY" + secondaryConfig: + primaryClusterName: projects/shubhsahu-terraform/locations/us-central1/clusters/alloydbinstance-dep-read + deletionPolicy: "FORCE" \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbinstance.yaml b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbinstance.yaml new file mode 100644 index 00000000000..c5e5ab57d0b --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/alloydb_v1beta1_alloydbinstance.yaml @@ -0,0 +1,31 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-dep-secondary +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-central1/clusters/alloydbinstance-dep1-secondary + instanceType: PRIMARY +--- +apiVersion: alloydb.cnrm.cloud.google.com/v1beta1 +kind: AlloyDBInstance +metadata: + name: alloydbinstance-sample-secondary +spec: + clusterRef: + external: projects/${PROJECT_ID?}/locations/us-east1/clusters/alloydbinstance-dep2-secondary + instanceType: SECONDARY diff --git a/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computeaddress.yaml b/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computeaddress.yaml new file mode 100644 index 00000000000..d2d0e2d07ac --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computeaddress.yaml @@ -0,0 +1,25 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeAddress +metadata: + name: alloydbinstance-dep-secondary +spec: + location: global + addressType: INTERNAL + networkRef: + name: alloydbinstance-dep-secondary + prefixLength: 16 + purpose: VPC_PEERING \ No newline at end of file diff --git a/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computenetwork.yaml b/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computenetwork.yaml new file mode 100644 index 00000000000..55e35ef40a3 --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/compute_v1beta1_computenetwork.yaml @@ -0,0 +1,20 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: compute.cnrm.cloud.google.com/v1beta1 +kind: ComputeNetwork +metadata: + name: alloydbinstance-dep-secondary + + diff --git a/config/samples/resources/alloydbinstance/secondary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml b/config/samples/resources/alloydbinstance/secondary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml new file mode 100644 index 00000000000..83ddb80050d --- /dev/null +++ b/config/samples/resources/alloydbinstance/secondary-instance/servicenetworking_v1beta1_servicenetworkingconnection.yaml @@ -0,0 +1,24 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +apiVersion: servicenetworking.cnrm.cloud.google.com/v1beta1 +kind: ServiceNetworkingConnection +metadata: + name: alloydbinstance-dep-secondary +spec: + networkRef: + name: alloydbinstance-dep-secondary + reservedPeeringRanges: + - name: alloydbinstance-dep-secondary + service: servicenetworking.googleapis.com \ No newline at end of file