pulumi-kafka 3.10.3__py3-none-any.whl → 3.11.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pulumi-kafka might be problematic. Click here for more details.
- pulumi_kafka/__init__.py +3 -1
- pulumi_kafka/acl.py +326 -99
- pulumi_kafka/config/__init__.py +1 -1
- pulumi_kafka/config/__init__.pyi +1 -2
- pulumi_kafka/config/vars.py +29 -30
- pulumi_kafka/get_topic.py +13 -14
- pulumi_kafka/get_topics.py +85 -0
- pulumi_kafka/outputs.py +71 -0
- pulumi_kafka/provider.py +268 -269
- pulumi_kafka/pulumi-plugin.json +1 -1
- pulumi_kafka/quota.py +296 -55
- pulumi_kafka/topic.py +293 -72
- pulumi_kafka/user_scram_credential.py +145 -86
- {pulumi_kafka-3.10.3.dist-info → pulumi_kafka-3.11.0.dist-info}/METADATA +1 -1
- pulumi_kafka-3.11.0.dist-info/RECORD +19 -0
- pulumi_kafka-3.10.3.dist-info/RECORD +0 -17
- {pulumi_kafka-3.10.3.dist-info → pulumi_kafka-3.11.0.dist-info}/WHEEL +0 -0
- {pulumi_kafka-3.10.3.dist-info → pulumi_kafka-3.11.0.dist-info}/top_level.txt +0 -0
pulumi_kafka/topic.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# *** WARNING: this file was generated by pulumi-language-python. ***
|
|
3
3
|
# *** Do not edit by hand unless you're certain you know what you are doing! ***
|
|
4
4
|
|
|
5
|
-
import builtins
|
|
6
|
-
import copy
|
|
5
|
+
import builtins as _builtins
|
|
7
6
|
import warnings
|
|
8
7
|
import sys
|
|
9
8
|
import pulumi
|
|
@@ -20,16 +19,16 @@ __all__ = ['TopicArgs', 'Topic']
|
|
|
20
19
|
@pulumi.input_type
|
|
21
20
|
class TopicArgs:
|
|
22
21
|
def __init__(__self__, *,
|
|
23
|
-
partitions: pulumi.Input[
|
|
24
|
-
replication_factor: pulumi.Input[
|
|
25
|
-
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
26
|
-
name: Optional[pulumi.Input[
|
|
22
|
+
partitions: pulumi.Input[_builtins.int],
|
|
23
|
+
replication_factor: pulumi.Input[_builtins.int],
|
|
24
|
+
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
|
|
25
|
+
name: Optional[pulumi.Input[_builtins.str]] = None):
|
|
27
26
|
"""
|
|
28
27
|
The set of arguments for constructing a Topic resource.
|
|
29
|
-
:param pulumi.Input[
|
|
30
|
-
:param pulumi.Input[
|
|
31
|
-
:param pulumi.Input[Mapping[str, pulumi.Input[
|
|
32
|
-
:param pulumi.Input[
|
|
28
|
+
:param pulumi.Input[_builtins.int] partitions: Number of partitions.
|
|
29
|
+
:param pulumi.Input[_builtins.int] replication_factor: Number of replicas.
|
|
30
|
+
:param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] config: A map of string k/v attributes.
|
|
31
|
+
:param pulumi.Input[_builtins.str] name: The name of the topic.
|
|
33
32
|
"""
|
|
34
33
|
pulumi.set(__self__, "partitions", partitions)
|
|
35
34
|
pulumi.set(__self__, "replication_factor", replication_factor)
|
|
@@ -38,68 +37,68 @@ class TopicArgs:
|
|
|
38
37
|
if name is not None:
|
|
39
38
|
pulumi.set(__self__, "name", name)
|
|
40
39
|
|
|
41
|
-
@property
|
|
40
|
+
@_builtins.property
|
|
42
41
|
@pulumi.getter
|
|
43
|
-
def partitions(self) -> pulumi.Input[
|
|
42
|
+
def partitions(self) -> pulumi.Input[_builtins.int]:
|
|
44
43
|
"""
|
|
45
44
|
Number of partitions.
|
|
46
45
|
"""
|
|
47
46
|
return pulumi.get(self, "partitions")
|
|
48
47
|
|
|
49
48
|
@partitions.setter
|
|
50
|
-
def partitions(self, value: pulumi.Input[
|
|
49
|
+
def partitions(self, value: pulumi.Input[_builtins.int]):
|
|
51
50
|
pulumi.set(self, "partitions", value)
|
|
52
51
|
|
|
53
|
-
@property
|
|
52
|
+
@_builtins.property
|
|
54
53
|
@pulumi.getter(name="replicationFactor")
|
|
55
|
-
def replication_factor(self) -> pulumi.Input[
|
|
54
|
+
def replication_factor(self) -> pulumi.Input[_builtins.int]:
|
|
56
55
|
"""
|
|
57
56
|
Number of replicas.
|
|
58
57
|
"""
|
|
59
58
|
return pulumi.get(self, "replication_factor")
|
|
60
59
|
|
|
61
60
|
@replication_factor.setter
|
|
62
|
-
def replication_factor(self, value: pulumi.Input[
|
|
61
|
+
def replication_factor(self, value: pulumi.Input[_builtins.int]):
|
|
63
62
|
pulumi.set(self, "replication_factor", value)
|
|
64
63
|
|
|
65
|
-
@property
|
|
64
|
+
@_builtins.property
|
|
66
65
|
@pulumi.getter
|
|
67
|
-
def config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
66
|
+
def config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
|
|
68
67
|
"""
|
|
69
68
|
A map of string k/v attributes.
|
|
70
69
|
"""
|
|
71
70
|
return pulumi.get(self, "config")
|
|
72
71
|
|
|
73
72
|
@config.setter
|
|
74
|
-
def config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
73
|
+
def config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
|
|
75
74
|
pulumi.set(self, "config", value)
|
|
76
75
|
|
|
77
|
-
@property
|
|
76
|
+
@_builtins.property
|
|
78
77
|
@pulumi.getter
|
|
79
|
-
def name(self) -> Optional[pulumi.Input[
|
|
78
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
80
79
|
"""
|
|
81
80
|
The name of the topic.
|
|
82
81
|
"""
|
|
83
82
|
return pulumi.get(self, "name")
|
|
84
83
|
|
|
85
84
|
@name.setter
|
|
86
|
-
def name(self, value: Optional[pulumi.Input[
|
|
85
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
87
86
|
pulumi.set(self, "name", value)
|
|
88
87
|
|
|
89
88
|
|
|
90
89
|
@pulumi.input_type
|
|
91
90
|
class _TopicState:
|
|
92
91
|
def __init__(__self__, *,
|
|
93
|
-
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
94
|
-
name: Optional[pulumi.Input[
|
|
95
|
-
partitions: Optional[pulumi.Input[
|
|
96
|
-
replication_factor: Optional[pulumi.Input[
|
|
92
|
+
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
|
|
93
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
94
|
+
partitions: Optional[pulumi.Input[_builtins.int]] = None,
|
|
95
|
+
replication_factor: Optional[pulumi.Input[_builtins.int]] = None):
|
|
97
96
|
"""
|
|
98
97
|
Input properties used for looking up and filtering Topic resources.
|
|
99
|
-
:param pulumi.Input[Mapping[str, pulumi.Input[
|
|
100
|
-
:param pulumi.Input[
|
|
101
|
-
:param pulumi.Input[
|
|
102
|
-
:param pulumi.Input[
|
|
98
|
+
:param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] config: A map of string k/v attributes.
|
|
99
|
+
:param pulumi.Input[_builtins.str] name: The name of the topic.
|
|
100
|
+
:param pulumi.Input[_builtins.int] partitions: Number of partitions.
|
|
101
|
+
:param pulumi.Input[_builtins.int] replication_factor: Number of replicas.
|
|
103
102
|
"""
|
|
104
103
|
if config is not None:
|
|
105
104
|
pulumi.set(__self__, "config", config)
|
|
@@ -110,52 +109,52 @@ class _TopicState:
|
|
|
110
109
|
if replication_factor is not None:
|
|
111
110
|
pulumi.set(__self__, "replication_factor", replication_factor)
|
|
112
111
|
|
|
113
|
-
@property
|
|
112
|
+
@_builtins.property
|
|
114
113
|
@pulumi.getter
|
|
115
|
-
def config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
114
|
+
def config(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]:
|
|
116
115
|
"""
|
|
117
116
|
A map of string k/v attributes.
|
|
118
117
|
"""
|
|
119
118
|
return pulumi.get(self, "config")
|
|
120
119
|
|
|
121
120
|
@config.setter
|
|
122
|
-
def config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
121
|
+
def config(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]]):
|
|
123
122
|
pulumi.set(self, "config", value)
|
|
124
123
|
|
|
125
|
-
@property
|
|
124
|
+
@_builtins.property
|
|
126
125
|
@pulumi.getter
|
|
127
|
-
def name(self) -> Optional[pulumi.Input[
|
|
126
|
+
def name(self) -> Optional[pulumi.Input[_builtins.str]]:
|
|
128
127
|
"""
|
|
129
128
|
The name of the topic.
|
|
130
129
|
"""
|
|
131
130
|
return pulumi.get(self, "name")
|
|
132
131
|
|
|
133
132
|
@name.setter
|
|
134
|
-
def name(self, value: Optional[pulumi.Input[
|
|
133
|
+
def name(self, value: Optional[pulumi.Input[_builtins.str]]):
|
|
135
134
|
pulumi.set(self, "name", value)
|
|
136
135
|
|
|
137
|
-
@property
|
|
136
|
+
@_builtins.property
|
|
138
137
|
@pulumi.getter
|
|
139
|
-
def partitions(self) -> Optional[pulumi.Input[
|
|
138
|
+
def partitions(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
140
139
|
"""
|
|
141
140
|
Number of partitions.
|
|
142
141
|
"""
|
|
143
142
|
return pulumi.get(self, "partitions")
|
|
144
143
|
|
|
145
144
|
@partitions.setter
|
|
146
|
-
def partitions(self, value: Optional[pulumi.Input[
|
|
145
|
+
def partitions(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
147
146
|
pulumi.set(self, "partitions", value)
|
|
148
147
|
|
|
149
|
-
@property
|
|
148
|
+
@_builtins.property
|
|
150
149
|
@pulumi.getter(name="replicationFactor")
|
|
151
|
-
def replication_factor(self) -> Optional[pulumi.Input[
|
|
150
|
+
def replication_factor(self) -> Optional[pulumi.Input[_builtins.int]]:
|
|
152
151
|
"""
|
|
153
152
|
Number of replicas.
|
|
154
153
|
"""
|
|
155
154
|
return pulumi.get(self, "replication_factor")
|
|
156
155
|
|
|
157
156
|
@replication_factor.setter
|
|
158
|
-
def replication_factor(self, value: Optional[pulumi.Input[
|
|
157
|
+
def replication_factor(self, value: Optional[pulumi.Input[_builtins.int]]):
|
|
159
158
|
pulumi.set(self, "replication_factor", value)
|
|
160
159
|
|
|
161
160
|
|
|
@@ -165,19 +164,130 @@ class Topic(pulumi.CustomResource):
|
|
|
165
164
|
def __init__(__self__,
|
|
166
165
|
resource_name: str,
|
|
167
166
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
168
|
-
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
169
|
-
name: Optional[pulumi.Input[
|
|
170
|
-
partitions: Optional[pulumi.Input[
|
|
171
|
-
replication_factor: Optional[pulumi.Input[
|
|
167
|
+
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
|
|
168
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
169
|
+
partitions: Optional[pulumi.Input[_builtins.int]] = None,
|
|
170
|
+
replication_factor: Optional[pulumi.Input[_builtins.int]] = None,
|
|
172
171
|
__props__=None):
|
|
173
172
|
"""
|
|
174
|
-
|
|
173
|
+
The `Topic` resource manages Apache Kafka topics, including their partition count, replication factor, and various configuration parameters. This resource supports non-destructive partition count increases.
|
|
174
|
+
|
|
175
|
+
## Example Usage
|
|
176
|
+
|
|
177
|
+
### Basic Topic
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
import pulumi
|
|
181
|
+
import pulumi_kafka as kafka
|
|
182
|
+
|
|
183
|
+
example = kafka.Topic("example",
|
|
184
|
+
name="example-topic",
|
|
185
|
+
replication_factor=3,
|
|
186
|
+
partitions=10)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Topic with Common Configurations
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
import pulumi
|
|
193
|
+
import pulumi_kafka as kafka
|
|
194
|
+
|
|
195
|
+
logs = kafka.Topic("logs",
|
|
196
|
+
name="application-logs",
|
|
197
|
+
replication_factor=3,
|
|
198
|
+
partitions=50,
|
|
199
|
+
config={
|
|
200
|
+
"retention.ms": "604800000",
|
|
201
|
+
"segment.ms": "86400000",
|
|
202
|
+
"cleanup.policy": "delete",
|
|
203
|
+
"compression.type": "gzip",
|
|
204
|
+
})
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Compacted Topic for Event Sourcing
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
import pulumi
|
|
211
|
+
import pulumi_kafka as kafka
|
|
212
|
+
|
|
213
|
+
events = kafka.Topic("events",
|
|
214
|
+
name="user-events",
|
|
215
|
+
replication_factor=3,
|
|
216
|
+
partitions=100,
|
|
217
|
+
config={
|
|
218
|
+
"cleanup.policy": "compact",
|
|
219
|
+
"retention.ms": "-1",
|
|
220
|
+
"min.compaction.lag.ms": "3600000",
|
|
221
|
+
"delete.retention.ms": "86400000",
|
|
222
|
+
"compression.type": "lz4",
|
|
223
|
+
"segment.bytes": "1073741824",
|
|
224
|
+
})
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### High-Throughput Topic
|
|
228
|
+
|
|
229
|
+
```python
|
|
230
|
+
import pulumi
|
|
231
|
+
import pulumi_kafka as kafka
|
|
232
|
+
|
|
233
|
+
metrics = kafka.Topic("metrics",
|
|
234
|
+
name="system-metrics",
|
|
235
|
+
replication_factor=2,
|
|
236
|
+
partitions=200,
|
|
237
|
+
config={
|
|
238
|
+
"retention.ms": "86400000",
|
|
239
|
+
"segment.ms": "3600000",
|
|
240
|
+
"compression.type": "lz4",
|
|
241
|
+
"max.message.bytes": "1048576",
|
|
242
|
+
"min.insync.replicas": "2",
|
|
243
|
+
"unclean.leader.election.enable": "false",
|
|
244
|
+
})
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Configuration Parameters
|
|
248
|
+
|
|
249
|
+
The `config` map supports all Kafka topic-level configurations. Common configurations include:
|
|
250
|
+
|
|
251
|
+
### Retention Settings
|
|
252
|
+
- `retention.ms` - How long to retain messages (in milliseconds). Default: 604800000 (7 days)
|
|
253
|
+
- `retention.bytes` - Maximum size of the log before deleting old segments. Default: -1 (no limit)
|
|
254
|
+
- `segment.ms` - Time after which a log segment should be rotated. Default: 604800000 (7 days)
|
|
255
|
+
- `segment.bytes` - Maximum size of a single log segment file. Default: 1073741824 (1GB)
|
|
256
|
+
|
|
257
|
+
### Cleanup and Compaction
|
|
258
|
+
- `cleanup.policy` - Either "delete" or "compact" or both "compact,delete". Default: "delete"
|
|
259
|
+
- `min.compaction.lag.ms` - Minimum time a message will remain uncompacted. Default: 0
|
|
260
|
+
- `delete.retention.ms` - How long to retain delete tombstone markers for compacted topics. Default: 86400000 (1 day)
|
|
261
|
+
|
|
262
|
+
### Compression
|
|
263
|
+
- `compression.type` - Compression codec: "uncompressed", "zstd", "lz4", "snappy", "gzip", "producer". Default: "producer"
|
|
264
|
+
|
|
265
|
+
### Replication and Durability
|
|
266
|
+
- `min.insync.replicas` - Minimum number of replicas that must acknowledge a write. Default: 1
|
|
267
|
+
- `unclean.leader.election.enable` - Whether to allow replicas not in ISR to be elected leader. Default: false
|
|
268
|
+
|
|
269
|
+
### Message Size
|
|
270
|
+
- `max.message.bytes` - Maximum size of a message. Default: 1048588 (~1MB)
|
|
271
|
+
- `message.timestamp.type` - Whether to use CreateTime or LogAppendTime. Default: "CreateTime"
|
|
272
|
+
|
|
273
|
+
For a complete list of configurations, refer to the [Kafka documentation](https://kafka.apache.org/documentation/#topicconfigs).
|
|
274
|
+
|
|
275
|
+
> **Note:** Increasing the partition count is supported without recreating the topic. However, decreasing partitions requires topic recreation.
|
|
276
|
+
|
|
277
|
+
## Import
|
|
278
|
+
|
|
279
|
+
Existing Kafka topics can be imported using the topic name:
|
|
280
|
+
|
|
281
|
+
```sh
|
|
282
|
+
$ pulumi import kafka:index/topic:Topic example example-topic
|
|
283
|
+
```
|
|
284
|
+
|
|
175
285
|
:param str resource_name: The name of the resource.
|
|
176
286
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
177
|
-
:param pulumi.Input[Mapping[str, pulumi.Input[
|
|
178
|
-
:param pulumi.Input[
|
|
179
|
-
:param pulumi.Input[
|
|
180
|
-
:param pulumi.Input[
|
|
287
|
+
:param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] config: A map of string k/v attributes.
|
|
288
|
+
:param pulumi.Input[_builtins.str] name: The name of the topic.
|
|
289
|
+
:param pulumi.Input[_builtins.int] partitions: Number of partitions.
|
|
290
|
+
:param pulumi.Input[_builtins.int] replication_factor: Number of replicas.
|
|
181
291
|
"""
|
|
182
292
|
...
|
|
183
293
|
@overload
|
|
@@ -186,7 +296,118 @@ class Topic(pulumi.CustomResource):
|
|
|
186
296
|
args: TopicArgs,
|
|
187
297
|
opts: Optional[pulumi.ResourceOptions] = None):
|
|
188
298
|
"""
|
|
189
|
-
|
|
299
|
+
The `Topic` resource manages Apache Kafka topics, including their partition count, replication factor, and various configuration parameters. This resource supports non-destructive partition count increases.
|
|
300
|
+
|
|
301
|
+
## Example Usage
|
|
302
|
+
|
|
303
|
+
### Basic Topic
|
|
304
|
+
|
|
305
|
+
```python
|
|
306
|
+
import pulumi
|
|
307
|
+
import pulumi_kafka as kafka
|
|
308
|
+
|
|
309
|
+
example = kafka.Topic("example",
|
|
310
|
+
name="example-topic",
|
|
311
|
+
replication_factor=3,
|
|
312
|
+
partitions=10)
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Topic with Common Configurations
|
|
316
|
+
|
|
317
|
+
```python
|
|
318
|
+
import pulumi
|
|
319
|
+
import pulumi_kafka as kafka
|
|
320
|
+
|
|
321
|
+
logs = kafka.Topic("logs",
|
|
322
|
+
name="application-logs",
|
|
323
|
+
replication_factor=3,
|
|
324
|
+
partitions=50,
|
|
325
|
+
config={
|
|
326
|
+
"retention.ms": "604800000",
|
|
327
|
+
"segment.ms": "86400000",
|
|
328
|
+
"cleanup.policy": "delete",
|
|
329
|
+
"compression.type": "gzip",
|
|
330
|
+
})
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Compacted Topic for Event Sourcing
|
|
334
|
+
|
|
335
|
+
```python
|
|
336
|
+
import pulumi
|
|
337
|
+
import pulumi_kafka as kafka
|
|
338
|
+
|
|
339
|
+
events = kafka.Topic("events",
|
|
340
|
+
name="user-events",
|
|
341
|
+
replication_factor=3,
|
|
342
|
+
partitions=100,
|
|
343
|
+
config={
|
|
344
|
+
"cleanup.policy": "compact",
|
|
345
|
+
"retention.ms": "-1",
|
|
346
|
+
"min.compaction.lag.ms": "3600000",
|
|
347
|
+
"delete.retention.ms": "86400000",
|
|
348
|
+
"compression.type": "lz4",
|
|
349
|
+
"segment.bytes": "1073741824",
|
|
350
|
+
})
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### High-Throughput Topic
|
|
354
|
+
|
|
355
|
+
```python
|
|
356
|
+
import pulumi
|
|
357
|
+
import pulumi_kafka as kafka
|
|
358
|
+
|
|
359
|
+
metrics = kafka.Topic("metrics",
|
|
360
|
+
name="system-metrics",
|
|
361
|
+
replication_factor=2,
|
|
362
|
+
partitions=200,
|
|
363
|
+
config={
|
|
364
|
+
"retention.ms": "86400000",
|
|
365
|
+
"segment.ms": "3600000",
|
|
366
|
+
"compression.type": "lz4",
|
|
367
|
+
"max.message.bytes": "1048576",
|
|
368
|
+
"min.insync.replicas": "2",
|
|
369
|
+
"unclean.leader.election.enable": "false",
|
|
370
|
+
})
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Configuration Parameters
|
|
374
|
+
|
|
375
|
+
The `config` map supports all Kafka topic-level configurations. Common configurations include:
|
|
376
|
+
|
|
377
|
+
### Retention Settings
|
|
378
|
+
- `retention.ms` - How long to retain messages (in milliseconds). Default: 604800000 (7 days)
|
|
379
|
+
- `retention.bytes` - Maximum size of the log before deleting old segments. Default: -1 (no limit)
|
|
380
|
+
- `segment.ms` - Time after which a log segment should be rotated. Default: 604800000 (7 days)
|
|
381
|
+
- `segment.bytes` - Maximum size of a single log segment file. Default: 1073741824 (1GB)
|
|
382
|
+
|
|
383
|
+
### Cleanup and Compaction
|
|
384
|
+
- `cleanup.policy` - Either "delete" or "compact" or both "compact,delete". Default: "delete"
|
|
385
|
+
- `min.compaction.lag.ms` - Minimum time a message will remain uncompacted. Default: 0
|
|
386
|
+
- `delete.retention.ms` - How long to retain delete tombstone markers for compacted topics. Default: 86400000 (1 day)
|
|
387
|
+
|
|
388
|
+
### Compression
|
|
389
|
+
- `compression.type` - Compression codec: "uncompressed", "zstd", "lz4", "snappy", "gzip", "producer". Default: "producer"
|
|
390
|
+
|
|
391
|
+
### Replication and Durability
|
|
392
|
+
- `min.insync.replicas` - Minimum number of replicas that must acknowledge a write. Default: 1
|
|
393
|
+
- `unclean.leader.election.enable` - Whether to allow replicas not in ISR to be elected leader. Default: false
|
|
394
|
+
|
|
395
|
+
### Message Size
|
|
396
|
+
- `max.message.bytes` - Maximum size of a message. Default: 1048588 (~1MB)
|
|
397
|
+
- `message.timestamp.type` - Whether to use CreateTime or LogAppendTime. Default: "CreateTime"
|
|
398
|
+
|
|
399
|
+
For a complete list of configurations, refer to the [Kafka documentation](https://kafka.apache.org/documentation/#topicconfigs).
|
|
400
|
+
|
|
401
|
+
> **Note:** Increasing the partition count is supported without recreating the topic. However, decreasing partitions requires topic recreation.
|
|
402
|
+
|
|
403
|
+
## Import
|
|
404
|
+
|
|
405
|
+
Existing Kafka topics can be imported using the topic name:
|
|
406
|
+
|
|
407
|
+
```sh
|
|
408
|
+
$ pulumi import kafka:index/topic:Topic example example-topic
|
|
409
|
+
```
|
|
410
|
+
|
|
190
411
|
:param str resource_name: The name of the resource.
|
|
191
412
|
:param TopicArgs args: The arguments to use to populate this resource's properties.
|
|
192
413
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
@@ -202,10 +423,10 @@ class Topic(pulumi.CustomResource):
|
|
|
202
423
|
def _internal_init(__self__,
|
|
203
424
|
resource_name: str,
|
|
204
425
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
205
|
-
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
206
|
-
name: Optional[pulumi.Input[
|
|
207
|
-
partitions: Optional[pulumi.Input[
|
|
208
|
-
replication_factor: Optional[pulumi.Input[
|
|
426
|
+
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
|
|
427
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
428
|
+
partitions: Optional[pulumi.Input[_builtins.int]] = None,
|
|
429
|
+
replication_factor: Optional[pulumi.Input[_builtins.int]] = None,
|
|
209
430
|
__props__=None):
|
|
210
431
|
opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
|
|
211
432
|
if not isinstance(opts, pulumi.ResourceOptions):
|
|
@@ -233,10 +454,10 @@ class Topic(pulumi.CustomResource):
|
|
|
233
454
|
def get(resource_name: str,
|
|
234
455
|
id: pulumi.Input[str],
|
|
235
456
|
opts: Optional[pulumi.ResourceOptions] = None,
|
|
236
|
-
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[
|
|
237
|
-
name: Optional[pulumi.Input[
|
|
238
|
-
partitions: Optional[pulumi.Input[
|
|
239
|
-
replication_factor: Optional[pulumi.Input[
|
|
457
|
+
config: Optional[pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]]] = None,
|
|
458
|
+
name: Optional[pulumi.Input[_builtins.str]] = None,
|
|
459
|
+
partitions: Optional[pulumi.Input[_builtins.int]] = None,
|
|
460
|
+
replication_factor: Optional[pulumi.Input[_builtins.int]] = None) -> 'Topic':
|
|
240
461
|
"""
|
|
241
462
|
Get an existing Topic resource's state with the given name, id, and optional extra
|
|
242
463
|
properties used to qualify the lookup.
|
|
@@ -244,10 +465,10 @@ class Topic(pulumi.CustomResource):
|
|
|
244
465
|
:param str resource_name: The unique name of the resulting resource.
|
|
245
466
|
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
|
|
246
467
|
:param pulumi.ResourceOptions opts: Options for the resource.
|
|
247
|
-
:param pulumi.Input[Mapping[str, pulumi.Input[
|
|
248
|
-
:param pulumi.Input[
|
|
249
|
-
:param pulumi.Input[
|
|
250
|
-
:param pulumi.Input[
|
|
468
|
+
:param pulumi.Input[Mapping[str, pulumi.Input[_builtins.str]]] config: A map of string k/v attributes.
|
|
469
|
+
:param pulumi.Input[_builtins.str] name: The name of the topic.
|
|
470
|
+
:param pulumi.Input[_builtins.int] partitions: Number of partitions.
|
|
471
|
+
:param pulumi.Input[_builtins.int] replication_factor: Number of replicas.
|
|
251
472
|
"""
|
|
252
473
|
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
|
|
253
474
|
|
|
@@ -259,33 +480,33 @@ class Topic(pulumi.CustomResource):
|
|
|
259
480
|
__props__.__dict__["replication_factor"] = replication_factor
|
|
260
481
|
return Topic(resource_name, opts=opts, __props__=__props__)
|
|
261
482
|
|
|
262
|
-
@property
|
|
483
|
+
@_builtins.property
|
|
263
484
|
@pulumi.getter
|
|
264
|
-
def config(self) -> pulumi.Output[Optional[Mapping[str,
|
|
485
|
+
def config(self) -> pulumi.Output[Optional[Mapping[str, _builtins.str]]]:
|
|
265
486
|
"""
|
|
266
487
|
A map of string k/v attributes.
|
|
267
488
|
"""
|
|
268
489
|
return pulumi.get(self, "config")
|
|
269
490
|
|
|
270
|
-
@property
|
|
491
|
+
@_builtins.property
|
|
271
492
|
@pulumi.getter
|
|
272
|
-
def name(self) -> pulumi.Output[
|
|
493
|
+
def name(self) -> pulumi.Output[_builtins.str]:
|
|
273
494
|
"""
|
|
274
495
|
The name of the topic.
|
|
275
496
|
"""
|
|
276
497
|
return pulumi.get(self, "name")
|
|
277
498
|
|
|
278
|
-
@property
|
|
499
|
+
@_builtins.property
|
|
279
500
|
@pulumi.getter
|
|
280
|
-
def partitions(self) -> pulumi.Output[
|
|
501
|
+
def partitions(self) -> pulumi.Output[_builtins.int]:
|
|
281
502
|
"""
|
|
282
503
|
Number of partitions.
|
|
283
504
|
"""
|
|
284
505
|
return pulumi.get(self, "partitions")
|
|
285
506
|
|
|
286
|
-
@property
|
|
507
|
+
@_builtins.property
|
|
287
508
|
@pulumi.getter(name="replicationFactor")
|
|
288
|
-
def replication_factor(self) -> pulumi.Output[
|
|
509
|
+
def replication_factor(self) -> pulumi.Output[_builtins.int]:
|
|
289
510
|
"""
|
|
290
511
|
Number of replicas.
|
|
291
512
|
"""
|