Skip to content

Commit 3da665b

Browse files
authored
streaming_sink: migrate to terraform framework (#463)
Migrate the streaming sink resource to use the Terraform plugin framework.
1 parent 37c0893 commit 3da665b

File tree

7 files changed

+444
-289
lines changed

7 files changed

+444
-289
lines changed

docs/resources/streaming_namespace.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ resource "astra_streaming_namespace" "streaming_namespace" {
6868

6969
### Required
7070

71-
- `cluster` (String) Cluster where the tenant is located.
71+
- `cluster` (String) Name of the Pulsar cluster where the tenant is located.
7272
- `namespace` (String) Name of the Pulsar namespace.
7373
- `tenant` (String) Name of the tenant.
7474

docs/resources/streaming_sink.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
page_title: "astra_streaming_sink Resource - terraform-provider-astra"
44
subcategory: ""
55
description: |-
6-
astra_streaming_sink creates a streaming sink which sends data from a topic to a target system.
6+
Creates a streaming sink which sends data from a topic to a target system.
77
---
88

99
# astra_streaming_sink (Resource)
1010

11-
`astra_streaming_sink` creates a streaming sink which sends data from a topic to a target system.
11+
Creates a streaming sink which sends data from a topic to a target system.
1212

1313
## Example Usage
1414

@@ -79,7 +79,7 @@ resource "astra_streaming_sink" "streaming_sink" {
7979
- `auto_ack` (Boolean) auto ack
8080
- `namespace` (String) Pulsar Namespace
8181
- `parallelism` (Number) Parallelism for Pulsar sink
82-
- `processing_guarantees` (String) "ATLEAST_ONCE""ATMOST_ONCE""EFFECTIVELY_ONCE".
82+
- `processing_guarantees` (String) "ATLEAST_ONCE" "ATMOST_ONCE" "EFFECTIVELY_ONCE".
8383
- `retain_ordering` (Boolean) Retain ordering.
8484
- `sink_configs` (String) Sink Configs
8585
- `sink_name` (String) Name of the sink.
@@ -88,15 +88,16 @@ resource "astra_streaming_sink" "streaming_sink" {
8888

8989
### Optional
9090

91-
- `archive` (String) Name of the sink archive type to use. Defaults to the value of sink_name. Must be formatted as a URL, e.g. 'builtin://jdbc-clickhouse
92-
- `cloud_provider` (String, Deprecated) Cloud provider
91+
- `archive` (String) Name of the sink archive type to use. Defaults to the value of sink_name. Must be formatted as a URL, e.g. 'builtin://jdbc-clickhouse'
92+
- `cloud_provider` (String, Deprecated) Cloud provider (deprecated, use `cluster` instead)
93+
- `cluster` (String) Name of the pulsar cluster in which to create the sink. If left blank, the name will be inferred from the cloud provider and region.
9394
- `deletion_protection` (Boolean) Whether or not to allow Terraform to destroy this streaming sink. Unless this field is set to false in Terraform state, a `terraform destroy` or `terraform apply` command that deletes the instance will fail. Defaults to `true`.
94-
- `pulsar_cluster` (String) Name of the pulsar cluster in which to create the sink. If left blank, the name will be inferred from thecloud provider and region
95-
- `region` (String, Deprecated) cloud region
95+
- `pulsar_cluster` (String, Deprecated) Name of the pulsar cluster in which to create the sink. If left blank, the name will be inferred from the cloud provider and region.
96+
- `region` (String, Deprecated) cloud region (deprecated, use `cluster` instead)
9697

9798
### Read-Only
9899

99-
- `id` (String) The ID of this resource.
100+
- `id` (String) Unique ID in the form cluster_name/tenant_name/namespace/sink_name
100101

101102
## Import
102103

internal/provider/provider.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ func NewSDKProvider(version string) func() *schema.Provider {
8585
"astra_role": resourceRole(),
8686
"astra_token": resourceToken(),
8787
"astra_cdc": resourceCDC(),
88-
"astra_streaming_sink": resourceStreamingSink(),
8988
"astra_table": resourceTable(),
9089
"astra_customer_key": resourceCustomerKey(),
9190
"astra_enterprise_org": resourceEnterpriseOrg(),

internal/provider/provider_framework.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ func (p *astraProvider) DataSources(_ context.Context) []func() datasource.DataS
108108
func (p *astraProvider) Resources(_ context.Context) []func() resource.Resource {
109109
return []func() resource.Resource{
110110
NewAstraCDCv3Resource,
111-
NewStreamingTenantResource,
112111
NewStreamingNamespaceResource,
113112
NewStreamingPulsarTokenResource,
113+
NewStreamingSinkResource,
114+
NewStreamingTenantResource,
114115
NewStreamingTopicResource,
115116
}
116117
}

internal/provider/resource_streaming_namespace.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (r *StreamingNamespaceResource) Schema(_ context.Context, _ resource.Schema
5959
},
6060
},
6161
"cluster": schema.StringAttribute{
62-
Description: "Cluster where the tenant is located.",
62+
Description: "Name of the Pulsar cluster where the tenant is located.",
6363
Required: true,
6464
PlanModifiers: []planmodifier.String{
6565
stringplanmodifier.RequiresReplace(),

0 commit comments

Comments
 (0)