Class Database
Represents a SQL database inside the Cloud SQL instance, hosted in Google's cloud.
Example Usage - Sql Database Basic
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var instance = new Gcp.Sql.DatabaseInstance("instance", new Gcp.Sql.DatabaseInstanceArgs
{
Region = "us-central1",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-f1-micro",
},
});
var database = new Gcp.Sql.Database("database", new Gcp.Sql.DatabaseArgs
{
Instance = instance.Name,
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.Sql
Assembly: Pulumi.Gcp.dll
Syntax
public class Database : CustomResource
Constructors
View SourceDatabase(String, DatabaseArgs, CustomResourceOptions)
Create a Database resource with the given unique name, arguments, and options.
Declaration
public Database(string name, DatabaseArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceCharset
The charset value. See MySQL's
Supported Character Sets and Collations
and Postgres' Character Set Support
for more details and supported values. Postgres databases only support
a value of UTF8 at creation time.
Declaration
public Output<string> Charset { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Collation
The collation value. See MySQL's
Supported Character Sets and Collations
and Postgres' Collation Support
for more details and supported values. Postgres databases only support
a value of en_US.UTF8 at creation time.
Declaration
public Output<string> Collation { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Instance
The name of the Cloud SQL instance. This does not include the project ID.
Declaration
public Output<string> Instance { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the database in the Cloud SQL instance. This does not include the project ID or instance name.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SelfLink
The URI of the created resource.
Declaration
public Output<string> SelfLink { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseState, CustomResourceOptions)
Get an existing Database resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Database Get(string name, Input<string> id, DatabaseState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DatabaseState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Database |