MigrationArgs

data class MigrationArgs(val cancel: Output<Either<String, CancelEnum>>? = null, val dbsToCancelMigrationOn: Output<List<String>>? = null, val dbsToMigrate: Output<List<String>>? = null, val dbsToTriggerCutoverOn: Output<List<String>>? = null, val location: Output<String>? = null, val migrationMode: Output<Either<String, MigrationMode>>? = null, val migrationName: Output<String>? = null, val migrationWindowEndTimeInUtc: Output<String>? = null, val migrationWindowStartTimeInUtc: Output<String>? = null, val overwriteDbsInTarget: Output<Either<String, OverwriteDbsInTargetEnum>>? = null, val resourceGroupName: Output<String>? = null, val secretParameters: Output<MigrationSecretParametersArgs>? = null, val setupLogicalReplicationOnSourceDbIfNeeded: Output<Either<String, LogicalReplicationOnSourceDbEnum>>? = null, val sourceDbServerFullyQualifiedDomainName: Output<String>? = null, val sourceDbServerResourceId: Output<String>? = null, val startDataMigration: Output<Either<String, StartDataMigrationEnum>>? = null, val subscriptionId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val targetDbServerFullyQualifiedDomainName: Output<String>? = null, val targetDbServerName: Output<String>? = null, val triggerCutover: Output<Either<String, TriggerCutoverEnum>>? = null) : ConvertibleToJava<MigrationArgs>

Represents a migration resource. Uses Azure REST API version 2023-03-01-preview. Other available API versions: 2021-06-15-privatepreview, 2022-05-01-preview, 2023-06-01-preview, 2023-12-01-preview, 2024-03-01-preview, 2024-08-01, 2024-11-01-preview.

Example Usage

Migrations Create by passing user names

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var migration = new AzureNative.DBforPostgreSQL.Migration("migration", new()
{
DbsToMigrate = new[]
{
"db1",
"db2",
"db3",
"db4",
},
Location = "westus",
MigrationMode = AzureNative.DBforPostgreSQL.MigrationMode.Offline,
MigrationName = "testmigration",
ResourceGroupName = "testrg",
SecretParameters = new AzureNative.DBforPostgreSQL.Inputs.MigrationSecretParametersArgs
{
AdminCredentials = new AzureNative.DBforPostgreSQL.Inputs.AdminCredentialsArgs
{
SourceServerPassword = "xxxxxxxx",
TargetServerPassword = "xxxxxxxx",
},
SourceServerUsername = "newadmin@testsource",
TargetServerUsername = "targetadmin",
},
SourceDbServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource",
TargetDbServerName = "testtarget",
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewMigration(ctx, "migration", &dbforpostgresql.MigrationArgs{
DbsToMigrate: pulumi.StringArray{
pulumi.String("db1"),
pulumi.String("db2"),
pulumi.String("db3"),
pulumi.String("db4"),
},
Location: pulumi.String("westus"),
MigrationMode: pulumi.String(dbforpostgresql.MigrationModeOffline),
MigrationName: pulumi.String("testmigration"),
ResourceGroupName: pulumi.String("testrg"),
SecretParameters: &dbforpostgresql.MigrationSecretParametersArgs{
AdminCredentials: &dbforpostgresql.AdminCredentialsArgs{
SourceServerPassword: pulumi.String("xxxxxxxx"),
TargetServerPassword: pulumi.String("xxxxxxxx"),
},
SourceServerUsername: pulumi.String("newadmin@testsource"),
TargetServerUsername: pulumi.String("targetadmin"),
},
SourceDbServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"),
TargetDbServerName: pulumi.String("testtarget"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Migration;
import com.pulumi.azurenative.dbforpostgresql.MigrationArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.MigrationSecretParametersArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.AdminCredentialsArgs;
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 migration = new Migration("migration", MigrationArgs.builder()
.dbsToMigrate(
"db1",
"db2",
"db3",
"db4")
.location("westus")
.migrationMode("Offline")
.migrationName("testmigration")
.resourceGroupName("testrg")
.secretParameters(MigrationSecretParametersArgs.builder()
.adminCredentials(AdminCredentialsArgs.builder()
.sourceServerPassword("xxxxxxxx")
.targetServerPassword("xxxxxxxx")
.build())
.sourceServerUsername("newadmin@testsource")
.targetServerUsername("targetadmin")
.build())
.sourceDbServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource")
.targetDbServerName("testtarget")
.build());
}
}

Migrations_Create

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var migration = new AzureNative.DBforPostgreSQL.Migration("migration", new()
{
DbsToMigrate = new[]
{
"db1",
"db2",
"db3",
"db4",
},
Location = "westus",
MigrationMode = AzureNative.DBforPostgreSQL.MigrationMode.Offline,
MigrationName = "testmigration",
OverwriteDbsInTarget = AzureNative.DBforPostgreSQL.OverwriteDbsInTargetEnum.True,
ResourceGroupName = "testrg",
SecretParameters = new AzureNative.DBforPostgreSQL.Inputs.MigrationSecretParametersArgs
{
AdminCredentials = new AzureNative.DBforPostgreSQL.Inputs.AdminCredentialsArgs
{
SourceServerPassword = "xxxxxxxx",
TargetServerPassword = "xxxxxxxx",
},
},
SourceDbServerResourceId = "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource",
TargetDbServerName = "testtarget",
});
});
package main
import (
dbforpostgresql "github.com/pulumi/pulumi-azure-native-sdk/dbforpostgresql/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dbforpostgresql.NewMigration(ctx, "migration", &dbforpostgresql.MigrationArgs{
DbsToMigrate: pulumi.StringArray{
pulumi.String("db1"),
pulumi.String("db2"),
pulumi.String("db3"),
pulumi.String("db4"),
},
Location: pulumi.String("westus"),
MigrationMode: pulumi.String(dbforpostgresql.MigrationModeOffline),
MigrationName: pulumi.String("testmigration"),
OverwriteDbsInTarget: pulumi.String(dbforpostgresql.OverwriteDbsInTargetEnumTrue),
ResourceGroupName: pulumi.String("testrg"),
SecretParameters: &dbforpostgresql.MigrationSecretParametersArgs{
AdminCredentials: &dbforpostgresql.AdminCredentialsArgs{
SourceServerPassword: pulumi.String("xxxxxxxx"),
TargetServerPassword: pulumi.String("xxxxxxxx"),
},
},
SourceDbServerResourceId: pulumi.String("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource"),
TargetDbServerName: pulumi.String("testtarget"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.dbforpostgresql.Migration;
import com.pulumi.azurenative.dbforpostgresql.MigrationArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.MigrationSecretParametersArgs;
import com.pulumi.azurenative.dbforpostgresql.inputs.AdminCredentialsArgs;
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 migration = new Migration("migration", MigrationArgs.builder()
.dbsToMigrate(
"db1",
"db2",
"db3",
"db4")
.location("westus")
.migrationMode("Offline")
.migrationName("testmigration")
.overwriteDbsInTarget("True")
.resourceGroupName("testrg")
.secretParameters(MigrationSecretParametersArgs.builder()
.adminCredentials(AdminCredentialsArgs.builder()
.sourceServerPassword("xxxxxxxx")
.targetServerPassword("xxxxxxxx")
.build())
.build())
.sourceDbServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource")
.targetDbServerName("testtarget")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:dbforpostgresql:Migration d3ceacbb-a5fd-43dc-a9db-6022b5154856 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}

Constructors

Link copied to clipboard
constructor(cancel: Output<Either<String, CancelEnum>>? = null, dbsToCancelMigrationOn: Output<List<String>>? = null, dbsToMigrate: Output<List<String>>? = null, dbsToTriggerCutoverOn: Output<List<String>>? = null, location: Output<String>? = null, migrationMode: Output<Either<String, MigrationMode>>? = null, migrationName: Output<String>? = null, migrationWindowEndTimeInUtc: Output<String>? = null, migrationWindowStartTimeInUtc: Output<String>? = null, overwriteDbsInTarget: Output<Either<String, OverwriteDbsInTargetEnum>>? = null, resourceGroupName: Output<String>? = null, secretParameters: Output<MigrationSecretParametersArgs>? = null, setupLogicalReplicationOnSourceDbIfNeeded: Output<Either<String, LogicalReplicationOnSourceDbEnum>>? = null, sourceDbServerFullyQualifiedDomainName: Output<String>? = null, sourceDbServerResourceId: Output<String>? = null, startDataMigration: Output<Either<String, StartDataMigrationEnum>>? = null, subscriptionId: Output<String>? = null, tags: Output<Map<String, String>>? = null, targetDbServerFullyQualifiedDomainName: Output<String>? = null, targetDbServerName: Output<String>? = null, triggerCutover: Output<Either<String, TriggerCutoverEnum>>? = null)

Properties

Link copied to clipboard
val cancel: Output<Either<String, CancelEnum>>? = null

To trigger cancel for entire migration we need to send this flag as True

Link copied to clipboard
val dbsToCancelMigrationOn: Output<List<String>>? = null

When you want to trigger cancel for specific databases send cancel flag as True and database names in this array

Link copied to clipboard
val dbsToMigrate: Output<List<String>>? = null

Number of databases to migrate

Link copied to clipboard
val dbsToTriggerCutoverOn: Output<List<String>>? = null

When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array

Link copied to clipboard
val location: Output<String>? = null

The geo-location where the resource lives

Link copied to clipboard
val migrationMode: Output<Either<String, MigrationMode>>? = null

There are two types of migration modes Online and Offline

Link copied to clipboard
val migrationName: Output<String>? = null

The name of the migration.

Link copied to clipboard
val migrationWindowEndTimeInUtc: Output<String>? = null

End time in UTC for migration window

Link copied to clipboard

Start time in UTC for migration window

Link copied to clipboard

Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The resource group name of the target database server.

Link copied to clipboard

Migration secret parameters

Indicates whether to setup LogicalReplicationOnSourceDb, if needed

Link copied to clipboard

Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection

Link copied to clipboard
val sourceDbServerResourceId: Output<String>? = null

ResourceId of the source database server

Link copied to clipboard
val startDataMigration: Output<Either<String, StartDataMigrationEnum>>? = null

Indicates whether the data migration should start right away

Link copied to clipboard
val subscriptionId: Output<String>? = null

The subscription ID of the target database server.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Resource tags.

Link copied to clipboard

Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection

Link copied to clipboard
val targetDbServerName: Output<String>? = null

The name of the target database server.

Link copied to clipboard
val triggerCutover: Output<Either<String, TriggerCutoverEnum>>? = null

To trigger cutover for entire migration we need to send this flag as True

Functions

Link copied to clipboard
open override fun toJava(): MigrationArgs