@@ -12,7 +12,7 @@ description: |-
1212## Example Usage
1313
1414``` terraform
15- # Create a VPC peering connection top the specified datacenter.
15+ # Create a VPC peering connection to the specified datacenter.
1616resource "scylladbcloud_vpc_peering" "example" {
1717 cluster_id = 1337
1818 datacenter = "AWS_US_EAST_1"
@@ -30,6 +30,70 @@ output "scylladbcloud_vpc_peering_connection_id" {
3030}
3131```
3232
33+ ## Example Usage for AWS
34+
35+ ``` terraform
36+ # End-to-end example for ScyllaDB Datacenter VPC peering on AWS.
37+ resource "aws_vpc" "app" {
38+ cidr_block = "10.0.0.0/16"
39+ }
40+
41+ data "aws_caller_identity" "current" {}
42+
43+ resource "scylladbcloud_vpc_peering" "example" {
44+ cluster_id = 1337
45+ datacenter = "AWS_EAST_1"
46+
47+ peer_vpc_id = aws_vpc.app.id
48+ peer_cidr_block = aws_vpc.app.cidr_block
49+ peer_region = "us-east-1"
50+ peer_account_id = data.aws_caller_identity.current.account_id
51+
52+ allow_cql = true
53+ }
54+
55+ resource "aws_vpc_peering_connection_accepter" "app" {
56+ vpc_peering_connection_id = scylladbcloud_vpc_peering.example.connection_id
57+ auto_accept = true
58+ }
59+
60+ resource "aws_route_table" "bench" {
61+ vpc_id = aws_vpc.app.id
62+
63+ route {
64+ cidr_block = scylladbcloud_cluster.example.cidr_block
65+ vpc_peering_connection_id = aws_vpc_peering_connection_accepter.app.vpc_peering_connection_id
66+ }
67+ }
68+ ```
69+
70+ ## Example Usage for GCP
71+
72+ ``` terraform
73+ # End-to-end example for ScyllaDB Datacenter network peering on GCP.
74+ resource "google_compute_network" "app" {
75+ name = "app"
76+ auto_create_subnetworks = true
77+ }
78+
79+ resource "scylladbcloud_vpc_peering" "example" {
80+ cluster_id = 1337
81+ datacenter = "GCE_US_CENTRAL_1"
82+
83+ peer_vpc_id = google_compute_network.app.name
84+ peer_region = "us-central1"
85+ peer_account_id = "exampleproject"
86+
87+ allow_cql = true
88+ }
89+
90+ resource "google_compute_network_peering" "app" {
91+ name = "app-peering"
92+ network = google_compute_network.app.self_link
93+ peer_network = scylladbcloud_vpc_peering.example.network_link
94+ }
95+ ```
96+
3397<!-- schema generated by tfplugindocs -->
3498## Schema
3599
@@ -38,19 +102,20 @@ output "scylladbcloud_vpc_peering_connection_id" {
38102- ` cluster_id ` (Number) Cluster ID
39103- ` datacenter ` (String) Cluster datacenter name
40104- ` peer_account_id ` (String) Peer Account ID
41- - ` peer_cidr_block ` (String) Peer VPC CIDR block
42105- ` peer_region ` (String) Peer VPC region
43106- ` peer_vpc_id ` (String) Peer VPC ID
44107
45108### Optional
46109
47110- ` allow_cql ` (Boolean) Whether to allow CQL traffic
111+ - ` peer_cidr_block ` (String) Peer VPC CIDR block
48112- ` timeouts ` (Block, Optional) (see [ below for nested schema] ( #nestedblock--timeouts ) )
49113
50114### Read-Only
51115
52116- ` connection_id ` (String) VPC peering connection id
53117- ` id ` (String) The ID of this resource.
118+ - ` network_link ` (String) (GCP) Cluster VPC network self_link
54119- ` vpc_peering_id ` (Number) Cluster VPC Peering ID
55120
56121<a id =" nestedblock--timeouts " ></a >
0 commit comments