Fork me on GitHub

Module sql

@pulumi/gcp > sql

Index

sql/database.ts sql/databaseInstance.ts sql/user.ts

class Database

Creates a new Google SQL Database on a Google SQL Database Instance. For more information, see the official documentation, or the JSON API.

constructor

new Database(name: string, args: DatabaseArgs, opts?: pulumi.CustomResourceOptions)

Create a Database resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseState): Database

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property charset

public charset: pulumi.Output<string>;

The charset value. See MySQL’s Supported Character Sets and Collations and Postgres’ Character Set Support for more details and supported values. Postgres databases are in Beta, and have limited charset support; they only support a value of UTF8 at creation time.

property collation

public collation: pulumi.Output<string>;

The collation value. See MySQL’s Supported Character Sets and Collations and Postgres’ Collation Support for more details and supported values. Postgres databases are in Beta, and have limited collation support; they only support a value of en_US.UTF8 at creation time.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instance

public instance: pulumi.Output<string>;

The name of containing instance.

property name

public name: pulumi.Output<string>;

The name of the database.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property selfLink

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class DatabaseInstance

Creates a new Google SQL Database Instance. For more information, see the official documentation, or the JSON API.

~> NOTE on google_sql_database_instance: - Second-generation instances include a default ‘root’@’%’ user with no password. This user will be deleted by Terraform on instance creation. You should use google_sql_user to define a custom user with a restricted host and strong password.

constructor

new DatabaseInstance(name: string, args: DatabaseInstanceArgs, opts?: pulumi.CustomResourceOptions)

Create a DatabaseInstance resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseInstanceState): DatabaseInstance

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property connectionName

public connectionName: pulumi.Output<string>;

The connection name of the instance to be used in connection strings.

property databaseVersion

public databaseVersion: pulumi.Output<string | undefined>;

The MySQL version to use. Can be MYSQL_5_6, MYSQL_5_7 or POSTGRES_9_6 for second-generation instances, or MYSQL_5_5 or MYSQL_5_6 for first-generation instances. See Second Generation Capabilities for more information. POSTGRES_9_6 support is in Beta.

property firstIpAddress

public firstIpAddress: pulumi.Output<string>;

The first IPv4 address of the addresses assigned. This is is to support accessing the first address in the list in a terraform output when the resource is configured with a count.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property ipAddresses

public ipAddresses: pulumi.Output<{ ... }[]>;

property masterInstanceName

public masterInstanceName: pulumi.Output<string>;

The name of the instance that will act as the master in the replication setup. Note, this requires the master to have binary_log_enabled set, as well as existing backups.

property name

public name: pulumi.Output<string>;

The name of the instance. If the name is left blank, Terraform will randomly generate one when the instance is first created. This is done because after a name is used, it cannot be reused for up to one week.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

public region: pulumi.Output<string | undefined>;

The region the instance will sit in. Note, first-generation Cloud SQL instance regions do not line up with the Google Compute Engine (GCE) regions, and Cloud SQL is not available in all regions - choose from one of the options listed here. A valid region must be provided to use this resource. If a region is not provided in the resource definition, the provider region will be used instead, but this will be an apply-time error for all first-generation instances and for second-generation instances if the provider region is not supported with Cloud SQL. If you choose not to provide the region argument for this resource, make sure you understand this.

property replicaConfiguration

public replicaConfiguration: pulumi.Output<{ ... }>;

The configuration for replication. The configuration is detailed below.

property selfLink

public selfLink: pulumi.Output<string>;

The URI of the created resource.

property serverCaCert

public serverCaCert: pulumi.Output<{ ... }>;

property settings

public settings: pulumi.Output<{ ... }>;

The settings to use for the database. The configuration is detailed below.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class User

Creates a new Google SQL User on a Google SQL User Instance. For more information, see the official documentation, or the JSON API.

~> Note: All arguments including the username and password will be stored in the raw state as plain-text. Read more about sensitive data in state. Passwords will not be retrieved when running “terraform import”.

constructor

new User(name: string, args: UserArgs, opts?: pulumi.CustomResourceOptions)

Create a User resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: UserState): User

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property host

public host: pulumi.Output<string | undefined>;

The host the user can connect from. This is only supported for MySQL instances. Don’t set this field for PostgreSQL instances. Can be an IP address. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property instance

public instance: pulumi.Output<string>;

The name of the Cloud SQL instance. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

The name of the user. Changing this forces a new resource to be created.

property password

public password: pulumi.Output<string | undefined>;

The password for the user. Can be updated.

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface DatabaseArgs

The set of arguments for constructing a Database resource.

property charset

charset?: pulumi.Input<string>;

The charset value. See MySQL’s Supported Character Sets and Collations and Postgres’ Character Set Support for more details and supported values. Postgres databases are in Beta, and have limited charset support; they only support a value of UTF8 at creation time.

property collation

collation?: pulumi.Input<string>;

The collation value. See MySQL’s Supported Character Sets and Collations and Postgres’ Collation Support for more details and supported values. Postgres databases are in Beta, and have limited collation support; they only support a value of en_US.UTF8 at creation time.

property instance

instance: pulumi.Input<string>;

The name of containing instance.

property name

name?: pulumi.Input<string>;

The name of the database.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

interface DatabaseInstanceArgs

The set of arguments for constructing a DatabaseInstance resource.

property databaseVersion

databaseVersion?: pulumi.Input<string>;

The MySQL version to use. Can be MYSQL_5_6, MYSQL_5_7 or POSTGRES_9_6 for second-generation instances, or MYSQL_5_5 or MYSQL_5_6 for first-generation instances. See Second Generation Capabilities for more information. POSTGRES_9_6 support is in Beta.

property masterInstanceName

masterInstanceName?: pulumi.Input<string>;

The name of the instance that will act as the master in the replication setup. Note, this requires the master to have binary_log_enabled set, as well as existing backups.

property name

name?: pulumi.Input<string>;

The name of the instance. If the name is left blank, Terraform will randomly generate one when the instance is first created. This is done because after a name is used, it cannot be reused for up to one week.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

region?: pulumi.Input<string>;

The region the instance will sit in. Note, first-generation Cloud SQL instance regions do not line up with the Google Compute Engine (GCE) regions, and Cloud SQL is not available in all regions - choose from one of the options listed here. A valid region must be provided to use this resource. If a region is not provided in the resource definition, the provider region will be used instead, but this will be an apply-time error for all first-generation instances and for second-generation instances if the provider region is not supported with Cloud SQL. If you choose not to provide the region argument for this resource, make sure you understand this.

property replicaConfiguration

replicaConfiguration?: pulumi.Input<{ ... }>;

The configuration for replication. The configuration is detailed below.

property settings

settings: pulumi.Input<{ ... }>;

The settings to use for the database. The configuration is detailed below.

interface DatabaseInstanceState

Input properties used for looking up and filtering DatabaseInstance resources.

property connectionName

connectionName?: pulumi.Input<string>;

The connection name of the instance to be used in connection strings.

property databaseVersion

databaseVersion?: pulumi.Input<string>;

The MySQL version to use. Can be MYSQL_5_6, MYSQL_5_7 or POSTGRES_9_6 for second-generation instances, or MYSQL_5_5 or MYSQL_5_6 for first-generation instances. See Second Generation Capabilities for more information. POSTGRES_9_6 support is in Beta.

property firstIpAddress

firstIpAddress?: pulumi.Input<string>;

The first IPv4 address of the addresses assigned. This is is to support accessing the first address in the list in a terraform output when the resource is configured with a count.

property ipAddresses

ipAddresses?: pulumi.Input<pulumi.Input<{ ... }>[]>;

property masterInstanceName

masterInstanceName?: pulumi.Input<string>;

The name of the instance that will act as the master in the replication setup. Note, this requires the master to have binary_log_enabled set, as well as existing backups.

property name

name?: pulumi.Input<string>;

The name of the instance. If the name is left blank, Terraform will randomly generate one when the instance is first created. This is done because after a name is used, it cannot be reused for up to one week.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property region

region?: pulumi.Input<string>;

The region the instance will sit in. Note, first-generation Cloud SQL instance regions do not line up with the Google Compute Engine (GCE) regions, and Cloud SQL is not available in all regions - choose from one of the options listed here. A valid region must be provided to use this resource. If a region is not provided in the resource definition, the provider region will be used instead, but this will be an apply-time error for all first-generation instances and for second-generation instances if the provider region is not supported with Cloud SQL. If you choose not to provide the region argument for this resource, make sure you understand this.

property replicaConfiguration

replicaConfiguration?: pulumi.Input<{ ... }>;

The configuration for replication. The configuration is detailed below.

property selfLink

selfLink?: pulumi.Input<string>;

The URI of the created resource.

property serverCaCert

serverCaCert?: pulumi.Input<{ ... }>;

property settings

settings?: pulumi.Input<{ ... }>;

The settings to use for the database. The configuration is detailed below.

interface DatabaseState

Input properties used for looking up and filtering Database resources.

property charset

charset?: pulumi.Input<string>;

The charset value. See MySQL’s Supported Character Sets and Collations and Postgres’ Character Set Support for more details and supported values. Postgres databases are in Beta, and have limited charset support; they only support a value of UTF8 at creation time.

property collation

collation?: pulumi.Input<string>;

The collation value. See MySQL’s Supported Character Sets and Collations and Postgres’ Collation Support for more details and supported values. Postgres databases are in Beta, and have limited collation support; they only support a value of en_US.UTF8 at creation time.

property instance

instance?: pulumi.Input<string>;

The name of containing instance.

property name

name?: pulumi.Input<string>;

The name of the database.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property selfLink

selfLink?: pulumi.Input<string>;

The URI of the created resource.

interface UserArgs

The set of arguments for constructing a User resource.

property host

host?: pulumi.Input<string>;

The host the user can connect from. This is only supported for MySQL instances. Don’t set this field for PostgreSQL instances. Can be an IP address. Changing this forces a new resource to be created.

property instance

instance: pulumi.Input<string>;

The name of the Cloud SQL instance. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the user. Changing this forces a new resource to be created.

property password

password?: pulumi.Input<string>;

The password for the user. Can be updated.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

interface UserState

Input properties used for looking up and filtering User resources.

property host

host?: pulumi.Input<string>;

The host the user can connect from. This is only supported for MySQL instances. Don’t set this field for PostgreSQL instances. Can be an IP address. Changing this forces a new resource to be created.

property instance

instance?: pulumi.Input<string>;

The name of the Cloud SQL instance. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

The name of the user. Changing this forces a new resource to be created.

property password

password?: pulumi.Input<string>;

The password for the user. Can be updated.

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.