Pulumi MySQL

class pulumi_mysql.Database(resource_name, opts=None, default_character_set=None, default_collation=None, name=None, __name__=None, __opts__=None)

The mysql_database resource creates and manages a database on a MySQL server.

Caution: The mysql_database resource can completely delete your database just as easily as it can create it. To avoid costly accidents, consider setting ``prevent_destroy` <https://www.terraform.io/docs/configuration/resources.html#prevent_destroy>`_ on your database resources as an extra safety measure.
Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • default_character_set (pulumi.Input[str]) – The default character set to use when a table is created without specifying an explicit character set. Defaults to “utf8”.
  • default_collation (pulumi.Input[str]) – The default collation to use when a table is created without specifying an explicit collation. Defaults to utf8_general_ci. Each character set has its own set of collations, so changing the character set requires also changing the collation.
  • name (pulumi.Input[str]) – The name of the database. This must be unique within a given MySQL server and may or may not be case-sensitive depending on the operating system on which the MySQL server is running.
default_character_set = None

The default character set to use when a table is created without specifying an explicit character set. Defaults to “utf8”.

default_collation = None

The default collation to use when a table is created without specifying an explicit collation. Defaults to utf8_general_ci. Each character set has its own set of collations, so changing the character set requires also changing the collation.

name = None

The name of the database. This must be unique within a given MySQL server and may or may not be case-sensitive depending on the operating system on which the MySQL server is running.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_mysql.Grant(resource_name, opts=None, database=None, grant=None, host=None, privileges=None, role=None, roles=None, table=None, tls_option=None, user=None, __name__=None, __opts__=None)

The mysql_grant resource creates and manages privileges given to a user on a MySQL server.

Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • database (pulumi.Input[str]) – The database to grant privileges on.
  • grant (pulumi.Input[bool]) – Whether to also give the user privileges to grant the same privileges to other users.
  • host (pulumi.Input[str]) – The source host of the user. Defaults to “localhost”. Conflicts with role.
  • privileges (pulumi.Input[list]) – 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 (pulumi.Input[str]) – The role to grant privileges to. Conflicts with user and host.
  • roles (pulumi.Input[list]) – A list of rols to grant to the user. Conflicts with privileges.
  • table (pulumi.Input[str]) – Which table to grant privileges on. Defaults to *, which is all tables.
  • tls_option (pulumi.Input[str]) – An TLS-Option for the GRANT statement. The value is suffixed to REQUIRE. A value of ‘SSL’ will generate a GRANT ... REQUIRE SSL statement. See the MYSQL ``GRANT` documentation <https://dev.mysql.com/doc/refman/5.7/en/grant.html>`_ for more. Ignored if MySQL version is under 5.7.0.
  • user (pulumi.Input[str]) – The name of the user. Conflicts with role.
database = None

The database to grant privileges on.

grant = None

Whether to also give the user privileges to grant the same privileges to other users.

host = None

The source host of the user. Defaults to “localhost”. Conflicts with role.

privileges = None

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 = None

The role to grant privileges to. Conflicts with user and host.

roles = None

A list of rols to grant to the user. Conflicts with privileges.

table = None

Which table to grant privileges on. Defaults to *, which is all tables.

tls_option = None

An TLS-Option for the GRANT statement. The value is suffixed to REQUIRE. A value of ‘SSL’ will generate a GRANT ... REQUIRE SSL statement. See the MYSQL ``GRANT` documentation <https://dev.mysql.com/doc/refman/5.7/en/grant.html>`_ for more. Ignored if MySQL version is under 5.7.0.

user = None

The name of the user. Conflicts with role.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_mysql.Provider(resource_name, opts=None, endpoint=None, password=None, tls=None, username=None, __name__=None, __opts__=None)

The provider type for the mysql package. By default, resources use package-wide configuration settings, however an explicit Provider instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the documentation for more information.

Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_mysql.Role(resource_name, opts=None, name=None, __name__=None, __opts__=None)

The mysql_role resource creates and manages a user on a MySQL server.

Note: MySQL introduced roles in version 8. They do not work on MySQL 5 and lower.
Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • name (pulumi.Input[str]) – The name of the role.
name = None

The name of the role.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_mysql.User(resource_name, opts=None, auth_plugin=None, host=None, password=None, plaintext_password=None, tls_option=None, user=None, __name__=None, __opts__=None)

The mysql_user resource creates and manages a user on a MySQL server.

Note: The password for the user is provided in plain text, and is obscured by an unsalted hash in the state Read more about sensitive data in state. Care is required when using this resource, to avoid disclosing the password.
Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • auth_plugin (pulumi.Input[str]) – Use an [authentication plugin][ref-auth-plugins] to authenticate the user instead of using password authentication. Description of the fields allowed in the block below. Conflicts with password and plaintext_password.
  • host (pulumi.Input[str]) – The source host of the user. Defaults to “localhost”.
  • password (pulumi.Input[str]) – Deprecated alias of plaintext_password, whose value is stored as plaintext in state. Prefer to use plaintext_password instead, which stores the password as an unsalted hash. Conflicts with auth_plugin.
  • plaintext_password (pulumi.Input[str]) – The password for the user. This must be provided in plain text, so the data source for it must be secured. An unsalted hash of the provided password is stored in state. Conflicts with auth_plugin.
  • tls_option (pulumi.Input[str]) – An TLS-Option for the CREATE USER or ALTER USER statement. The value is suffixed to REQUIRE. A value of ‘SSL’ will generate a CREATE USER ... REQUIRE SSL statement. See the MYSQL ``CREATE USER` documentation <https://dev.mysql.com/doc/refman/5.7/en/create-user.html>`_ for more. Ignored if MySQL version is under 5.7.0.
  • user (pulumi.Input[str]) – The name of the user.
auth_plugin = None

Use an [authentication plugin][ref-auth-plugins] to authenticate the user instead of using password authentication. Description of the fields allowed in the block below. Conflicts with password and plaintext_password.

host = None

The source host of the user. Defaults to “localhost”.

password = None

Deprecated alias of plaintext_password, whose value is stored as plaintext in state. Prefer to use plaintext_password instead, which stores the password as an unsalted hash. Conflicts with auth_plugin.

plaintext_password = None

The password for the user. This must be provided in plain text, so the data source for it must be secured. An unsalted hash of the provided password is stored in state. Conflicts with auth_plugin.

tls_option = None

An TLS-Option for the CREATE USER or ALTER USER statement. The value is suffixed to REQUIRE. A value of ‘SSL’ will generate a CREATE USER ... REQUIRE SSL statement. See the MYSQL ``CREATE USER` documentation <https://dev.mysql.com/doc/refman/5.7/en/create-user.html>`_ for more. Ignored if MySQL version is under 5.7.0.

user = None

The name of the user.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
class pulumi_mysql.UserPassword(resource_name, opts=None, host=None, pgp_key=None, user=None, __name__=None, __opts__=None)

The mysql_user_password resource sets and manages a passwordd for a given user on a MySQL server.

NOTE on MySQL Passwords: This resource conflicts with the password
argument for mysql_user. This resource uses PGP encryption to avoid storing unencrypted passwords in Terraform state.
NOTE on How Passwords are Created: This resource automatically
generates a random password. The password will be a random UUID.
Parameters:
  • resource_name (str) – The name of the resource.
  • opts (pulumi.ResourceOptions) – Options for the resource.
  • host (pulumi.Input[str]) – The source host of the user. Defaults to localhost.
  • pgp_key (pulumi.Input[str]) – Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.
  • user (pulumi.Input[str]) – The IAM user to associate with this access key.
encrypted_password = None

The encrypted password, base64 encoded.

host = None

The source host of the user. Defaults to localhost.

key_fingerprint = None

The fingerprint of the PGP key used to encrypt the password

pgp_key = None

Either a base-64 encoded PGP public key, or a keybase username in the form keybase:some_person_that_exists.

user = None

The IAM user to associate with this access key.

translate_output_property(prop)

Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str
translate_input_property(prop)

Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.

Parameters:prop (str) – A property name.
Returns:A potentially transformed property name.
Return type:str