mysql.Grant
Explore with Pulumi AI
The mysql.Grant
resource creates and manages privileges given to
a user on a MySQL server.
Examples
Granting Privileges to a User
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const jdoeUser = new mysql.User("jdoeUser", {
host: "example.com",
plaintextPassword: "password",
user: "jdoe",
});
const jdoeGrant = new mysql.Grant("jdoeGrant", {
database: "app",
host: jdoeUser.host,
privileges: [
"SELECT",
"UPDATE",
],
user: jdoeUser.user,
});
import pulumi
import pulumi_mysql as mysql
jdoe_user = mysql.User("jdoeUser",
host="example.com",
plaintext_password="password",
user="jdoe")
jdoe_grant = mysql.Grant("jdoeGrant",
database="app",
host=jdoe_user.host,
privileges=[
"SELECT",
"UPDATE",
],
user=jdoe_user.user)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var jdoeUser = new MySql.User("jdoeUser", new()
{
Host = "example.com",
PlaintextPassword = "password",
UserName = "jdoe",
});
var jdoeGrant = new MySql.Grant("jdoeGrant", new()
{
Database = "app",
Host = jdoeUser.Host,
Privileges = new[]
{
"SELECT",
"UPDATE",
},
User = jdoeUser.UserName,
});
});
package main
import (
"github.com/pulumi/pulumi-mysql/sdk/v3/go/mysql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
jdoeUser, err := mysql.NewUser(ctx, "jdoeUser", &mysql.UserArgs{
Host: pulumi.String("example.com"),
PlaintextPassword: pulumi.String("password"),
User: pulumi.String("jdoe"),
})
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "jdoeGrant", &mysql.GrantArgs{
Database: pulumi.String("app"),
Host: jdoeUser.Host,
Privileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("UPDATE"),
},
User: jdoeUser.User,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mysql.User;
import com.pulumi.mysql.UserArgs;
import com.pulumi.mysql.Grant;
import com.pulumi.mysql.GrantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var jdoeUser = new User("jdoeUser", UserArgs.builder()
.host("example.com")
.plaintextPassword("password")
.user("jdoe")
.build());
var jdoeGrant = new Grant("jdoeGrant", GrantArgs.builder()
.database("app")
.host(jdoeUser.host())
.privileges(
"SELECT",
"UPDATE")
.user(jdoeUser.user())
.build());
}
}
resources:
jdoeUser:
type: mysql:User
properties:
host: example.com
plaintextPassword: password
user: jdoe
jdoeGrant:
type: mysql:Grant
properties:
database: app
host: ${jdoeUser.host}
privileges:
- SELECT
- UPDATE
user: ${jdoeUser.user}
Granting Privileges to a Role
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const developerRole = new mysql.Role("developerRole", {});
const developerGrant = new mysql.Grant("developerGrant", {
database: "app",
privileges: [
"SELECT",
"UPDATE",
],
role: developerRole.name,
});
import pulumi
import pulumi_mysql as mysql
developer_role = mysql.Role("developerRole")
developer_grant = mysql.Grant("developerGrant",
database="app",
privileges=[
"SELECT",
"UPDATE",
],
role=developer_role.name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var developerRole = new MySql.Role("developerRole");
var developerGrant = new MySql.Grant("developerGrant", new()
{
Database = "app",
Privileges = new[]
{
"SELECT",
"UPDATE",
},
Role = developerRole.Name,
});
});
package main
import (
"github.com/pulumi/pulumi-mysql/sdk/v3/go/mysql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
developerRole, err := mysql.NewRole(ctx, "developerRole", nil)
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "developerGrant", &mysql.GrantArgs{
Database: pulumi.String("app"),
Privileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("UPDATE"),
},
Role: developerRole.Name,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mysql.Role;
import com.pulumi.mysql.Grant;
import com.pulumi.mysql.GrantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var developerRole = new Role("developerRole");
var developerGrant = new Grant("developerGrant", GrantArgs.builder()
.database("app")
.privileges(
"SELECT",
"UPDATE")
.role(developerRole.name())
.build());
}
}
resources:
developerRole:
type: mysql:Role
developerGrant:
type: mysql:Grant
properties:
database: app
privileges:
- SELECT
- UPDATE
role: ${developerRole.name}
Adding a Role to a User
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const jdoe = new mysql.User("jdoe", {
host: "example.com",
plaintextPassword: "password",
user: "jdoe",
});
const developerRole = new mysql.Role("developerRole", {});
const developerGrant = new mysql.Grant("developerGrant", {
database: "app",
host: jdoe.host,
roles: [developerRole.name],
user: jdoe.user,
});
import pulumi
import pulumi_mysql as mysql
jdoe = mysql.User("jdoe",
host="example.com",
plaintext_password="password",
user="jdoe")
developer_role = mysql.Role("developerRole")
developer_grant = mysql.Grant("developerGrant",
database="app",
host=jdoe.host,
roles=[developer_role.name],
user=jdoe.user)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var jdoe = new MySql.User("jdoe", new()
{
Host = "example.com",
PlaintextPassword = "password",
UserName = "jdoe",
});
var developerRole = new MySql.Role("developerRole");
var developerGrant = new MySql.Grant("developerGrant", new()
{
Database = "app",
Host = jdoe.Host,
Roles = new[]
{
developerRole.Name,
},
User = jdoe.UserName,
});
});
package main
import (
"github.com/pulumi/pulumi-mysql/sdk/v3/go/mysql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
jdoe, err := mysql.NewUser(ctx, "jdoe", &mysql.UserArgs{
Host: pulumi.String("example.com"),
PlaintextPassword: pulumi.String("password"),
User: pulumi.String("jdoe"),
})
if err != nil {
return err
}
developerRole, err := mysql.NewRole(ctx, "developerRole", nil)
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "developerGrant", &mysql.GrantArgs{
Database: pulumi.String("app"),
Host: jdoe.Host,
Roles: pulumi.StringArray{
developerRole.Name,
},
User: jdoe.User,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mysql.User;
import com.pulumi.mysql.UserArgs;
import com.pulumi.mysql.Role;
import com.pulumi.mysql.Grant;
import com.pulumi.mysql.GrantArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var jdoe = new User("jdoe", UserArgs.builder()
.host("example.com")
.plaintextPassword("password")
.user("jdoe")
.build());
var developerRole = new Role("developerRole");
var developerGrant = new Grant("developerGrant", GrantArgs.builder()
.database("app")
.host(jdoe.host())
.roles(developerRole.name())
.user(jdoe.user())
.build());
}
}
resources:
jdoe:
type: mysql:User
properties:
host: example.com
plaintextPassword: password
user: jdoe
developerRole:
type: mysql:Role
developerGrant:
type: mysql:Grant
properties:
database: app
host: ${jdoe.host}
roles:
- ${developerRole.name}
user: ${jdoe.user}
Create Grant Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Grant(name: string, args: GrantArgs, opts?: CustomResourceOptions);
@overload
def Grant(resource_name: str,
args: GrantArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Grant(resource_name: str,
opts: Optional[ResourceOptions] = None,
database: Optional[str] = None,
grant: Optional[bool] = None,
host: Optional[str] = None,
privileges: Optional[Sequence[str]] = None,
role: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
table: Optional[str] = None,
tls_option: Optional[str] = None,
user: Optional[str] = None)
func NewGrant(ctx *Context, name string, args GrantArgs, opts ...ResourceOption) (*Grant, error)
public Grant(string name, GrantArgs args, CustomResourceOptions? opts = null)
type: mysql:Grant
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GrantArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GrantArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GrantArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GrantArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Example
The following reference example uses placeholder values for all input properties.
var grantResource = new MySql.Grant("grantResource", new()
{
Database = "string",
GrantName = false,
Host = "string",
Privileges = new[]
{
"string",
},
Role = "string",
Roles = new[]
{
"string",
},
Table = "string",
TlsOption = "string",
User = "string",
});
example, err := mysql.NewGrant(ctx, "grantResource", &mysql.GrantArgs{
Database: pulumi.String("string"),
Grant: pulumi.Bool(false),
Host: pulumi.String("string"),
Privileges: pulumi.StringArray{
pulumi.String("string"),
},
Role: pulumi.String("string"),
Roles: pulumi.StringArray{
pulumi.String("string"),
},
Table: pulumi.String("string"),
TlsOption: pulumi.String("string"),
User: pulumi.String("string"),
})
var grantResource = new Grant("grantResource", GrantArgs.builder()
.database("string")
.grant(false)
.host("string")
.privileges("string")
.role("string")
.roles("string")
.table("string")
.tlsOption("string")
.user("string")
.build());
grant_resource = mysql.Grant("grantResource",
database="string",
grant=False,
host="string",
privileges=["string"],
role="string",
roles=["string"],
table="string",
tls_option="string",
user="string")
const grantResource = new mysql.Grant("grantResource", {
database: "string",
grant: false,
host: "string",
privileges: ["string"],
role: "string",
roles: ["string"],
table: "string",
tlsOption: "string",
user: "string",
});
type: mysql:Grant
properties:
database: string
grant: false
host: string
privileges:
- string
role: string
roles:
- string
table: string
tlsOption: string
user: string
Grant Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Grant resource accepts the following input properties:
- Database string
- The database to grant privileges on.
- Grant
Name bool - Whether to also give the user privileges to grant the same privileges to other users.
- Host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - Privileges List<string>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - Role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - Roles List<string>
- A list of rols to grant to the user. Conflicts with
privileges
. - Table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - Tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - User string
- The name of the user. Conflicts with
role
.
- Database string
- The database to grant privileges on.
- Grant bool
- Whether to also give the user privileges to grant the same privileges to other users.
- Host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - Privileges []string
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - Role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - Roles []string
- A list of rols to grant to the user. Conflicts with
privileges
. - Table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - Tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - User string
- The name of the user. Conflicts with
role
.
- database String
- The database to grant privileges on.
- grant Boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host String
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges List<String>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role String
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles List<String>
- A list of rols to grant to the user. Conflicts with
privileges
. - table String
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option String - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user String
- The name of the user. Conflicts with
role
.
- database string
- The database to grant privileges on.
- grant boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges string[]
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles string[]
- A list of rols to grant to the user. Conflicts with
privileges
. - table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user string
- The name of the user. Conflicts with
role
.
- database str
- The database to grant privileges on.
- grant bool
- Whether to also give the user privileges to grant the same privileges to other users.
- host str
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges Sequence[str]
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role str
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles Sequence[str]
- A list of rols to grant to the user. Conflicts with
privileges
. - table str
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls_
option str - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user str
- The name of the user. Conflicts with
role
.
- database String
- The database to grant privileges on.
- grant Boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host String
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges List<String>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role String
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles List<String>
- A list of rols to grant to the user. Conflicts with
privileges
. - table String
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option String - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user String
- The name of the user. Conflicts with
role
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Grant resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Grant Resource
Get an existing Grant resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GrantState, opts?: CustomResourceOptions): Grant
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
database: Optional[str] = None,
grant: Optional[bool] = None,
host: Optional[str] = None,
privileges: Optional[Sequence[str]] = None,
role: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
table: Optional[str] = None,
tls_option: Optional[str] = None,
user: Optional[str] = None) -> Grant
func GetGrant(ctx *Context, name string, id IDInput, state *GrantState, opts ...ResourceOption) (*Grant, error)
public static Grant Get(string name, Input<string> id, GrantState? state, CustomResourceOptions? opts = null)
public static Grant get(String name, Output<String> id, GrantState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Database string
- The database to grant privileges on.
- Grant
Name bool - Whether to also give the user privileges to grant the same privileges to other users.
- Host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - Privileges List<string>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - Role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - Roles List<string>
- A list of rols to grant to the user. Conflicts with
privileges
. - Table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - Tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - User string
- The name of the user. Conflicts with
role
.
- Database string
- The database to grant privileges on.
- Grant bool
- Whether to also give the user privileges to grant the same privileges to other users.
- Host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - Privileges []string
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - Role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - Roles []string
- A list of rols to grant to the user. Conflicts with
privileges
. - Table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - Tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - User string
- The name of the user. Conflicts with
role
.
- database String
- The database to grant privileges on.
- grant Boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host String
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges List<String>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role String
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles List<String>
- A list of rols to grant to the user. Conflicts with
privileges
. - table String
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option String - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user String
- The name of the user. Conflicts with
role
.
- database string
- The database to grant privileges on.
- grant boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host string
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges string[]
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role string
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles string[]
- A list of rols to grant to the user. Conflicts with
privileges
. - table string
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option string - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user string
- The name of the user. Conflicts with
role
.
- database str
- The database to grant privileges on.
- grant bool
- Whether to also give the user privileges to grant the same privileges to other users.
- host str
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges Sequence[str]
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role str
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles Sequence[str]
- A list of rols to grant to the user. Conflicts with
privileges
. - table str
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls_
option str - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user str
- The name of the user. Conflicts with
role
.
- database String
- The database to grant privileges on.
- grant Boolean
- Whether to also give the user privileges to grant the same privileges to other users.
- host String
- The source host of the user. Defaults to "localhost". Conflicts with
role
. - privileges List<String>
- A list of privileges to grant to the user. Refer to a list of privileges (such as here) for applicable privileges. Conflicts with
roles
. - role String
- The role to grant
privileges
to. Conflicts withuser
andhost
. - roles List<String>
- A list of rols to grant to the user. Conflicts with
privileges
. - table String
- Which table to grant
privileges
on. Defaults to*
, which is all tables. - tls
Option String - An TLS-Option for the
GRANT
statement. The value is suffixed toREQUIRE
. A value of 'SSL' will generate aGRANT ... REQUIRE SSL
statement. See the MYSQLGRANT
documentation for more. Ignored if MySQL version is under 5.7.0. - user String
- The name of the user. Conflicts with
role
.
Package Details
- Repository
- MySQL pulumi/pulumi-mysql
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mysql
Terraform Provider.