From 31dea583d5fc11cd72d37b28c4f241e75639611a Mon Sep 17 00:00:00 2001 From: Dmitry Kropachev Date: Tue, 20 Feb 2024 07:35:02 -0400 Subject: [PATCH] feat(cluster-connection): add docs --- docs/resources/cluster_connection.md | 72 +++++++++++++++++++ .../aws-tgw-vpc-attachment.tf | 17 +++++ .../import.sh | 2 + .../resources/cluster_connection.md.tmpl | 22 ++++++ 4 files changed, 113 insertions(+) create mode 100644 docs/resources/cluster_connection.md create mode 100644 examples/resources/scylladbcloud_cluster_connection/aws-tgw-vpc-attachment.tf create mode 100644 examples/resources/scylladbcloud_cluster_connection/import.sh create mode 100644 templates/resources/cluster_connection.md.tmpl diff --git a/docs/resources/cluster_connection.md b/docs/resources/cluster_connection.md new file mode 100644 index 0000000..8213ae4 --- /dev/null +++ b/docs/resources/cluster_connection.md @@ -0,0 +1,72 @@ +--- +page_title: "scylladbcloud_cluster_connection Resource - terraform-provider-scylladbcloud" +subcategory: "" +description: |- + +--- + +# scylladbcloud_cluster_connection (Resource) + + + +## Example of AWS Transit Gateway VPC Attachment Cluster Connection + +```terraform +# Create AWS TGW VPC Attachment Connection for the specified cluster. + +resource "scylladbcloud_cluster_connection" "aws_tgw" { + cluster_id = 1337 + name = "aws-tgw-test" + cidrlist = ["10.201.0.0/16"] + type = "AWS_TGW_ATTACHMENT" + datacenter = "AWS_US_EAST_1" + data = { + tgwid = "tgw-08461afa1119f390a" + ramarn = "arn:aws:ram:us-east-1:043400831220:resource-share/be3b0395-1782-47cb-9ae4-6d3517c6a721" + } +} + +output "scylladbcloud_cluster_connection_id" { + value = scylladbcloud_cluster_connection.aws_tgw.id +} +``` + + +## Schema + +### Required + +- `cidrlist` (List of String) List of CIDRs to route to the cluster connection +- `cluster_id` (Number) Cluster ID +- `data` (Map of String) Connection Data +- `datacenter` (String) Cluster datacenter name +- `type` (String) Connection Type + +### Optional + +- `name` (String) Cluster Connection Name +- `status` (String) Connection Status +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `external_id` (String) ID of the cloud resource that represents connection +- `id` (String) Cluster connection ID + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) +- `delete` (String) +- `update` (String) + +## Import + +Import is supported using the following syntax: + +```shell +# An cluster connection can be imported by specifying the numeric identifier. +terraform import scylladbcloud_cluster_connection.example 123 +``` diff --git a/examples/resources/scylladbcloud_cluster_connection/aws-tgw-vpc-attachment.tf b/examples/resources/scylladbcloud_cluster_connection/aws-tgw-vpc-attachment.tf new file mode 100644 index 0000000..a7f408a --- /dev/null +++ b/examples/resources/scylladbcloud_cluster_connection/aws-tgw-vpc-attachment.tf @@ -0,0 +1,17 @@ +# Create AWS TGW VPC Attachment Connection for the specified cluster. + +resource "scylladbcloud_cluster_connection" "aws_tgw" { + cluster_id = 1337 + name = "aws-tgw-test" + cidrlist = ["10.201.0.0/16"] + type = "AWS_TGW_ATTACHMENT" + datacenter = "AWS_US_EAST_1" + data = { + tgwid = "tgw-08461afa1119f390a" + ramarn = "arn:aws:ram:us-east-1:043400831220:resource-share/be3b0395-1782-47cb-9ae4-6d3517c6a721" + } +} + +output "scylladbcloud_cluster_connection_id" { + value = scylladbcloud_cluster_connection.aws_tgw.id +} diff --git a/examples/resources/scylladbcloud_cluster_connection/import.sh b/examples/resources/scylladbcloud_cluster_connection/import.sh new file mode 100644 index 0000000..4092e50 --- /dev/null +++ b/examples/resources/scylladbcloud_cluster_connection/import.sh @@ -0,0 +1,2 @@ +# An cluster connection can be imported by specifying the numeric identifier. +terraform import scylladbcloud_cluster_connection.example 123 diff --git a/templates/resources/cluster_connection.md.tmpl b/templates/resources/cluster_connection.md.tmpl new file mode 100644 index 0000000..73ef1b2 --- /dev/null +++ b/templates/resources/cluster_connection.md.tmpl @@ -0,0 +1,22 @@ +--- +page_title: "{{.Name}} {{.Type}} - {{.ProviderName}}" +subcategory: "" +description: |- +{{ .Description | plainmarkdown | trimspace | prefixlines " " }} +--- + +# {{.Name}} ({{.Type}}) + +{{ .Description | trimspace }} + +## Example of AWS Transit Gateway VPC Attachment Cluster Connection + +{{ tffile (printf "examples/resources/%s/aws-tgw-vpc-attachment.tf" .Name)}} + +{{ .SchemaMarkdown | trimspace }} + +## Import + +Import is supported using the following syntax: + +{{ codefile "shell" (printf "examples/resources/%s/import.sh" .Name)}}