Skip to content

Commit

Permalink
Kafka topic + user ACL management doc fixes (#1082)
Browse files Browse the repository at this point in the history
* Kafka topic + user management fixes

- Address minimum min_insync_replicas for topic advanced config
- Address deprecated kafka plan
- Update documentation

* update from deprecated plan for testing
  • Loading branch information
dweinshenker committed Nov 21, 2023
1 parent a6c3d48 commit 3fb1776
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion digitalocean/database/resource_database_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ resource "digitalocean_database_cluster" "foobar" {
name = "%s"
engine = "kafka"
version = "%s"
size = "db-s-1vcpu-2gb"
size = "db-s-2vcpu-2gb"
region = "nyc1"
node_count = 3
tags = ["production"]
Expand Down
2 changes: 1 addition & 1 deletion digitalocean/database/resource_database_kafka_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ func ResourceDigitalOceanDatabaseKafkaTopic() *schema.Resource {
},
"min_insync_replicas": {
Type: schema.TypeInt,
Default: 1,
Optional: true,
Computed: true,
ValidateFunc: validation.IntAtLeast(1),
},
"preallocate": {
Expand Down
2 changes: 2 additions & 0 deletions digitalocean/database/resource_database_kafka_topic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func TestAccDigitalOceanDatabaseKafkaTopic(t *testing.T) {
"digitalocean_database_kafka_topic.foobar", "config.0.min_compaction_lag_ms"),
resource.TestCheckResourceAttrSet(
"digitalocean_database_kafka_topic.foobar", "config.0.min_insync_replicas"),
resource.TestCheckResourceAttr(
"digitalocean_database_kafka_topic.foobar", "config.0.min_insync_replicas", "1"),
resource.TestCheckResourceAttrSet(
"digitalocean_database_kafka_topic.foobar", "config.0.retention_bytes"),
resource.TestCheckResourceAttrSet(
Expand Down
2 changes: 1 addition & 1 deletion digitalocean/database/resource_database_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ resource "digitalocean_database_cluster" "foobar" {
name = "%s"
engine = "kafka"
version = "3.5"
size = "db-s-1vcpu-2gb"
size = "db-s-2vcpu-2gb"
region = "nyc1"
node_count = 3
}
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/database_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "digitalocean_database_cluster" "kafka-example" {
name = "example-kafka-cluster"
engine = "kafka"
version = "3.5"
size = "db-s-1vcpu-2gb"
size = "db-s-2vcpu-2gb"
region = "nyc1"
node_count = 3
}
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/database_kafka_topic.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ resource "digitalocean_database_cluster" "kafka-example" {
name = "example-kafka-cluster"
engine = "kafka"
version = "3.5"
size = "db-s-1vcpu-2gb"
size = "db-s-2vcpu-2gb"
region = "nyc1"
node_count = 3
tags = ["production"]
Expand Down Expand Up @@ -82,7 +82,7 @@ The following arguments are supported:
* `message_timestamp_difference_max_ms` - (Optional) The maximum difference, in ms, between the timestamp specific in a message and when the broker receives the message.
* `message_timestamp_type` - (Optional) Specifies which timestamp to use for the message. This may be one of "create_time" or "log_append_time".
* `min_cleanable_dirty_ratio` - (Optional) A scale between 0.0 and 1.0 which controls the frequency of the compactor. Larger values mean more frequent compactions. This is often paired with `max_compaction_lag_ms` to control the compactor frequency.
* `min_insync_replicas` - (Optional) The number of replicas that must acknowledge a write before it is considered successful. -1 is a special setting to indicate that all nodes must ack a message before a write is considered successful.
* `min_insync_replicas` - (Optional) The number of replicas that must acknowledge a write before it is considered successful. -1 is a special setting to indicate that all nodes must ack a message before a write is considered successful. Default is 1, indicating at least 1 replica must acknowledge a write to be considered successful.
* `preallocate` - (Optional) Determines whether to preallocate a file on disk when creating a new log segment within a topic.
* `retention_bytes` - (Optional) The maximum size, in bytes, of a topic before messages are deleted. -1 is a special setting indicating that this setting has no limit.
* `retention_ms` - (Optional) The maximum time, in ms, that a topic log file is retained before deleting it. -1 is a special setting indicating that this setting has no limit.
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/database_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource "digitalocean_database_cluster" "kafka-example" {
name = "example-kafka-cluster"
engine = "kafka"
version = "3.5"
size = "db-s-1vcpu-2gb"
size = "db-s-2vcpu-2gb"
region = "nyc1"
node_count = 3
}
Expand Down Expand Up @@ -103,7 +103,7 @@ The `settings` block is documented below.

An individual ACL includes the following:

* `topic` - (Required) A regex for matching the topic(s) that this ACL should apply to.
* `topic` - (Required) A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "*", "<prefix>*", or "<literal>". "*" is a special value indicating a wildcard that matches on all topics. "<prefix>*" defines a regex that matches all topics with the prefix. "<literal>" performs an exact match on a topic name and only applies to that topic.
* `permission` - (Required) The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.

## Attributes Reference
Expand Down

0 comments on commit 3fb1776

Please sign in to comment.