Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Detect availibility of roles feature in MariaDB broken #109

Open
spawnia opened this issue Feb 7, 2020 · 0 comments · May be fixed by #110
Open

Detect availibility of roles feature in MariaDB broken #109

spawnia opened this issue Feb 7, 2020 · 0 comments · May be fixed by #110

Comments

@spawnia
Copy link

spawnia commented Feb 7, 2020

Terraform Version

Terraform v0.12.20 
+ provider.mysql v1.9.0

Affected Resource(s)

  • mysql-grant

Terraform Configuration Files

provider "mysql" { 
  endpoint = "localhost:3306" 
  username = "root" 
  password = "" 
} 

resource "mysql_database" "test" { 
  name = "test" 
} 

resource "mysql_role" "developer" { 
  name = "developer" 
} 

resource "mysql_grant" "developer_priviliges" { 
  role       = mysql_role.developer.name
  database   = "test" 
  privileges = ["SELECT", "INSERT", "UPDATE", "DELETE"] 
} 

resource "mysql_grant" "user_to_roles" { 
  database = "test" 
  user     = "foo"
  host     = "%"
  roles    = [mysql_role.developer.name] 
}

Expected Behavior

Since MariaDB supports roles from version 10.0.5 onwards, the requested roles and grants should be created.

Actual Behavior

Error: Roles are only supported on MySQL 8 and above 

  on main.tf line 40, in resource "mysql_grant" "developer_priviliges": 
  40: resource "mysql_grant" "developer_priviliges" {

Steps to Reproduce

  1. Point the given config to a MariaDB instance that supports roles (version >= 10.0.5)
  2. terraform apply

References

@spawnia spawnia linked a pull request Feb 7, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant