A Terraform provider for managing Exasol database resources.
Please note that this is an open source project which is not officially supported by Exasol. We will try to help you as much as possible, but can't guarantee anything since this is not an official Exasol product.
- User management - Create and manage database users with various authentication methods
- Role management - Define and manage database roles
- Schema management - Create and configure database schemas with ownership control
- Connection management - Manage external connections (S3, FTP, JDBC, etc.)
- Privilege management - Four dedicated resources for clear privilege management:
exasol_system_privilege- System-level privileges (CREATE SESSION, CREATE TABLE, etc.)exasol_object_privilege- Object-level privileges (SELECT, INSERT, etc. on tables/schemas/views)exasol_role_grant- Grant roles to users or other rolesexasol_connection_grant- Grant connection access to users or roles
terraform {
required_providers {
exasol = {
source = "registry.terraform.io/exasol/terraform-provider-exasol"
version = "~> 0.1.1"
}
}
}Clone the repository and install the provider locally:
git clone https://github.com/exasol/terraform-provider-exasol.git
cd terraform-provider-exasol
make install-localConfigure your Terraform to use the local provider:
terraform {
required_providers {
exasol = {
source = "local/exasol/terraform-provider-exasol"
}
}
}provider "exasol" {
host = "localhost"
port = 8563
user = "sys"
password = "exasol"
}
resource "exasol_user" "example" {
name = "testuser"
auth_type = "PASSWORD"
password = "password123"
}
resource "exasol_role" "analyst" {
name = "ANALYST_ROLE"
}
# Schema with declarative ownership (NEW in v0.1.1)
resource "exasol_schema" "analytics" {
name = "ANALYTICS"
owner = exasol_role.analyst.name # Automatically transfers ownership
}
resource "exasol_connection" "s3" {
name = "MY_S3_BUCKET"
to = "https://my-bucket.s3.us-east-1.amazonaws.com"
user = "AWS_ACCESS_KEY"
password = "AWS_SECRET_KEY"
}
# Grant connection access (NEW in v0.1.1)
resource "exasol_connection_grant" "analyst_s3" {
connection_name = exasol_connection.s3.name
grantee = exasol_role.analyst.name
}
# Grant system privilege
resource "exasol_system_privilege" "create_session" {
grantee = exasol_user.example.name
privilege = "CREATE SESSION"
}
# Grant system privilege with admin option
resource "exasol_system_privilege" "use_any_schema" {
grantee = exasol_role.analyst.name
privilege = "USE ANY SCHEMA"
with_admin_option = true
}
# Grant multiple object privileges (can be a single privilege or list)
resource "exasol_object_privilege" "schema_access" {
grantee = exasol_role.analyst.name
privileges = ["USAGE", "SELECT"] # List of privileges
object_type = "SCHEMA"
object_name = exasol_schema.analytics.name
}
# Grant role to user
resource "exasol_role_grant" "user_role" {
role = exasol_role.analyst.name
grantee = exasol_user.example.name
}
# Grant role with admin option (allows grantee to grant role to others)
resource "exasol_role_grant" "user_role_admin" {
role = exasol_role.analyst.name
grantee = exasol_user.example.name
with_admin_option = true
}See the examples/ directory for complete examples of each resource type:
- examples/privileges/ - System privileges, object privileges, and role grants
- examples/connections/ - Various connection types (S3, FTP, JDBC, etc.)
- examples/basic/ - Basic resource usage
exasol_user- Manage database usersexasol_role- Manage database rolesexasol_schema- Manage database schemasexasol_connection- Manage external connectionsexasol_system_privilege- Grant system-level privilegesexasol_object_privilege- Grant object-level privilegesexasol_role_grant- Grant roles to users or other rolesexasol_connection_grant- Grant connection access to users or roles
Contributions are welcome! Please feel free to submit a Pull Request.
- Go 1.21+
- Terraform 1.0+
- Make
make buildmake testmake install-localSee LICENSE file for details.