Pulumi MySQL

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-mysql repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-mysql repo.

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

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

Caution: The .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.

static get(resource_name, id, opts=None, default_character_set=None, default_collation=None, name=None)

Get an existing Database resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • 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.

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, __props__=None, __name__=None, __opts__=None)

The .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.

static get(resource_name, id, opts=None, database=None, grant=None, host=None, privileges=None, role=None, roles=None, table=None, tls_option=None, user=None)

Get an existing Grant resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • 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.

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, __props__=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.

static get(resource_name, id, opts=None)

Get an existing Provider resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • 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, __props__=None, __name__=None, __opts__=None)

The .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.

static get(resource_name, id, opts=None, name=None)

Get an existing Role resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • name (pulumi.Input[str]) – 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, __props__=None, __name__=None, __opts__=None)

The .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.

static get(resource_name, id, opts=None, auth_plugin=None, host=None, password=None, plaintext_password=None, tls_option=None, user=None)

Get an existing User resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • 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.

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, __props__=None, __name__=None, __opts__=None)

Create a UserPassword resource with the given unique name, props, and options.

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.

static get(resource_name, id, opts=None, encrypted_password=None, host=None, key_fingerprint=None, pgp_key=None, user=None)

Get an existing UserPassword resource’s state with the given name, id, and optional extra properties used to qualify the lookup.

Parameters
  • resource_name (str) – The unique name of the resulting resource.

  • id (str) – The unique provider ID of the resource to lookup.

  • opts (pulumi.ResourceOptions) – Options for the resource.

  • encrypted_password (pulumi.Input[str]) – The encrypted password, base64 encoded.

  • host (pulumi.Input[str]) – The source host of the user. Defaults to localhost.

  • key_fingerprint (pulumi.Input[str]) – The fingerprint of the PGP key used to encrypt the password

  • 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.

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