diff --git a/docs/data-sources/stream_connection.md b/docs/data-sources/stream_connection.md index f727782040..ba7a1753dc 100644 --- a/docs/data-sources/stream_connection.md +++ b/docs/data-sources/stream_connection.md @@ -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: @@ -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 diff --git a/docs/data-sources/stream_connections.md b/docs/data-sources/stream_connections.md index a2c036810b..03f02408e6 100644 --- a/docs/data-sources/stream_connections.md +++ b/docs/data-sources/stream_connections.md @@ -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:: @@ -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 diff --git a/docs/data-sources/stream_processor.md b/docs/data-sources/stream_processor.md index 0f96560418..bb9342183b 100644 --- a/docs/data-sources/stream_processor.md +++ b/docs/data-sources/stream_processor.md @@ -47,7 +47,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" { "auto.offset.reset" : "earliest" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } } diff --git a/docs/data-sources/stream_processors.md b/docs/data-sources/stream_processors.md index 4c10061989..310443c2c6 100644 --- a/docs/data-sources/stream_processors.md +++ b/docs/data-sources/stream_processors.md @@ -47,7 +47,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" { "auto.offset.reset" : "earliest" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } } diff --git a/docs/resources/stream_connection.md b/docs/resources/stream_connection.md index 52e41cd156..0e0fe28962 100644 --- a/docs/resources/stream_connection.md +++ b/docs/resources/stream_connection.md @@ -19,7 +19,7 @@ resource "mongodbatlas_stream_connection" "test" { } ``` -### Example Kafka Plaintext Connection +### Example Kafka SASL Plaintext Connection ```terraform resource "mongodbatlas_stream_connection" "test" { @@ -33,7 +33,7 @@ resource "mongodbatlas_stream_connection" "test" { password = "somepassword" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } config = { "auto.offset.reset": "latest" @@ -42,7 +42,7 @@ resource "mongodbatlas_stream_connection" "test" { } ``` -### Example Kafka SSL Connection +### Example Kafka SASL SSL Connection ```terraform resource "mongodbatlas_stream_connection" "test" { @@ -56,7 +56,7 @@ resource "mongodbatlas_stream_connection" "test" { password = "somepassword" } security = { - protocol = "SSL" + protocol = "SASL_SSL" broker_public_certificate = "-----BEGIN CERTIFICATE----------END CERTIFICATE-----" } config = { @@ -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: @@ -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 diff --git a/docs/resources/stream_processor.md b/docs/resources/stream_processor.md index 49d54d4659..ec3d96fec6 100644 --- a/docs/resources/stream_processor.md +++ b/docs/resources/stream_processor.md @@ -53,7 +53,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" { "auto.offset.reset" : "earliest" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } } diff --git a/examples/mongodbatlas_stream_connection/main.tf b/examples/mongodbatlas_stream_connection/main.tf index c6e2eb413c..46324b82fc 100644 --- a/examples/mongodbatlas_stream_connection/main.tf +++ b/examples/mongodbatlas_stream_connection/main.tf @@ -34,7 +34,7 @@ resource "mongodbatlas_stream_connection" "example-kafka-plaintext" { "auto.offset.reset" : "earliest" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } networking = { access = { @@ -59,7 +59,7 @@ resource "mongodbatlas_stream_connection" "example-kafka-ssl" { } security = { broker_public_certificate = var.kafka_ssl_cert - protocol = "SSL" + protocol = "SASL_SSL" } } diff --git a/examples/mongodbatlas_stream_connection/variables.tf b/examples/mongodbatlas_stream_connection/variables.tf index caf409d7fa..df7b8dd39d 100644 --- a/examples/mongodbatlas_stream_connection/variables.tf +++ b/examples/mongodbatlas_stream_connection/variables.tf @@ -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 } diff --git a/examples/mongodbatlas_stream_processor/main.tf b/examples/mongodbatlas_stream_processor/main.tf index 4da83240d3..d6d4cf0179 100644 --- a/examples/mongodbatlas_stream_processor/main.tf +++ b/examples/mongodbatlas_stream_processor/main.tf @@ -41,7 +41,7 @@ resource "mongodbatlas_stream_connection" "example-kafka" { "auto.offset.reset" : "earliest" } security = { - protocol = "PLAINTEXT" + protocol = "SASL_PLAINTEXT" } } diff --git a/internal/service/streamconnection/model_stream_connection_test.go b/internal/service/streamconnection/model_stream_connection_test.go index d3e1180f44..ec4891c925 100644 --- a/internal/service/streamconnection/model_stream_connection_test.go +++ b/internal/service/streamconnection/model_stream_connection_test.go @@ -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" diff --git a/internal/service/streamconnection/resource_stream_connection_test.go b/internal/service/streamconnection/resource_stream_connection_test.go index 9b1ab01384..3250192d9f 100644 --- a/internal/service/streamconnection/resource_stream_connection_test.go +++ b/internal/service/streamconnection/resource_stream_connection_test.go @@ -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(` @@ -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"), ) } diff --git a/internal/service/streamprocessor/resource_test.go b/internal/service/streamprocessor/resource_test.go index aedebb6652..5f892fe807 100644 --- a/internal/service/streamprocessor/resource_test.go +++ b/internal/service/streamprocessor/resource_test.go @@ -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] }