-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support self-hosted instances #674
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code mostly looks good to me. Just one question and nitpick.
Type: schema.TypeInt, | ||
Optional: true, | ||
Description: "The Materialize port. Can also come from the `MZ_PORT` environment variable.", | ||
DefaultFunc: schema.EnvDefaultFunc("MZ_PORT", 6875), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For self-hosted, do we want to point at the external SQL address, or the internal one? The external one doesn't allow login as mz_system
, and other users have limited permissions.
Also, nitpick, it might be good to name this in a way that is clearly a SQL port, as we also have HTTP(S) ports.
1ad036f
to
eb7d6b7
Compare
@@ -0,0 +1,66 @@ | |||
resource "materialize_cluster" "cluster" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The large number of line changes in this PR is due to all of the files in the integration/self_hosted
directory. Those are just standard tests. If reviewing this PR, focus on the changes in the pkg
directory.
727585e
to
08b1efa
Compare
func providerConfigure(ctx context.Context, d *schema.ResourceData, version string) (interface{}, diag.Diagnostics) { | ||
// Check for self-hosted configuration | ||
if host := d.Get("host").(string); host != "" { | ||
log.Printf("[DEBUG] Configuring self-hosted provider") | ||
return configureSelfHosted(ctx, d, version) | ||
} | ||
log.Printf("[DEBUG] Configuring SaaS provider") | ||
return configureSaaS(ctx, d, version) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we determine if we should use the self-hosted authentication flow or the SaaS authentication flow.
08b1efa
to
b5e676d
Compare
b5e676d
to
f56bf5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the back and forth on the port and user. 6875 and materialize was wrong initially, but I think correct now.
9e167b1
to
4add410
Compare
provider "materialize" { | ||
host = "materialized" | ||
port = 6877 | ||
database = "materialize" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for the internal integration tests which are using the Docker emulator. It allows me to test some resources that the materialize
user does not have the rights to, like setting system parameters for example:
resource "materialize_system_parameter" "default_cluster" {
name = "max_tables"
value = "2000"
}
This will not be exposed to the end users and the orchestratord.
87a8b5a
to
4add410
Compare
Co-authored-by: alex-hunt-materialize <[email protected]>
4add410
to
1ed1729
Compare
Now users can configure the provider like this: