Database Args
data class DatabaseArgs(val charset: Output<String>? = null, val collation: Output<String>? = null, val name: Output<String>? = null, val resourceGroupName: Output<String>? = null, val serverName: Output<String>? = null) : ConvertibleToJava<DatabaseArgs>
Manages a MySQL Database within a MySQL 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.mysql.Server;
import com.pulumi.azure.mysql.ServerArgs;
import com.pulumi.azure.mysql.Database;
import com.pulumi.azure.mysql.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())
.administratorLogin("mysqladminun")
.administratorLoginPassword("H@Sh1CoR3!")
.skuName("GP_Gen5_2")
.storageMb(5120)
.version("5.7")
.autoGrowEnabled(true)
.backupRetentionDays(7)
.geoRedundantBackupEnabled(true)
.infrastructureEncryptionEnabled(true)
.publicNetworkAccessEnabled(false)
.sslEnforcementEnabled(true)
.sslMinimalTlsVersionEnforced("TLS1_2")
.build());
var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.serverName(exampleServer.name())
.charset("utf8")
.collation("utf8_unicode_ci")
.build());
}
}
Content copied to clipboard
Import
MySQL Database's can be imported using the resource id
, e.g.
$ pulumi import azure:mysql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.DBforMySQL/servers/server1/databases/database1
Content copied to clipboard
Constructors
Functions
Properties
Link copied to clipboard
Specifies the Charset for the MySQL Database, which needs to be a valid MySQL Charset. Changing this forces a new resource to be created.
Link copied to clipboard
Specifies the Collation for the MySQL Database, which needs to be a valid MySQL Collation. Changing this forces a new resource to be created.
Link copied to clipboard
Specifies the name of the MySQL Database, which needs to be a valid MySQL identifier. Changing this forces a new resource to be created.