Skip to content

Commit 0d80a3b

Browse files
authored
feat: Add workspace_name field in stream_processor resource and datasource (#3793)
1 parent 0acfc1b commit 0d80a3b

File tree

18 files changed

+784
-248
lines changed

18 files changed

+784
-248
lines changed

.changelog/3793.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
```release-note:note
2+
resource/mongodbatlas_stream_processor: Deprecates the `instance_name` attribute, use `workspace_name` instead
3+
4+
```
5+
```release-note:note
6+
data-source/mongodbatlas_stream_processor: Deprecates the `instance_name` attribute, use `workspace_name` instead
7+
```
8+
9+
```release-note:note
10+
data-source/mongodbatlas_stream_processors: Deprecates the `instance_name` attribute, use `workspace_name` instead
11+
```

docs/data-sources/stream_connection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ data "mongodbatlas_stream_connection" "example" {
2929
## Argument Reference
3030

3131
* `project_id` - (Required) Unique 24-hexadecimal digit string that identifies your project.
32-
* `instance_name` - (Deprecated) Human-readable label that identifies the stream instance. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
33-
* `workspace_name` - (Optional) Human-readable label that identifies the stream instance. Conflicts with `workspace_name`.
34-
* `connection_name` - (Required) Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
32+
* `instance_name` - (Deprecated) Label that identifies the stream processing workspace. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
33+
* `workspace_name` - (Optional) Label that identifies the stream processing workspace. Conflicts with `instance_name`.
34+
* `connection_name` - (Required) Label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
3535

3636
~> **NOTE:** Either `workspace_name` or `instance_name` must be provided, but not both. These fields are functionally identical and `workspace_name` is an alias for `instance_name`. `workspace_name` should be used instead of `instance_name`.
3737

docs/data-sources/stream_connections.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ data "mongodbatlas_stream_connections" "test" {
1818
## Argument Reference
1919

2020
* `project_id` - (Required) Unique 24-hexadecimal digit string that identifies your project.
21-
* `instance_name` - (Deprecated) Human-readable label that identifies the stream instance. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
22-
* `workspace_name` - (Optional) Human-readable label that identifies the stream instance. Conflicts with `instance_name`.
21+
* `instance_name` - (Deprecated) Label that identifies the stream processing workspace. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
22+
* `workspace_name` - (Optional) Label that identifies the stream processing workspace. Conflicts with `instance_name`.
2323

2424
~> **NOTE:** Either `workspace_name` or `instance_name` must be provided, but not both. These fields are functionally identical and `workspace_name` is an alias for `instance_name`. `workspace_name` should be used instead of `instance_name`.
2525

@@ -37,8 +37,8 @@ In addition to all arguments above, it also exports the following attributes:
3737
### Stream Connection
3838

3939
* `project_id` - Unique 24-hexadecimal digit string that identifies your project.
40-
* `workspace_name` - Human-readable label that identifies the stream instance.
41-
* `connection_name` - Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
40+
* `workspace_name` - Label that identifies the stream processing workspace.
41+
* `connection_name` - Label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
4242
* `type` - Type of connection. `AWSLambda`, `Cluster`, `Https`, `Kafka` or `Sample`.
4343

4444
If `type` is of value `Cluster` the following additional attributes are defined:

docs/data-sources/stream_processor.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ resource "mongodbatlas_stream_instance" "example" {
1919
2020
resource "mongodbatlas_stream_connection" "example-sample" {
2121
project_id = var.project_id
22-
instance_name = mongodbatlas_stream_instance.example.instance_name
22+
workspace_name = mongodbatlas_stream_instance.example.instance_name
2323
connection_name = "sample_stream_solar"
2424
type = "Sample"
2525
}
2626
2727
resource "mongodbatlas_stream_connection" "example-cluster" {
2828
project_id = var.project_id
29-
instance_name = mongodbatlas_stream_instance.example.instance_name
29+
workspace_name = mongodbatlas_stream_instance.example.instance_name
3030
connection_name = "ClusterConnection"
3131
type = "Cluster"
3232
cluster_name = var.cluster_name
@@ -38,7 +38,7 @@ resource "mongodbatlas_stream_connection" "example-cluster" {
3838
3939
resource "mongodbatlas_stream_connection" "example-kafka" {
4040
project_id = var.project_id
41-
instance_name = mongodbatlas_stream_instance.example.instance_name
41+
workspace_name = mongodbatlas_stream_instance.example.instance_name
4242
connection_name = "KafkaPlaintextConnection"
4343
type = "Kafka"
4444
authentication = {
@@ -57,7 +57,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
5757
5858
resource "mongodbatlas_stream_processor" "stream-processor-sample-example" {
5959
project_id = var.project_id
60-
instance_name = mongodbatlas_stream_instance.example.instance_name
60+
workspace_name = mongodbatlas_stream_instance.example.instance_name
6161
processor_name = "sampleProcessorName"
6262
pipeline = jsonencode([
6363
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-sample.connection_name } },
@@ -68,7 +68,7 @@ resource "mongodbatlas_stream_processor" "stream-processor-sample-example" {
6868
6969
resource "mongodbatlas_stream_processor" "stream-processor-cluster-to-kafka-example" {
7070
project_id = var.project_id
71-
instance_name = mongodbatlas_stream_instance.example.instance_name
71+
workspace_name = mongodbatlas_stream_instance.example.instance_name
7272
processor_name = "clusterProcessorName"
7373
pipeline = jsonencode([
7474
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-cluster.connection_name } },
@@ -79,7 +79,7 @@ resource "mongodbatlas_stream_processor" "stream-processor-cluster-to-kafka-exam
7979
8080
resource "mongodbatlas_stream_processor" "stream-processor-kafka-to-cluster-example" {
8181
project_id = var.project_id
82-
instance_name = mongodbatlas_stream_instance.example.instance_name
82+
workspace_name = mongodbatlas_stream_instance.example.instance_name
8383
processor_name = "kafkaProcessorName"
8484
pipeline = jsonencode([
8585
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-kafka.connection_name, "topic" : "topic_source" } },
@@ -96,13 +96,13 @@ resource "mongodbatlas_stream_processor" "stream-processor-kafka-to-cluster-exam
9696
}
9797
9898
data "mongodbatlas_stream_processors" "example-stream-processors" {
99-
project_id = var.project_id
100-
instance_name = mongodbatlas_stream_instance.example.instance_name
99+
project_id = var.project_id
100+
workspace_name = mongodbatlas_stream_instance.example.instance_name
101101
}
102102
103103
data "mongodbatlas_stream_processor" "example-stream-processor" {
104104
project_id = var.project_id
105-
instance_name = mongodbatlas_stream_instance.example.instance_name
105+
workspace_name = mongodbatlas_stream_instance.example.instance_name
106106
processor_name = mongodbatlas_stream_processor.stream-processor-sample-example.processor_name
107107
}
108108
@@ -121,12 +121,16 @@ output "stream_processors_results" {
121121

122122
### Required
123123

124-
- `instance_name` (String) Human-readable label that identifies the stream instance.
125-
- `processor_name` (String) Human-readable label that identifies the stream processor.
124+
- `processor_name` (String) Label that identifies the stream processor.
126125
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.
127126

128127
**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
129128

129+
### Optional
130+
131+
- `instance_name` (String, Deprecated) Label that identifies the stream processing workspace.
132+
- `workspace_name` (String) Label that identifies the stream processing workspace. Conflicts with `instance_name`.
133+
130134
### Read-Only
131135

132136
- `id` (String) Unique 24-hexadecimal character string that identifies the stream processor.

docs/data-sources/stream_processors.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ resource "mongodbatlas_stream_instance" "example" {
1919
2020
resource "mongodbatlas_stream_connection" "example-sample" {
2121
project_id = var.project_id
22-
instance_name = mongodbatlas_stream_instance.example.instance_name
22+
workspace_name = mongodbatlas_stream_instance.example.instance_name
2323
connection_name = "sample_stream_solar"
2424
type = "Sample"
2525
}
2626
2727
resource "mongodbatlas_stream_connection" "example-cluster" {
2828
project_id = var.project_id
29-
instance_name = mongodbatlas_stream_instance.example.instance_name
29+
workspace_name = mongodbatlas_stream_instance.example.instance_name
3030
connection_name = "ClusterConnection"
3131
type = "Cluster"
3232
cluster_name = var.cluster_name
@@ -38,7 +38,7 @@ resource "mongodbatlas_stream_connection" "example-cluster" {
3838
3939
resource "mongodbatlas_stream_connection" "example-kafka" {
4040
project_id = var.project_id
41-
instance_name = mongodbatlas_stream_instance.example.instance_name
41+
workspace_name = mongodbatlas_stream_instance.example.instance_name
4242
connection_name = "KafkaPlaintextConnection"
4343
type = "Kafka"
4444
authentication = {
@@ -57,7 +57,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
5757
5858
resource "mongodbatlas_stream_processor" "stream-processor-sample-example" {
5959
project_id = var.project_id
60-
instance_name = mongodbatlas_stream_instance.example.instance_name
60+
workspace_name = mongodbatlas_stream_instance.example.instance_name
6161
processor_name = "sampleProcessorName"
6262
pipeline = jsonencode([
6363
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-sample.connection_name } },
@@ -68,7 +68,7 @@ resource "mongodbatlas_stream_processor" "stream-processor-sample-example" {
6868
6969
resource "mongodbatlas_stream_processor" "stream-processor-cluster-to-kafka-example" {
7070
project_id = var.project_id
71-
instance_name = mongodbatlas_stream_instance.example.instance_name
71+
workspace_name = mongodbatlas_stream_instance.example.instance_name
7272
processor_name = "clusterProcessorName"
7373
pipeline = jsonencode([
7474
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-cluster.connection_name } },
@@ -79,7 +79,7 @@ resource "mongodbatlas_stream_processor" "stream-processor-cluster-to-kafka-exam
7979
8080
resource "mongodbatlas_stream_processor" "stream-processor-kafka-to-cluster-example" {
8181
project_id = var.project_id
82-
instance_name = mongodbatlas_stream_instance.example.instance_name
82+
workspace_name = mongodbatlas_stream_instance.example.instance_name
8383
processor_name = "kafkaProcessorName"
8484
pipeline = jsonencode([
8585
{ "$source" = { "connectionName" = resource.mongodbatlas_stream_connection.example-kafka.connection_name, "topic" : "topic_source" } },
@@ -96,13 +96,13 @@ resource "mongodbatlas_stream_processor" "stream-processor-kafka-to-cluster-exam
9696
}
9797
9898
data "mongodbatlas_stream_processors" "example-stream-processors" {
99-
project_id = var.project_id
100-
instance_name = mongodbatlas_stream_instance.example.instance_name
99+
project_id = var.project_id
100+
workspace_name = mongodbatlas_stream_instance.example.instance_name
101101
}
102102
103103
data "mongodbatlas_stream_processor" "example-stream-processor" {
104104
project_id = var.project_id
105-
instance_name = mongodbatlas_stream_instance.example.instance_name
105+
workspace_name = mongodbatlas_stream_instance.example.instance_name
106106
processor_name = mongodbatlas_stream_processor.stream-processor-sample-example.processor_name
107107
}
108108
@@ -121,11 +121,15 @@ output "stream_processors_results" {
121121

122122
### Required
123123

124-
- `instance_name` (String) Human-readable label that identifies the stream instance.
125124
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.
126125

127126
**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
128127

128+
### Optional
129+
130+
- `instance_name` (String, Deprecated) Label that identifies the stream processing workspace.
131+
- `workspace_name` (String) Label that identifies the stream processing workspace. Conflicts with `instance_name`.
132+
129133
### Read-Only
130134

131135
- `results` (Attributes List) Returns all Stream Processors within the specified stream instance.
@@ -140,17 +144,18 @@ role or Project Stream Processing Owner role. (see [below for nested schema](#ne
140144
Read-Only:
141145

142146
- `id` (String) Unique 24-hexadecimal character string that identifies the stream processor.
143-
- `instance_name` (String) Human-readable label that identifies the stream instance.
147+
- `instance_name` (String, Deprecated) Label that identifies the stream processing workspace.
144148
- `options` (Attributes) Optional configuration for the stream processor. (see [below for nested schema](#nestedatt--results--options))
145149
- `pipeline` (String) Stream aggregation pipeline you want to apply to your streaming data. [MongoDB Atlas Docs](https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/#std-label-stream-aggregation) contain more information. Using [jsonencode](https://developer.hashicorp.com/terraform/language/functions/jsonencode) is recommended when setting this attribute. For more details see the [Aggregation Pipelines Documentation](https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/)
146-
- `processor_name` (String) Human-readable label that identifies the stream processor.
150+
- `processor_name` (String) Label that identifies the stream processor.
147151
- `project_id` (String) Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.
148152

149153
**NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.
150154
- `state` (String) The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. Used to start or stop the Stream Processor. Valid values are `CREATED`, `STARTED` or `STOPPED`. When a Stream Processor is created without specifying the state, it will default to `CREATED` state. When a Stream Processor is updated without specifying the state, it will default to the Previous state.
151155

152156
**NOTE** When a Stream Processor is updated without specifying the state, it is stopped and then restored to previous state upon update completion.
153157
- `stats` (String) The stats associated with the stream processor. Refer to the [MongoDB Atlas Docs](https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor) for more information.
158+
- `workspace_name` (String) Label that identifies the stream processing workspace.
154159

155160
<a id="nestedatt--results--options"></a>
156161
### Nested Schema for `results.options`

docs/resources/stream_connection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ resource "mongodbatlas_stream_connection" "example-https" {
152152
## Argument Reference
153153

154154
* `project_id` - (Required) Unique 24-hexadecimal digit string that identifies your project.
155-
* `instance_name` - (Deprecated) Human-readable label that identifies the stream instance. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
156-
* `workspace_name` - (Optional) Human-readable label that identifies the stream instance. Conflicts with `instance_name`.
157-
* `connection_name` - (Required) Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
155+
* `instance_name` - (Deprecated) Label that identifies the stream processing workspace. Attribute is deprecated and will be removed in following major versions in favor of `workspace_name`.
156+
* `workspace_name` - (Optional) Label that identifies the stream processing workspace. Conflicts with `instance_name`.
157+
* `connection_name` - (Required) Label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source.
158158
* `type` - (Required) Type of connection. Can be `AWSLambda`, `Cluster`, `Https`, `Kafka` or `Sample`.
159159

160160
~> **NOTE:** Either `workspace_name` or `instance_name` must be provided, but not both. These fields are functionally identical and `workspace_name` is an alias for `instance_name`. `workspace_name` should be used instead of `instance_name`.

0 commit comments

Comments
 (0)