Skip to content

Commit

Permalink
feat(cluster-connection): implement conterpart for cluster connection…
Browse files Browse the repository at this point in the history
…s api in particular tgw (#115)

* feat(cluster-connection): implement conterpart for cluster connections api

* feat(cluster-connection): add docs

---------

Co-authored-by: Dmitry Kropachev <[email protected]>
  • Loading branch information
dkropachev and Dmitry Kropachev authored May 8, 2024
1 parent e8ddcc4 commit 09cdd72
Show file tree
Hide file tree
Showing 16 changed files with 677 additions and 33 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/internal/provider/cqlauth/ @rjeczalik
/internal/provider/serverless/ @rjeczalik
/internal/provider/vpcpeering/ @rjeczalik
/internal/provider/connection/ @dkropachev @charconstpointer
72 changes: 72 additions & 0 deletions docs/resources/cluster_connection.md
Original file line number Diff line number Diff line change
@@ -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 generated by tfplugindocs -->
## 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

<a id="nestedblock--timeouts"></a>
### 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
```
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 2 additions & 0 deletions examples/resources/scylladbcloud_cluster_connection/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# An cluster connection can be imported by specifying the numeric identifier.
terraform import scylladbcloud_cluster_connection.example 123
Loading

0 comments on commit 09cdd72

Please sign in to comment.