Skip to content

Commit 3a44d7c

Browse files
authored
fix bug in Astra CDC config (#429)
Fix mismatch in the name of the new pulsar_cluster parameter in the CDC resource. Includes minor doc updates.
1 parent 4bfe6ad commit 3a44d7c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Terraform Provider for Astra
22

33
[Astra](https://astra.datastax.com/) is the DataStax (serverless) service platform for Apache Cassandra and Apache Pulsar.
4+
[Complete API documentation](https://registry.terraform.io/providers/datastax/astra/latest/docs) for this terraform provider is
5+
available in the Terrfarm provider registry.
46

57
## Prerequisites
68

@@ -16,8 +18,6 @@ You will need [Terraform](https://www.terraform.io/) version 1.0 or higher.
1618

1719
## Getting Started
1820

19-
Reference documentation can be found in the [terraform registry](https://registry.terraform.io/providers/datastax/astra/latest/docs)
20-
2121
### Create a new Astra database using terraform
2222

2323
1. Create a file called `main.tf` in a new directory:

docs/resources/cdc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ resource "astra_cdc" "db_cdc" {
9999

100100
### Optional
101101

102-
- `pulsar_cluster` (String) Pulsar cluster name
102+
- `pulsar_cluster` (String) Name of the pulsar cluster to connect CDC. If this is not set, Terraform will try to determine the pulsar cluster name based on the database cloud provider and region
103103

104104
### Read-Only
105105

internal/provider/resource_cdc.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ func resourceCDC() *schema.Resource {
6666
ForceNew: true,
6767
},
6868
"pulsar_cluster": {
69-
Description: "Pulsar cluster name",
70-
Type: schema.TypeString,
71-
Optional: true,
72-
ForceNew: true,
69+
Description: "Name of the pulsar cluster to connect CDC. If this is not set, Terraform will try to " +
70+
"determine the pulsar cluster name based on the database cloud provider and region",
71+
Type: schema.TypeString,
72+
Optional: true,
73+
ForceNew: true,
7374
},
7475
"tenant_name": {
7576
Description: "Streaming tenant name",
@@ -102,7 +103,7 @@ func resourceCDCDelete(ctx context.Context, resourceData *schema.ResourceData, m
102103
token := meta.(astraClients).token
103104

104105
id := resourceData.Id()
105-
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster_name").(string)
106+
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster").(string)
106107

107108
databaseId, keyspace, table, tenantName, err := parseCDCID(id)
108109
if err != nil {
@@ -197,7 +198,7 @@ func resourceCDCRead(ctx context.Context, resourceData *schema.ResourceData, met
197198
token := meta.(astraClients).token
198199

199200
id := resourceData.Id()
200-
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster_name").(string)
201+
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster").(string)
201202

202203
databaseId, keyspace, table, tenantName, err := parseCDCID(id)
203204
if err != nil {
@@ -299,7 +300,7 @@ func resourceCDCCreate(ctx context.Context, resourceData *schema.ResourceData, m
299300
databaseId := resourceData.Get("database_id").(string)
300301
databaseName := resourceData.Get("database_name").(string)
301302
topicPartitions := resourceData.Get("topic_partitions").(int)
302-
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster_name").(string)
303+
pulsarClusterFromConfig := resourceData.Get("pulsar_cluster").(string)
303304
tenantName := resourceData.Get("tenant_name").(string)
304305

305306
orgBody, _ := client.GetCurrentOrganization(ctx)

0 commit comments

Comments
 (0)