Skip to content

Commit

Permalink
Document self-hosted Materialize authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Nov 28, 2024
1 parent ba988d7 commit 08b1efa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 89 deletions.
10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ provider "materialize" {
password = var.materialize_password # optionally use MZ_PASSWORD env var
default_region = "aws/us-east-1" # optionally use MZ_REGION env var
}
# Self-hosted Materialize authentication
provider "materialize" {
host = "materialized" # optionally use MZ_HOST env var
port = 6877 # optionally use MZ_PORT env var
username = "mz_system" # optionally use MZ_USER env var
database = "materialize" # optionally use MZ_DATABASE env var
password = "" # optionally use MZ_PASSWORD env var
sslmode = "disable" # optionally use MZ_SSLMODE env var
}
```

## Schema
Expand Down
10 changes: 10 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@ provider "materialize" {
password = var.materialize_password # optionally use MZ_PASSWORD env var
default_region = "aws/us-east-1" # optionally use MZ_REGION env var
}

# Self-hosted Materialize authentication
provider "materialize" {
host = "materialized" # optionally use MZ_HOST env var
port = 6877 # optionally use MZ_PORT env var
username = "mz_system" # optionally use MZ_USER env var
database = "materialize" # optionally use MZ_DATABASE env var
password = "" # optionally use MZ_PASSWORD env var
sslmode = "disable" # optionally use MZ_SSLMODE env var
}
89 changes: 0 additions & 89 deletions integration/self_hosted/connection.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,49 +109,6 @@ resource "materialize_connection_kafka" "kafka_conn_multiple_brokers" {
validate = false
}

resource "materialize_connection_kafka" "kafka_top_level_privatelink" {
name = "kafka_top_level_privatelink"
# The Privatelink connection is created during the docker compose setup
# As if you were to drop the privatelink connection, the container would crash
aws_privatelink {
privatelink_connection {
name = "privatelink_conn"
database_name = "materialize"
schema_name = "public"
}
privatelink_connection_port = 9092
}

security_protocol = "SASL_SSL"
sasl_mechanisms = "SCRAM-SHA-256"

sasl_username {
text = "sasl_username"
}

sasl_password {
name = materialize_secret.kafka_password.name
database_name = materialize_secret.kafka_password.database_name
schema_name = materialize_secret.kafka_password.schema_name
}

ssl_certificate {
text = "ssl_certificate_content"
}

ssl_key {
name = materialize_secret.kafka_password.name
database_name = materialize_secret.kafka_password.database_name
schema_name = materialize_secret.kafka_password.schema_name
}

ssl_certificate_authority {
text = "ssl_ca_content"
}

validate = false
}

resource "materialize_connection_confluent_schema_registry" "schema_registry" {
name = "schema_registry_connection"
comment = "connection schema registry comment"
Expand All @@ -176,29 +133,6 @@ resource "materialize_connection_confluent_schema_registry" "csr_with_basic_auth
validate = false
}

resource "materialize_connection_confluent_schema_registry" "csr_with_aws_privatelink" {
name = "csr_with_aws_privatelink"
url = "http://redpanda:8081"

username {
text = "username"
}

password {
name = materialize_secret.kafka_password.name
database_name = materialize_secret.kafka_password.database_name
schema_name = materialize_secret.kafka_password.schema_name
}

aws_privatelink {
name = "privatelink_conn"
database_name = "materialize"
schema_name = "public"
}

validate = false
}

resource "materialize_connection_confluent_schema_registry" "schema_registry_basic_auth_ssl" {
name = "schema_registry_basic_auth_ssl"
url = "http://redpanda:8081"
Expand Down Expand Up @@ -382,29 +316,6 @@ resource "materialize_connection_mysql" "mysql_connection" {
}
}

resource "materialize_connection_mysql" "mysql_connection_aws_pl" {
name = "mysql_connection_aws_pl"
comment = "connection mysql comment with aws privatelink"

host = "mysql"
port = 3306
user {
text = "repluser"
}
password {
name = materialize_secret.mysql_password.name
database_name = materialize_secret.mysql_password.database_name
schema_name = materialize_secret.mysql_password.schema_name
}

aws_privatelink {
name = "privatelink_conn"
database_name = "materialize"
schema_name = "public"
}
validate = false
}

resource "materialize_connection_mysql" "mysql_connection_with_secret" {
name = "mysql-connection-with-secret"
host = "mysql"
Expand Down

0 comments on commit 08b1efa

Please sign in to comment.