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 jdoe = new mysql.User("jdoe", {
user: "jdoe",
host: "example.com",
plaintextPassword: "password",
});
const jdoeGrant = new mysql.Grant("jdoe", {
user: jdoe.user,
host: jdoe.host,
database: "app",
privileges: [
"SELECT",
"UPDATE",
],
});
import pulumi
import pulumi_mysql as mysql
jdoe = mysql.User("jdoe",
user="jdoe",
host="example.com",
plaintext_password="password")
jdoe_grant = mysql.Grant("jdoe",
user=jdoe.user,
host=jdoe.host,
database="app",
privileges=[
"SELECT",
"UPDATE",
])
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{
User: pulumi.String("jdoe"),
Host: pulumi.String("example.com"),
PlaintextPassword: pulumi.String("password"),
})
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "jdoe", &mysql.GrantArgs{
User: jdoe.User,
Host: jdoe.Host,
Database: pulumi.String("app"),
Privileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("UPDATE"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var jdoe = new MySql.User("jdoe", new()
{
UserName = "jdoe",
Host = "example.com",
PlaintextPassword = "password",
});
var jdoeGrant = new MySql.Grant("jdoe", new()
{
User = jdoe.UserName,
Host = jdoe.Host,
Database = "app",
Privileges = new[]
{
"SELECT",
"UPDATE",
},
});
});
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 jdoe = new User("jdoe", UserArgs.builder()
.user("jdoe")
.host("example.com")
.plaintextPassword("password")
.build());
var jdoeGrant = new Grant("jdoeGrant", GrantArgs.builder()
.user(jdoe.user())
.host(jdoe.host())
.database("app")
.privileges(
"SELECT",
"UPDATE")
.build());
}
}
resources:
jdoe:
type: mysql:User
properties:
user: jdoe
host: example.com
plaintextPassword: password
jdoeGrant:
type: mysql:Grant
name: jdoe
properties:
user: ${jdoe.user}
host: ${jdoe.host}
database: app
privileges:
- SELECT
- UPDATE
Granting Privileges to a Role
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const developer = new mysql.Role("developer", {name: "developer"});
const developerGrant = new mysql.Grant("developer", {
role: developer.name,
database: "app",
privileges: [
"SELECT",
"UPDATE",
],
});
import pulumi
import pulumi_mysql as mysql
developer = mysql.Role("developer", name="developer")
developer_grant = mysql.Grant("developer",
role=developer.name,
database="app",
privileges=[
"SELECT",
"UPDATE",
])
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 {
developer, err := mysql.NewRole(ctx, "developer", &mysql.RoleArgs{
Name: pulumi.String("developer"),
})
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "developer", &mysql.GrantArgs{
Role: developer.Name,
Database: pulumi.String("app"),
Privileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("UPDATE"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var developer = new MySql.Role("developer", new()
{
Name = "developer",
});
var developerGrant = new MySql.Grant("developer", new()
{
Role = developer.Name,
Database = "app",
Privileges = new[]
{
"SELECT",
"UPDATE",
},
});
});
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.RoleArgs;
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 developer = new Role("developer", RoleArgs.builder()
.name("developer")
.build());
var developerGrant = new Grant("developerGrant", GrantArgs.builder()
.role(developer.name())
.database("app")
.privileges(
"SELECT",
"UPDATE")
.build());
}
}
resources:
developer:
type: mysql:Role
properties:
name: developer
developerGrant:
type: mysql:Grant
name: developer
properties:
role: ${developer.name}
database: app
privileges:
- SELECT
- UPDATE
Adding a Role to a User
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const jdoe = new mysql.User("jdoe", {
user: "jdoe",
host: "example.com",
plaintextPassword: "password",
});
const developer = new mysql.Role("developer", {name: "developer"});
const developerGrant = new mysql.Grant("developer", {
user: jdoe.user,
host: jdoe.host,
database: "app",
roles: [developer.name],
});
import pulumi
import pulumi_mysql as mysql
jdoe = mysql.User("jdoe",
user="jdoe",
host="example.com",
plaintext_password="password")
developer = mysql.Role("developer", name="developer")
developer_grant = mysql.Grant("developer",
user=jdoe.user,
host=jdoe.host,
database="app",
roles=[developer.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 {
jdoe, err := mysql.NewUser(ctx, "jdoe", &mysql.UserArgs{
User: pulumi.String("jdoe"),
Host: pulumi.String("example.com"),
PlaintextPassword: pulumi.String("password"),
})
if err != nil {
return err
}
developer, err := mysql.NewRole(ctx, "developer", &mysql.RoleArgs{
Name: pulumi.String("developer"),
})
if err != nil {
return err
}
_, err = mysql.NewGrant(ctx, "developer", &mysql.GrantArgs{
User: jdoe.User,
Host: jdoe.Host,
Database: pulumi.String("app"),
Roles: pulumi.StringArray{
developer.Name,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using MySql = Pulumi.MySql;
return await Deployment.RunAsync(() =>
{
var jdoe = new MySql.User("jdoe", new()
{
UserName = "jdoe",
Host = "example.com",
PlaintextPassword = "password",
});
var developer = new MySql.Role("developer", new()
{
Name = "developer",
});
var developerGrant = new MySql.Grant("developer", new()
{
User = jdoe.UserName,
Host = jdoe.Host,
Database = "app",
Roles = new[]
{
developer.Name,
},
});
});
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.RoleArgs;
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()
.user("jdoe")
.host("example.com")
.plaintextPassword("password")
.build());
var developer = new Role("developer", RoleArgs.builder()
.name("developer")
.build());
var developerGrant = new Grant("developerGrant", GrantArgs.builder()
.user(jdoe.user())
.host(jdoe.host())
.database("app")
.roles(developer.name())
.build());
}
}
resources:
jdoe:
type: mysql:User
properties:
user: jdoe
host: example.com
plaintextPassword: password
developer:
type: mysql:Role
properties:
name: developer
developerGrant:
type: mysql:Grant
name: developer
properties:
user: ${jdoe.user}
host: ${jdoe.host}
database: app
roles:
- ${developer.name}
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
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.