Database

class Database : KotlinCustomResource

Manages a PostgreSQL Database within a PostgreSQL Server

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.postgresql.Server;
import com.pulumi.azure.postgresql.ServerArgs;
import com.pulumi.azure.postgresql.Database;
import com.pulumi.azure.postgresql.DatabaseArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleServer = new Server("exampleServer", ServerArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.skuName("B_Gen5_2")
.storageMb(5120)
.backupRetentionDays(7)
.geoRedundantBackupEnabled(false)
.autoGrowEnabled(true)
.administratorLogin("psqladmin")
.administratorLoginPassword("H@Sh1CoR3!")
.version("9.5")
.sslEnforcementEnabled(true)
.build());
var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.serverName(exampleServer.name())
.charset("UTF8")
.collation("English_United States.1252")
.build());
}
}

Import

PostgreSQL Database's can be imported using the resource id, e.g.

$ pulumi import azure:postgresql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforPostgreSQL/servers/server1/databases/database1

Properties

Link copied to clipboard
val charset: Output<String>

Specifies the Charset for the PostgreSQL Database, which needs to be a valid PostgreSQL Charset. Changing this forces a new resource to be created.

Link copied to clipboard
val collation: Output<String>

Specifies the Collation for the PostgreSQL Database, which needs to be a valid PostgreSQL Collation. Note that Microsoft uses different notation - en-US instead of en_US. Changing this forces a new resource to be created.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Specifies the name of the PostgreSQL Database, which needs to be a valid PostgreSQL identifier. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which the PostgreSQL Server exists. Changing this forces a new resource to be created.

Link copied to clipboard
val serverName: Output<String>

Specifies the name of the PostgreSQL Server. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>