Skip to content

doc: Referenced correct stream security protocol #3304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/data-sources/stream_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If `type` is of value `Kafka` the following additional attributes are defined:
* `authentication` - User credentials required to connect to a Kafka cluster. Includes the authentication type, as well as the parameters for that authentication mode. See [authentication](#authentication).
* `bootstrap_servers` - Comma separated list of server addresses.
* `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters.
* `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security).
* `security` - Properties for the secure transport connection to Kafka. For SASL_SSL, this can include the trusted certificate to use. See [security](#security).
* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking).

If `type` is of value `AWSLambda` the following additional attributes are defined:
Expand All @@ -49,7 +49,7 @@ If `type` is of value `Https` the following additional attributes are defined:
### Security

* `broker_public_certificate` - A trusted, public x509 certificate for connecting to Kafka over SSL. String value of the certificate must be defined in the attribute.
* `protocol` - Describes the transport type. Can be either `PLAINTEXT` or `SSL`.
* `protocol` - Describes the transport type. Can be either `SASL_PLAINTEXT` or `SASL_SSL`.

### DBRoleToExecute

Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/stream_connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If `type` is of value `Kafka` the following additional attributes are defined:
* `authentication` - User credentials required to connect to a Kafka cluster. Includes the authentication type, as well as the parameters for that authentication mode. See [authentication](#authentication).
* `bootstrap_servers` - Comma separated list of server addresses.
* `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters.
* `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security).
* `security` - Properties for the secure transport connection to Kafka. For SASL_SSL, this can include the trusted certificate to use. See [security](#security).
* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking).

If `type` is of value `AWSLambda` the following additional attributes are defined::
Expand All @@ -61,7 +61,7 @@ If `type` is of value `Https` the following additional attributes are defined:
### Security

* `broker_public_certificate` - A trusted, public x509 certificate for connecting to Kafka over SSL. String value of the certificate must be defined in the attribute.
* `protocol` - Describes the transport type. Can be either `PLAINTEXT` or `SSL`.
* `protocol` - Describes the transport type. Can be either `SASL_PLAINTEXT` or `SASL_SSL`.

### DBRoleToExecute

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/stream_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/stream_processors.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
}

Expand Down
12 changes: 6 additions & 6 deletions docs/resources/stream_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "mongodbatlas_stream_connection" "test" {
}
```

### Example Kafka Plaintext Connection
### Example Kafka SASL Plaintext Connection

```terraform
resource "mongodbatlas_stream_connection" "test" {
Expand All @@ -33,7 +33,7 @@ resource "mongodbatlas_stream_connection" "test" {
password = "somepassword"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
config = {
"auto.offset.reset": "latest"
Expand All @@ -42,7 +42,7 @@ resource "mongodbatlas_stream_connection" "test" {
}
```

### Example Kafka SSL Connection
### Example Kafka SASL SSL Connection

```terraform
resource "mongodbatlas_stream_connection" "test" {
Expand All @@ -56,7 +56,7 @@ resource "mongodbatlas_stream_connection" "test" {
password = "somepassword"
}
security = {
protocol = "SSL"
protocol = "SASL_SSL"
broker_public_certificate = "-----BEGIN CERTIFICATE-----<CONTENT>-----END CERTIFICATE-----"
}
config = {
Expand Down Expand Up @@ -112,7 +112,7 @@ If `type` is of value `Kafka` the following additional arguments are defined:
* `authentication` - User credentials required to connect to a Kafka cluster. Includes the authentication type, as well as the parameters for that authentication mode. See [authentication](#authentication).
* `bootstrap_servers` - Comma separated list of server addresses.
* `config` - A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters.
* `security` - Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. See [security](#security).
* `security` - Properties for the secure transport connection to Kafka. For SASL_SSL, this can include the trusted certificate to use. See [security](#security).
* `networking` - Networking Access Type can either be `PUBLIC` (default) or `VPC`. See [networking](#networking).

If `type` is of value `AWSLambda` the following additional arguments are defined:
Expand All @@ -131,7 +131,7 @@ If `type` is of value `Https` the following additional attributes are defined:
### Security

* `broker_public_certificate` - A trusted, public x509 certificate for connecting to Kafka over SSL. String value of the certificate must be defined in the attribute.
* `protocol` - Describes the transport type. Can be either `PLAINTEXT` or `SSL`.
* `protocol` - Describes the transport type. Can be either `SASL_PLAINTEXT` or `SASL_SSL`.

### DBRoleToExecute

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/stream_processor.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
}

Expand Down
4 changes: 2 additions & 2 deletions examples/mongodbatlas_stream_connection/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "mongodbatlas_stream_connection" "example-kafka-plaintext" {
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
networking = {
access = {
Expand All @@ -59,7 +59,7 @@ resource "mongodbatlas_stream_connection" "example-kafka-ssl" {
}
security = {
broker_public_certificate = var.kafka_ssl_cert
protocol = "SSL"
protocol = "SASL_SSL"
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/mongodbatlas_stream_connection/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ variable "kafka_password" {
}

variable "kafka_ssl_cert" {
description = "Public certificate used for SSL configuration to connect to your Kafka cluster"
description = "Public certificate used for SASL_SSL configuration to connect to your Kafka cluster"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion examples/mongodbatlas_stream_processor/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" {
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
instanceName = "InstanceName"
authMechanism = "PLAIN"
authUsername = "user1"
securityProtocol = "SSL"
securityProtocol = "SASL_SSL"
bootstrapServers = "localhost:9092,another.host:9092"
dbRole = "customRole"
dbRoleType = "CUSTOM"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@ func configureKafka(projectID, instanceName, username, password, bootstrapServer
projectAndStreamInstanceConfig := acc.StreamInstanceConfig(projectID, instanceName, "VIRGINIA_USA", "AWS")
securityConfig := `
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}`

if useSSL {
securityConfig = fmt.Sprintf(`
security = {
broker_public_certificate = %q
protocol = "SSL"
protocol = "SASL_SSL"
}`, DummyCACert)
}
return fmt.Sprintf(`
Expand Down Expand Up @@ -408,10 +408,10 @@ func checkKafkaAttributes(
resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "authentication.password", password))
}
if !usesSSL {
resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "security.protocol", "PLAINTEXT"))
resourceChecks = append(resourceChecks, resource.TestCheckResourceAttr(resourceName, "security.protocol", "SASL_PLAINTEXT"))
} else {
resourceChecks = append(resourceChecks,
resource.TestCheckResourceAttr(resourceName, "security.protocol", "SSL"),
resource.TestCheckResourceAttr(resourceName, "security.protocol", "SASL_SSL"),
resource.TestCheckResourceAttrSet(resourceName, "security.broker_public_certificate"),
)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/streamprocessor/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ func configConnection(t *testing.T, projectID string, config connectionConfig) (
"auto.offset.reset" : "earliest"
}
security = {
protocol = "PLAINTEXT"
protocol = "SASL_PLAINTEXT"
}
depends_on = [mongodbatlas_stream_instance.instance]
}
Expand Down
Loading