gcp.databasemigrationservice.MigrationJob
Explore with Pulumi AI
A migration job definition.
To get more information about MigrationJob, see:
- API documentation
- How-to Guides
Example Usage
Database Migration Service Migration Job Mysql To Mysql
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = gcp.organizations.getProject({});
const sourceCsql = new gcp.sql.DatabaseInstance("source_csql", {
name: "source-csql",
databaseVersion: "MYSQL_5_7",
settings: {
tier: "db-n1-standard-1",
deletionProtectionEnabled: false,
},
deletionProtection: false,
});
const sourceSqlClientCert = new gcp.sql.SslCert("source_sql_client_cert", {
commonName: "cert",
instance: sourceCsql.name,
}, {
dependsOn: [sourceCsql],
});
const sourceSqldbUser = new gcp.sql.User("source_sqldb_user", {
name: "username",
instance: sourceCsql.name,
password: "password",
}, {
dependsOn: [sourceSqlClientCert],
});
const sourceCp = new gcp.databasemigrationservice.ConnectionProfile("source_cp", {
location: "us-central1",
connectionProfileId: "source-cp",
displayName: "source-cp_display",
labels: {
foo: "bar",
},
mysql: {
host: sourceCsql.ipAddresses.apply(ipAddresses => ipAddresses[0].ipAddress),
port: 3306,
username: sourceSqldbUser.name,
password: sourceSqldbUser.password,
ssl: {
clientKey: sourceSqlClientCert.privateKey,
clientCertificate: sourceSqlClientCert.cert,
caCertificate: sourceSqlClientCert.serverCaCert,
},
cloudSqlId: "source-csql",
},
}, {
dependsOn: [sourceSqldbUser],
});
const destinationCsql = new gcp.sql.DatabaseInstance("destination_csql", {
name: "destination-csql",
databaseVersion: "MYSQL_5_7",
settings: {
tier: "db-n1-standard-1",
deletionProtectionEnabled: false,
},
deletionProtection: false,
});
const destinationCp = new gcp.databasemigrationservice.ConnectionProfile("destination_cp", {
location: "us-central1",
connectionProfileId: "destination-cp",
displayName: "destination-cp_display",
labels: {
foo: "bar",
},
mysql: {
cloudSqlId: "destination-csql",
},
}, {
dependsOn: [destinationCsql],
});
const _default = new gcp.compute.Network("default", {name: "destination-csql"});
const mysqltomysql = new gcp.databasemigrationservice.MigrationJob("mysqltomysql", {
location: "us-central1",
migrationJobId: "my-migrationid",
displayName: "my-migrationid_display",
labels: {
foo: "bar",
},
performanceConfig: {
dumpParallelLevel: "MAX",
},
vpcPeeringConnectivity: {
vpc: _default.id,
},
dumpType: "LOGICAL",
dumpFlags: {
dumpFlags: [{
name: "max-allowed-packet",
value: "1073741824",
}],
},
source: sourceCp.name,
destination: destinationCp.name,
type: "CONTINUOUS",
});
import pulumi
import pulumi_gcp as gcp
project = gcp.organizations.get_project()
source_csql = gcp.sql.DatabaseInstance("source_csql",
name="source-csql",
database_version="MYSQL_5_7",
settings={
"tier": "db-n1-standard-1",
"deletion_protection_enabled": False,
},
deletion_protection=False)
source_sql_client_cert = gcp.sql.SslCert("source_sql_client_cert",
common_name="cert",
instance=source_csql.name,
opts = pulumi.ResourceOptions(depends_on=[source_csql]))
source_sqldb_user = gcp.sql.User("source_sqldb_user",
name="username",
instance=source_csql.name,
password="password",
opts = pulumi.ResourceOptions(depends_on=[source_sql_client_cert]))
source_cp = gcp.databasemigrationservice.ConnectionProfile("source_cp",
location="us-central1",
connection_profile_id="source-cp",
display_name="source-cp_display",
labels={
"foo": "bar",
},
mysql={
"host": source_csql.ip_addresses[0].ip_address,
"port": 3306,
"username": source_sqldb_user.name,
"password": source_sqldb_user.password,
"ssl": {
"client_key": source_sql_client_cert.private_key,
"client_certificate": source_sql_client_cert.cert,
"ca_certificate": source_sql_client_cert.server_ca_cert,
},
"cloud_sql_id": "source-csql",
},
opts = pulumi.ResourceOptions(depends_on=[source_sqldb_user]))
destination_csql = gcp.sql.DatabaseInstance("destination_csql",
name="destination-csql",
database_version="MYSQL_5_7",
settings={
"tier": "db-n1-standard-1",
"deletion_protection_enabled": False,
},
deletion_protection=False)
destination_cp = gcp.databasemigrationservice.ConnectionProfile("destination_cp",
location="us-central1",
connection_profile_id="destination-cp",
display_name="destination-cp_display",
labels={
"foo": "bar",
},
mysql={
"cloud_sql_id": "destination-csql",
},
opts = pulumi.ResourceOptions(depends_on=[destination_csql]))
default = gcp.compute.Network("default", name="destination-csql")
mysqltomysql = gcp.databasemigrationservice.MigrationJob("mysqltomysql",
location="us-central1",
migration_job_id="my-migrationid",
display_name="my-migrationid_display",
labels={
"foo": "bar",
},
performance_config={
"dump_parallel_level": "MAX",
},
vpc_peering_connectivity={
"vpc": default.id,
},
dump_type="LOGICAL",
dump_flags={
"dump_flags": [{
"name": "max-allowed-packet",
"value": "1073741824",
}],
},
source=source_cp.name,
destination=destination_cp.name,
type="CONTINUOUS")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/databasemigrationservice"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
if err != nil {
return err
}
sourceCsql, err := sql.NewDatabaseInstance(ctx, "source_csql", &sql.DatabaseInstanceArgs{
Name: pulumi.String("source-csql"),
DatabaseVersion: pulumi.String("MYSQL_5_7"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-n1-standard-1"),
DeletionProtectionEnabled: pulumi.Bool(false),
},
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
sourceSqlClientCert, err := sql.NewSslCert(ctx, "source_sql_client_cert", &sql.SslCertArgs{
CommonName: pulumi.String("cert"),
Instance: sourceCsql.Name,
}, pulumi.DependsOn([]pulumi.Resource{
sourceCsql,
}))
if err != nil {
return err
}
sourceSqldbUser, err := sql.NewUser(ctx, "source_sqldb_user", &sql.UserArgs{
Name: pulumi.String("username"),
Instance: sourceCsql.Name,
Password: pulumi.String("password"),
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqlClientCert,
}))
if err != nil {
return err
}
sourceCp, err := databasemigrationservice.NewConnectionProfile(ctx, "source_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("source-cp"),
DisplayName: pulumi.String("source-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Mysql: &databasemigrationservice.ConnectionProfileMysqlArgs{
Host: sourceCsql.IpAddresses.ApplyT(func(ipAddresses []sql.DatabaseInstanceIpAddress) (*string, error) {
return &ipAddresses[0].IpAddress, nil
}).(pulumi.StringPtrOutput),
Port: pulumi.Int(3306),
Username: sourceSqldbUser.Name,
Password: sourceSqldbUser.Password,
Ssl: &databasemigrationservice.ConnectionProfileMysqlSslArgs{
ClientKey: sourceSqlClientCert.PrivateKey,
ClientCertificate: sourceSqlClientCert.Cert,
CaCertificate: sourceSqlClientCert.ServerCaCert,
},
CloudSqlId: pulumi.String("source-csql"),
},
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqldbUser,
}))
if err != nil {
return err
}
destinationCsql, err := sql.NewDatabaseInstance(ctx, "destination_csql", &sql.DatabaseInstanceArgs{
Name: pulumi.String("destination-csql"),
DatabaseVersion: pulumi.String("MYSQL_5_7"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-n1-standard-1"),
DeletionProtectionEnabled: pulumi.Bool(false),
},
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
destinationCp, err := databasemigrationservice.NewConnectionProfile(ctx, "destination_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("destination-cp"),
DisplayName: pulumi.String("destination-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Mysql: &databasemigrationservice.ConnectionProfileMysqlArgs{
CloudSqlId: pulumi.String("destination-csql"),
},
}, pulumi.DependsOn([]pulumi.Resource{
destinationCsql,
}))
if err != nil {
return err
}
_, err = compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
Name: pulumi.String("destination-csql"),
})
if err != nil {
return err
}
_, err = databasemigrationservice.NewMigrationJob(ctx, "mysqltomysql", &databasemigrationservice.MigrationJobArgs{
Location: pulumi.String("us-central1"),
MigrationJobId: pulumi.String("my-migrationid"),
DisplayName: pulumi.String("my-migrationid_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
PerformanceConfig: &databasemigrationservice.MigrationJobPerformanceConfigArgs{
DumpParallelLevel: pulumi.String("MAX"),
},
VpcPeeringConnectivity: &databasemigrationservice.MigrationJobVpcPeeringConnectivityArgs{
Vpc: _default.ID(),
},
DumpType: pulumi.String("LOGICAL"),
DumpFlags: &databasemigrationservice.MigrationJobDumpFlagsArgs{
DumpFlags: databasemigrationservice.MigrationJobDumpFlagsDumpFlagArray{
&databasemigrationservice.MigrationJobDumpFlagsDumpFlagArgs{
Name: pulumi.String("max-allowed-packet"),
Value: pulumi.String("1073741824"),
},
},
},
Source: sourceCp.Name,
Destination: destinationCp.Name,
Type: pulumi.String("CONTINUOUS"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = Gcp.Organizations.GetProject.Invoke();
var sourceCsql = new Gcp.Sql.DatabaseInstance("source_csql", new()
{
Name = "source-csql",
DatabaseVersion = "MYSQL_5_7",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-n1-standard-1",
DeletionProtectionEnabled = false,
},
DeletionProtection = false,
});
var sourceSqlClientCert = new Gcp.Sql.SslCert("source_sql_client_cert", new()
{
CommonName = "cert",
Instance = sourceCsql.Name,
}, new CustomResourceOptions
{
DependsOn =
{
sourceCsql,
},
});
var sourceSqldbUser = new Gcp.Sql.User("source_sqldb_user", new()
{
Name = "username",
Instance = sourceCsql.Name,
Password = "password",
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqlClientCert,
},
});
var sourceCp = new Gcp.DatabaseMigrationService.ConnectionProfile("source_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "source-cp",
DisplayName = "source-cp_display",
Labels =
{
{ "foo", "bar" },
},
Mysql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfileMysqlArgs
{
Host = sourceCsql.IpAddresses.Apply(ipAddresses => ipAddresses[0].IpAddress),
Port = 3306,
Username = sourceSqldbUser.Name,
Password = sourceSqldbUser.Password,
Ssl = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfileMysqlSslArgs
{
ClientKey = sourceSqlClientCert.PrivateKey,
ClientCertificate = sourceSqlClientCert.Cert,
CaCertificate = sourceSqlClientCert.ServerCaCert,
},
CloudSqlId = "source-csql",
},
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqldbUser,
},
});
var destinationCsql = new Gcp.Sql.DatabaseInstance("destination_csql", new()
{
Name = "destination-csql",
DatabaseVersion = "MYSQL_5_7",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-n1-standard-1",
DeletionProtectionEnabled = false,
},
DeletionProtection = false,
});
var destinationCp = new Gcp.DatabaseMigrationService.ConnectionProfile("destination_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "destination-cp",
DisplayName = "destination-cp_display",
Labels =
{
{ "foo", "bar" },
},
Mysql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfileMysqlArgs
{
CloudSqlId = "destination-csql",
},
}, new CustomResourceOptions
{
DependsOn =
{
destinationCsql,
},
});
var @default = new Gcp.Compute.Network("default", new()
{
Name = "destination-csql",
});
var mysqltomysql = new Gcp.DatabaseMigrationService.MigrationJob("mysqltomysql", new()
{
Location = "us-central1",
MigrationJobId = "my-migrationid",
DisplayName = "my-migrationid_display",
Labels =
{
{ "foo", "bar" },
},
PerformanceConfig = new Gcp.DatabaseMigrationService.Inputs.MigrationJobPerformanceConfigArgs
{
DumpParallelLevel = "MAX",
},
VpcPeeringConnectivity = new Gcp.DatabaseMigrationService.Inputs.MigrationJobVpcPeeringConnectivityArgs
{
Vpc = @default.Id,
},
DumpType = "LOGICAL",
DumpFlags = new Gcp.DatabaseMigrationService.Inputs.MigrationJobDumpFlagsArgs
{
DumpFlags = new[]
{
new Gcp.DatabaseMigrationService.Inputs.MigrationJobDumpFlagsDumpFlagArgs
{
Name = "max-allowed-packet",
Value = "1073741824",
},
},
},
Source = sourceCp.Name,
Destination = destinationCp.Name,
Type = "CONTINUOUS",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.SslCert;
import com.pulumi.gcp.sql.SslCertArgs;
import com.pulumi.gcp.sql.User;
import com.pulumi.gcp.sql.UserArgs;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfile;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfileArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfileMysqlArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfileMysqlSslArgs;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.databasemigrationservice.MigrationJob;
import com.pulumi.gcp.databasemigrationservice.MigrationJobArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.MigrationJobPerformanceConfigArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.MigrationJobVpcPeeringConnectivityArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.MigrationJobDumpFlagsArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var project = OrganizationsFunctions.getProject();
var sourceCsql = new DatabaseInstance("sourceCsql", DatabaseInstanceArgs.builder()
.name("source-csql")
.databaseVersion("MYSQL_5_7")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-n1-standard-1")
.deletionProtectionEnabled(false)
.build())
.deletionProtection(false)
.build());
var sourceSqlClientCert = new SslCert("sourceSqlClientCert", SslCertArgs.builder()
.commonName("cert")
.instance(sourceCsql.name())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceCsql)
.build());
var sourceSqldbUser = new User("sourceSqldbUser", UserArgs.builder()
.name("username")
.instance(sourceCsql.name())
.password("password")
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqlClientCert)
.build());
var sourceCp = new ConnectionProfile("sourceCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("source-cp")
.displayName("source-cp_display")
.labels(Map.of("foo", "bar"))
.mysql(ConnectionProfileMysqlArgs.builder()
.host(sourceCsql.ipAddresses().applyValue(ipAddresses -> ipAddresses[0].ipAddress()))
.port(3306)
.username(sourceSqldbUser.name())
.password(sourceSqldbUser.password())
.ssl(ConnectionProfileMysqlSslArgs.builder()
.clientKey(sourceSqlClientCert.privateKey())
.clientCertificate(sourceSqlClientCert.cert())
.caCertificate(sourceSqlClientCert.serverCaCert())
.build())
.cloudSqlId("source-csql")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqldbUser)
.build());
var destinationCsql = new DatabaseInstance("destinationCsql", DatabaseInstanceArgs.builder()
.name("destination-csql")
.databaseVersion("MYSQL_5_7")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-n1-standard-1")
.deletionProtectionEnabled(false)
.build())
.deletionProtection(false)
.build());
var destinationCp = new ConnectionProfile("destinationCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("destination-cp")
.displayName("destination-cp_display")
.labels(Map.of("foo", "bar"))
.mysql(ConnectionProfileMysqlArgs.builder()
.cloudSqlId("destination-csql")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(destinationCsql)
.build());
var default_ = new Network("default", NetworkArgs.builder()
.name("destination-csql")
.build());
var mysqltomysql = new MigrationJob("mysqltomysql", MigrationJobArgs.builder()
.location("us-central1")
.migrationJobId("my-migrationid")
.displayName("my-migrationid_display")
.labels(Map.of("foo", "bar"))
.performanceConfig(MigrationJobPerformanceConfigArgs.builder()
.dumpParallelLevel("MAX")
.build())
.vpcPeeringConnectivity(MigrationJobVpcPeeringConnectivityArgs.builder()
.vpc(default_.id())
.build())
.dumpType("LOGICAL")
.dumpFlags(MigrationJobDumpFlagsArgs.builder()
.dumpFlags(MigrationJobDumpFlagsDumpFlagArgs.builder()
.name("max-allowed-packet")
.value("1073741824")
.build())
.build())
.source(sourceCp.name())
.destination(destinationCp.name())
.type("CONTINUOUS")
.build());
}
}
resources:
sourceCsql:
type: gcp:sql:DatabaseInstance
name: source_csql
properties:
name: source-csql
databaseVersion: MYSQL_5_7
settings:
tier: db-n1-standard-1
deletionProtectionEnabled: false
deletionProtection: false
sourceSqlClientCert:
type: gcp:sql:SslCert
name: source_sql_client_cert
properties:
commonName: cert
instance: ${sourceCsql.name}
options:
dependson:
- ${sourceCsql}
sourceSqldbUser:
type: gcp:sql:User
name: source_sqldb_user
properties:
name: username
instance: ${sourceCsql.name}
password: password
options:
dependson:
- ${sourceSqlClientCert}
sourceCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: source_cp
properties:
location: us-central1
connectionProfileId: source-cp
displayName: source-cp_display
labels:
foo: bar
mysql:
host: ${sourceCsql.ipAddresses[0].ipAddress}
port: 3306
username: ${sourceSqldbUser.name}
password: ${sourceSqldbUser.password}
ssl:
clientKey: ${sourceSqlClientCert.privateKey}
clientCertificate: ${sourceSqlClientCert.cert}
caCertificate: ${sourceSqlClientCert.serverCaCert}
cloudSqlId: source-csql
options:
dependson:
- ${sourceSqldbUser}
destinationCsql:
type: gcp:sql:DatabaseInstance
name: destination_csql
properties:
name: destination-csql
databaseVersion: MYSQL_5_7
settings:
tier: db-n1-standard-1
deletionProtectionEnabled: false
deletionProtection: false
destinationCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: destination_cp
properties:
location: us-central1
connectionProfileId: destination-cp
displayName: destination-cp_display
labels:
foo: bar
mysql:
cloudSqlId: destination-csql
options:
dependson:
- ${destinationCsql}
default:
type: gcp:compute:Network
properties:
name: destination-csql
mysqltomysql:
type: gcp:databasemigrationservice:MigrationJob
properties:
location: us-central1
migrationJobId: my-migrationid
displayName: my-migrationid_display
labels:
foo: bar
performanceConfig:
dumpParallelLevel: MAX
vpcPeeringConnectivity:
vpc: ${default.id}
dumpType: LOGICAL
dumpFlags:
dumpFlags:
- name: max-allowed-packet
value: '1073741824'
source: ${sourceCp.name}
destination: ${destinationCp.name}
type: CONTINUOUS
variables:
project:
fn::invoke:
Function: gcp:organizations:getProject
Arguments: {}
Database Migration Service Migration Job Postgres To Postgres
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = gcp.organizations.getProject({});
const sourceCsql = new gcp.sql.DatabaseInstance("source_csql", {
name: "source-csql",
databaseVersion: "POSTGRES_15",
settings: {
tier: "db-custom-2-13312",
deletionProtectionEnabled: false,
},
deletionProtection: false,
});
const sourceSqlClientCert = new gcp.sql.SslCert("source_sql_client_cert", {
commonName: "cert",
instance: sourceCsql.name,
}, {
dependsOn: [sourceCsql],
});
const sourceSqldbUser = new gcp.sql.User("source_sqldb_user", {
name: "username",
instance: sourceCsql.name,
password: "password",
}, {
dependsOn: [sourceSqlClientCert],
});
const sourceCp = new gcp.databasemigrationservice.ConnectionProfile("source_cp", {
location: "us-central1",
connectionProfileId: "source-cp",
displayName: "source-cp_display",
labels: {
foo: "bar",
},
postgresql: {
host: sourceCsql.ipAddresses.apply(ipAddresses => ipAddresses[0].ipAddress),
port: 3306,
username: sourceSqldbUser.name,
password: sourceSqldbUser.password,
ssl: {
clientKey: sourceSqlClientCert.privateKey,
clientCertificate: sourceSqlClientCert.cert,
caCertificate: sourceSqlClientCert.serverCaCert,
},
cloudSqlId: "source-csql",
},
}, {
dependsOn: [sourceSqldbUser],
});
const destinationCsql = new gcp.sql.DatabaseInstance("destination_csql", {
name: "destination-csql",
databaseVersion: "POSTGRES_15",
settings: {
tier: "db-custom-2-13312",
deletionProtectionEnabled: false,
},
deletionProtection: false,
});
const destinationCp = new gcp.databasemigrationservice.ConnectionProfile("destination_cp", {
location: "us-central1",
connectionProfileId: "destination-cp",
displayName: "destination-cp_display",
labels: {
foo: "bar",
},
postgresql: {
cloudSqlId: "destination-csql",
},
}, {
dependsOn: [destinationCsql],
});
const psqltopsql = new gcp.databasemigrationservice.MigrationJob("psqltopsql", {
location: "us-central1",
migrationJobId: "my-migrationid",
displayName: "my-migrationid_display",
labels: {
foo: "bar",
},
staticIpConnectivity: {},
source: sourceCp.name,
destination: destinationCp.name,
type: "CONTINUOUS",
});
import pulumi
import pulumi_gcp as gcp
project = gcp.organizations.get_project()
source_csql = gcp.sql.DatabaseInstance("source_csql",
name="source-csql",
database_version="POSTGRES_15",
settings={
"tier": "db-custom-2-13312",
"deletion_protection_enabled": False,
},
deletion_protection=False)
source_sql_client_cert = gcp.sql.SslCert("source_sql_client_cert",
common_name="cert",
instance=source_csql.name,
opts = pulumi.ResourceOptions(depends_on=[source_csql]))
source_sqldb_user = gcp.sql.User("source_sqldb_user",
name="username",
instance=source_csql.name,
password="password",
opts = pulumi.ResourceOptions(depends_on=[source_sql_client_cert]))
source_cp = gcp.databasemigrationservice.ConnectionProfile("source_cp",
location="us-central1",
connection_profile_id="source-cp",
display_name="source-cp_display",
labels={
"foo": "bar",
},
postgresql={
"host": source_csql.ip_addresses[0].ip_address,
"port": 3306,
"username": source_sqldb_user.name,
"password": source_sqldb_user.password,
"ssl": {
"client_key": source_sql_client_cert.private_key,
"client_certificate": source_sql_client_cert.cert,
"ca_certificate": source_sql_client_cert.server_ca_cert,
},
"cloud_sql_id": "source-csql",
},
opts = pulumi.ResourceOptions(depends_on=[source_sqldb_user]))
destination_csql = gcp.sql.DatabaseInstance("destination_csql",
name="destination-csql",
database_version="POSTGRES_15",
settings={
"tier": "db-custom-2-13312",
"deletion_protection_enabled": False,
},
deletion_protection=False)
destination_cp = gcp.databasemigrationservice.ConnectionProfile("destination_cp",
location="us-central1",
connection_profile_id="destination-cp",
display_name="destination-cp_display",
labels={
"foo": "bar",
},
postgresql={
"cloud_sql_id": "destination-csql",
},
opts = pulumi.ResourceOptions(depends_on=[destination_csql]))
psqltopsql = gcp.databasemigrationservice.MigrationJob("psqltopsql",
location="us-central1",
migration_job_id="my-migrationid",
display_name="my-migrationid_display",
labels={
"foo": "bar",
},
static_ip_connectivity={},
source=source_cp.name,
destination=destination_cp.name,
type="CONTINUOUS")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/databasemigrationservice"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
if err != nil {
return err
}
sourceCsql, err := sql.NewDatabaseInstance(ctx, "source_csql", &sql.DatabaseInstanceArgs{
Name: pulumi.String("source-csql"),
DatabaseVersion: pulumi.String("POSTGRES_15"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-custom-2-13312"),
DeletionProtectionEnabled: pulumi.Bool(false),
},
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
sourceSqlClientCert, err := sql.NewSslCert(ctx, "source_sql_client_cert", &sql.SslCertArgs{
CommonName: pulumi.String("cert"),
Instance: sourceCsql.Name,
}, pulumi.DependsOn([]pulumi.Resource{
sourceCsql,
}))
if err != nil {
return err
}
sourceSqldbUser, err := sql.NewUser(ctx, "source_sqldb_user", &sql.UserArgs{
Name: pulumi.String("username"),
Instance: sourceCsql.Name,
Password: pulumi.String("password"),
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqlClientCert,
}))
if err != nil {
return err
}
sourceCp, err := databasemigrationservice.NewConnectionProfile(ctx, "source_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("source-cp"),
DisplayName: pulumi.String("source-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Postgresql: &databasemigrationservice.ConnectionProfilePostgresqlArgs{
Host: sourceCsql.IpAddresses.ApplyT(func(ipAddresses []sql.DatabaseInstanceIpAddress) (*string, error) {
return &ipAddresses[0].IpAddress, nil
}).(pulumi.StringPtrOutput),
Port: pulumi.Int(3306),
Username: sourceSqldbUser.Name,
Password: sourceSqldbUser.Password,
Ssl: &databasemigrationservice.ConnectionProfilePostgresqlSslArgs{
ClientKey: sourceSqlClientCert.PrivateKey,
ClientCertificate: sourceSqlClientCert.Cert,
CaCertificate: sourceSqlClientCert.ServerCaCert,
},
CloudSqlId: pulumi.String("source-csql"),
},
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqldbUser,
}))
if err != nil {
return err
}
destinationCsql, err := sql.NewDatabaseInstance(ctx, "destination_csql", &sql.DatabaseInstanceArgs{
Name: pulumi.String("destination-csql"),
DatabaseVersion: pulumi.String("POSTGRES_15"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-custom-2-13312"),
DeletionProtectionEnabled: pulumi.Bool(false),
},
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
destinationCp, err := databasemigrationservice.NewConnectionProfile(ctx, "destination_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("destination-cp"),
DisplayName: pulumi.String("destination-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Postgresql: &databasemigrationservice.ConnectionProfilePostgresqlArgs{
CloudSqlId: pulumi.String("destination-csql"),
},
}, pulumi.DependsOn([]pulumi.Resource{
destinationCsql,
}))
if err != nil {
return err
}
_, err = databasemigrationservice.NewMigrationJob(ctx, "psqltopsql", &databasemigrationservice.MigrationJobArgs{
Location: pulumi.String("us-central1"),
MigrationJobId: pulumi.String("my-migrationid"),
DisplayName: pulumi.String("my-migrationid_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
StaticIpConnectivity: &databasemigrationservice.MigrationJobStaticIpConnectivityArgs{},
Source: sourceCp.Name,
Destination: destinationCp.Name,
Type: pulumi.String("CONTINUOUS"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = Gcp.Organizations.GetProject.Invoke();
var sourceCsql = new Gcp.Sql.DatabaseInstance("source_csql", new()
{
Name = "source-csql",
DatabaseVersion = "POSTGRES_15",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-custom-2-13312",
DeletionProtectionEnabled = false,
},
DeletionProtection = false,
});
var sourceSqlClientCert = new Gcp.Sql.SslCert("source_sql_client_cert", new()
{
CommonName = "cert",
Instance = sourceCsql.Name,
}, new CustomResourceOptions
{
DependsOn =
{
sourceCsql,
},
});
var sourceSqldbUser = new Gcp.Sql.User("source_sqldb_user", new()
{
Name = "username",
Instance = sourceCsql.Name,
Password = "password",
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqlClientCert,
},
});
var sourceCp = new Gcp.DatabaseMigrationService.ConnectionProfile("source_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "source-cp",
DisplayName = "source-cp_display",
Labels =
{
{ "foo", "bar" },
},
Postgresql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlArgs
{
Host = sourceCsql.IpAddresses.Apply(ipAddresses => ipAddresses[0].IpAddress),
Port = 3306,
Username = sourceSqldbUser.Name,
Password = sourceSqldbUser.Password,
Ssl = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlSslArgs
{
ClientKey = sourceSqlClientCert.PrivateKey,
ClientCertificate = sourceSqlClientCert.Cert,
CaCertificate = sourceSqlClientCert.ServerCaCert,
},
CloudSqlId = "source-csql",
},
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqldbUser,
},
});
var destinationCsql = new Gcp.Sql.DatabaseInstance("destination_csql", new()
{
Name = "destination-csql",
DatabaseVersion = "POSTGRES_15",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-custom-2-13312",
DeletionProtectionEnabled = false,
},
DeletionProtection = false,
});
var destinationCp = new Gcp.DatabaseMigrationService.ConnectionProfile("destination_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "destination-cp",
DisplayName = "destination-cp_display",
Labels =
{
{ "foo", "bar" },
},
Postgresql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlArgs
{
CloudSqlId = "destination-csql",
},
}, new CustomResourceOptions
{
DependsOn =
{
destinationCsql,
},
});
var psqltopsql = new Gcp.DatabaseMigrationService.MigrationJob("psqltopsql", new()
{
Location = "us-central1",
MigrationJobId = "my-migrationid",
DisplayName = "my-migrationid_display",
Labels =
{
{ "foo", "bar" },
},
StaticIpConnectivity = null,
Source = sourceCp.Name,
Destination = destinationCp.Name,
Type = "CONTINUOUS",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.SslCert;
import com.pulumi.gcp.sql.SslCertArgs;
import com.pulumi.gcp.sql.User;
import com.pulumi.gcp.sql.UserArgs;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfile;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfileArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfilePostgresqlArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfilePostgresqlSslArgs;
import com.pulumi.gcp.databasemigrationservice.MigrationJob;
import com.pulumi.gcp.databasemigrationservice.MigrationJobArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.MigrationJobStaticIpConnectivityArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var project = OrganizationsFunctions.getProject();
var sourceCsql = new DatabaseInstance("sourceCsql", DatabaseInstanceArgs.builder()
.name("source-csql")
.databaseVersion("POSTGRES_15")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-custom-2-13312")
.deletionProtectionEnabled(false)
.build())
.deletionProtection(false)
.build());
var sourceSqlClientCert = new SslCert("sourceSqlClientCert", SslCertArgs.builder()
.commonName("cert")
.instance(sourceCsql.name())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceCsql)
.build());
var sourceSqldbUser = new User("sourceSqldbUser", UserArgs.builder()
.name("username")
.instance(sourceCsql.name())
.password("password")
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqlClientCert)
.build());
var sourceCp = new ConnectionProfile("sourceCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("source-cp")
.displayName("source-cp_display")
.labels(Map.of("foo", "bar"))
.postgresql(ConnectionProfilePostgresqlArgs.builder()
.host(sourceCsql.ipAddresses().applyValue(ipAddresses -> ipAddresses[0].ipAddress()))
.port(3306)
.username(sourceSqldbUser.name())
.password(sourceSqldbUser.password())
.ssl(ConnectionProfilePostgresqlSslArgs.builder()
.clientKey(sourceSqlClientCert.privateKey())
.clientCertificate(sourceSqlClientCert.cert())
.caCertificate(sourceSqlClientCert.serverCaCert())
.build())
.cloudSqlId("source-csql")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqldbUser)
.build());
var destinationCsql = new DatabaseInstance("destinationCsql", DatabaseInstanceArgs.builder()
.name("destination-csql")
.databaseVersion("POSTGRES_15")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-custom-2-13312")
.deletionProtectionEnabled(false)
.build())
.deletionProtection(false)
.build());
var destinationCp = new ConnectionProfile("destinationCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("destination-cp")
.displayName("destination-cp_display")
.labels(Map.of("foo", "bar"))
.postgresql(ConnectionProfilePostgresqlArgs.builder()
.cloudSqlId("destination-csql")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(destinationCsql)
.build());
var psqltopsql = new MigrationJob("psqltopsql", MigrationJobArgs.builder()
.location("us-central1")
.migrationJobId("my-migrationid")
.displayName("my-migrationid_display")
.labels(Map.of("foo", "bar"))
.staticIpConnectivity()
.source(sourceCp.name())
.destination(destinationCp.name())
.type("CONTINUOUS")
.build());
}
}
resources:
sourceCsql:
type: gcp:sql:DatabaseInstance
name: source_csql
properties:
name: source-csql
databaseVersion: POSTGRES_15
settings:
tier: db-custom-2-13312
deletionProtectionEnabled: false
deletionProtection: false
sourceSqlClientCert:
type: gcp:sql:SslCert
name: source_sql_client_cert
properties:
commonName: cert
instance: ${sourceCsql.name}
options:
dependson:
- ${sourceCsql}
sourceSqldbUser:
type: gcp:sql:User
name: source_sqldb_user
properties:
name: username
instance: ${sourceCsql.name}
password: password
options:
dependson:
- ${sourceSqlClientCert}
sourceCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: source_cp
properties:
location: us-central1
connectionProfileId: source-cp
displayName: source-cp_display
labels:
foo: bar
postgresql:
host: ${sourceCsql.ipAddresses[0].ipAddress}
port: 3306
username: ${sourceSqldbUser.name}
password: ${sourceSqldbUser.password}
ssl:
clientKey: ${sourceSqlClientCert.privateKey}
clientCertificate: ${sourceSqlClientCert.cert}
caCertificate: ${sourceSqlClientCert.serverCaCert}
cloudSqlId: source-csql
options:
dependson:
- ${sourceSqldbUser}
destinationCsql:
type: gcp:sql:DatabaseInstance
name: destination_csql
properties:
name: destination-csql
databaseVersion: POSTGRES_15
settings:
tier: db-custom-2-13312
deletionProtectionEnabled: false
deletionProtection: false
destinationCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: destination_cp
properties:
location: us-central1
connectionProfileId: destination-cp
displayName: destination-cp_display
labels:
foo: bar
postgresql:
cloudSqlId: destination-csql
options:
dependson:
- ${destinationCsql}
psqltopsql:
type: gcp:databasemigrationservice:MigrationJob
properties:
location: us-central1
migrationJobId: my-migrationid
displayName: my-migrationid_display
labels:
foo: bar
staticIpConnectivity: {}
source: ${sourceCp.name}
destination: ${destinationCp.name}
type: CONTINUOUS
variables:
project:
fn::invoke:
Function: gcp:organizations:getProject
Arguments: {}
Database Migration Service Migration Job Postgres To Alloydb
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = gcp.organizations.getProject({});
const sourceCsql = new gcp.sql.DatabaseInstance("source_csql", {
name: "source-csql",
databaseVersion: "POSTGRES_15",
settings: {
tier: "db-custom-2-13312",
deletionProtectionEnabled: false,
},
deletionProtection: false,
});
const sourceSqlClientCert = new gcp.sql.SslCert("source_sql_client_cert", {
commonName: "cert",
instance: sourceCsql.name,
}, {
dependsOn: [sourceCsql],
});
const sourceSqldbUser = new gcp.sql.User("source_sqldb_user", {
name: "username",
instance: sourceCsql.name,
password: "password",
}, {
dependsOn: [sourceSqlClientCert],
});
const sourceCp = new gcp.databasemigrationservice.ConnectionProfile("source_cp", {
location: "us-central1",
connectionProfileId: "source-cp",
displayName: "source-cp_display",
labels: {
foo: "bar",
},
postgresql: {
host: sourceCsql.ipAddresses.apply(ipAddresses => ipAddresses[0].ipAddress),
port: 3306,
username: sourceSqldbUser.name,
password: sourceSqldbUser.password,
ssl: {
clientKey: sourceSqlClientCert.privateKey,
clientCertificate: sourceSqlClientCert.cert,
caCertificate: sourceSqlClientCert.serverCaCert,
},
cloudSqlId: "source-csql",
},
}, {
dependsOn: [sourceSqldbUser],
});
const _default = new gcp.compute.Network("default", {name: "destination-alloydb"});
const destinationAlloydb = new gcp.alloydb.Cluster("destination_alloydb", {
clusterId: "destination-alloydb",
location: "us-central1",
networkConfig: {
network: _default.id,
},
databaseVersion: "POSTGRES_15",
initialUser: {
user: "destination-alloydb",
password: "destination-alloydb",
},
});
const privateIpAlloc = new gcp.compute.GlobalAddress("private_ip_alloc", {
name: "destination-alloydb",
addressType: "INTERNAL",
purpose: "VPC_PEERING",
prefixLength: 16,
network: _default.id,
});
const vpcConnection = new gcp.servicenetworking.Connection("vpc_connection", {
network: _default.id,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [privateIpAlloc.name],
});
const destinationAlloydbPrimary = new gcp.alloydb.Instance("destination_alloydb_primary", {
cluster: destinationAlloydb.name,
instanceId: "destination-alloydb-primary",
instanceType: "PRIMARY",
}, {
dependsOn: [vpcConnection],
});
const destinationCp = new gcp.databasemigrationservice.ConnectionProfile("destination_cp", {
location: "us-central1",
connectionProfileId: "destination-cp",
displayName: "destination-cp_display",
labels: {
foo: "bar",
},
postgresql: {
alloydbClusterId: "destination-alloydb",
},
}, {
dependsOn: [
destinationAlloydb,
destinationAlloydbPrimary,
],
});
const psqltoalloydb = new gcp.databasemigrationservice.MigrationJob("psqltoalloydb", {
location: "us-central1",
migrationJobId: "my-migrationid",
displayName: "my-migrationid_display",
labels: {
foo: "bar",
},
staticIpConnectivity: {},
source: sourceCp.name,
destination: destinationCp.name,
type: "CONTINUOUS",
});
import pulumi
import pulumi_gcp as gcp
project = gcp.organizations.get_project()
source_csql = gcp.sql.DatabaseInstance("source_csql",
name="source-csql",
database_version="POSTGRES_15",
settings={
"tier": "db-custom-2-13312",
"deletion_protection_enabled": False,
},
deletion_protection=False)
source_sql_client_cert = gcp.sql.SslCert("source_sql_client_cert",
common_name="cert",
instance=source_csql.name,
opts = pulumi.ResourceOptions(depends_on=[source_csql]))
source_sqldb_user = gcp.sql.User("source_sqldb_user",
name="username",
instance=source_csql.name,
password="password",
opts = pulumi.ResourceOptions(depends_on=[source_sql_client_cert]))
source_cp = gcp.databasemigrationservice.ConnectionProfile("source_cp",
location="us-central1",
connection_profile_id="source-cp",
display_name="source-cp_display",
labels={
"foo": "bar",
},
postgresql={
"host": source_csql.ip_addresses[0].ip_address,
"port": 3306,
"username": source_sqldb_user.name,
"password": source_sqldb_user.password,
"ssl": {
"client_key": source_sql_client_cert.private_key,
"client_certificate": source_sql_client_cert.cert,
"ca_certificate": source_sql_client_cert.server_ca_cert,
},
"cloud_sql_id": "source-csql",
},
opts = pulumi.ResourceOptions(depends_on=[source_sqldb_user]))
default = gcp.compute.Network("default", name="destination-alloydb")
destination_alloydb = gcp.alloydb.Cluster("destination_alloydb",
cluster_id="destination-alloydb",
location="us-central1",
network_config={
"network": default.id,
},
database_version="POSTGRES_15",
initial_user={
"user": "destination-alloydb",
"password": "destination-alloydb",
})
private_ip_alloc = gcp.compute.GlobalAddress("private_ip_alloc",
name="destination-alloydb",
address_type="INTERNAL",
purpose="VPC_PEERING",
prefix_length=16,
network=default.id)
vpc_connection = gcp.servicenetworking.Connection("vpc_connection",
network=default.id,
service="servicenetworking.googleapis.com",
reserved_peering_ranges=[private_ip_alloc.name])
destination_alloydb_primary = gcp.alloydb.Instance("destination_alloydb_primary",
cluster=destination_alloydb.name,
instance_id="destination-alloydb-primary",
instance_type="PRIMARY",
opts = pulumi.ResourceOptions(depends_on=[vpc_connection]))
destination_cp = gcp.databasemigrationservice.ConnectionProfile("destination_cp",
location="us-central1",
connection_profile_id="destination-cp",
display_name="destination-cp_display",
labels={
"foo": "bar",
},
postgresql={
"alloydb_cluster_id": "destination-alloydb",
},
opts = pulumi.ResourceOptions(depends_on=[
destination_alloydb,
destination_alloydb_primary,
]))
psqltoalloydb = gcp.databasemigrationservice.MigrationJob("psqltoalloydb",
location="us-central1",
migration_job_id="my-migrationid",
display_name="my-migrationid_display",
labels={
"foo": "bar",
},
static_ip_connectivity={},
source=source_cp.name,
destination=destination_cp.name,
type="CONTINUOUS")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/alloydb"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/databasemigrationservice"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/servicenetworking"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/sql"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
if err != nil {
return err
}
sourceCsql, err := sql.NewDatabaseInstance(ctx, "source_csql", &sql.DatabaseInstanceArgs{
Name: pulumi.String("source-csql"),
DatabaseVersion: pulumi.String("POSTGRES_15"),
Settings: &sql.DatabaseInstanceSettingsArgs{
Tier: pulumi.String("db-custom-2-13312"),
DeletionProtectionEnabled: pulumi.Bool(false),
},
DeletionProtection: pulumi.Bool(false),
})
if err != nil {
return err
}
sourceSqlClientCert, err := sql.NewSslCert(ctx, "source_sql_client_cert", &sql.SslCertArgs{
CommonName: pulumi.String("cert"),
Instance: sourceCsql.Name,
}, pulumi.DependsOn([]pulumi.Resource{
sourceCsql,
}))
if err != nil {
return err
}
sourceSqldbUser, err := sql.NewUser(ctx, "source_sqldb_user", &sql.UserArgs{
Name: pulumi.String("username"),
Instance: sourceCsql.Name,
Password: pulumi.String("password"),
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqlClientCert,
}))
if err != nil {
return err
}
sourceCp, err := databasemigrationservice.NewConnectionProfile(ctx, "source_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("source-cp"),
DisplayName: pulumi.String("source-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Postgresql: &databasemigrationservice.ConnectionProfilePostgresqlArgs{
Host: sourceCsql.IpAddresses.ApplyT(func(ipAddresses []sql.DatabaseInstanceIpAddress) (*string, error) {
return &ipAddresses[0].IpAddress, nil
}).(pulumi.StringPtrOutput),
Port: pulumi.Int(3306),
Username: sourceSqldbUser.Name,
Password: sourceSqldbUser.Password,
Ssl: &databasemigrationservice.ConnectionProfilePostgresqlSslArgs{
ClientKey: sourceSqlClientCert.PrivateKey,
ClientCertificate: sourceSqlClientCert.Cert,
CaCertificate: sourceSqlClientCert.ServerCaCert,
},
CloudSqlId: pulumi.String("source-csql"),
},
}, pulumi.DependsOn([]pulumi.Resource{
sourceSqldbUser,
}))
if err != nil {
return err
}
_, err = compute.NewNetwork(ctx, "default", &compute.NetworkArgs{
Name: pulumi.String("destination-alloydb"),
})
if err != nil {
return err
}
destinationAlloydb, err := alloydb.NewCluster(ctx, "destination_alloydb", &alloydb.ClusterArgs{
ClusterId: pulumi.String("destination-alloydb"),
Location: pulumi.String("us-central1"),
NetworkConfig: &alloydb.ClusterNetworkConfigArgs{
Network: _default.ID(),
},
DatabaseVersion: pulumi.String("POSTGRES_15"),
InitialUser: &alloydb.ClusterInitialUserArgs{
User: pulumi.String("destination-alloydb"),
Password: pulumi.String("destination-alloydb"),
},
})
if err != nil {
return err
}
privateIpAlloc, err := compute.NewGlobalAddress(ctx, "private_ip_alloc", &compute.GlobalAddressArgs{
Name: pulumi.String("destination-alloydb"),
AddressType: pulumi.String("INTERNAL"),
Purpose: pulumi.String("VPC_PEERING"),
PrefixLength: pulumi.Int(16),
Network: _default.ID(),
})
if err != nil {
return err
}
vpcConnection, err := servicenetworking.NewConnection(ctx, "vpc_connection", &servicenetworking.ConnectionArgs{
Network: _default.ID(),
Service: pulumi.String("servicenetworking.googleapis.com"),
ReservedPeeringRanges: pulumi.StringArray{
privateIpAlloc.Name,
},
})
if err != nil {
return err
}
destinationAlloydbPrimary, err := alloydb.NewInstance(ctx, "destination_alloydb_primary", &alloydb.InstanceArgs{
Cluster: destinationAlloydb.Name,
InstanceId: pulumi.String("destination-alloydb-primary"),
InstanceType: pulumi.String("PRIMARY"),
}, pulumi.DependsOn([]pulumi.Resource{
vpcConnection,
}))
if err != nil {
return err
}
destinationCp, err := databasemigrationservice.NewConnectionProfile(ctx, "destination_cp", &databasemigrationservice.ConnectionProfileArgs{
Location: pulumi.String("us-central1"),
ConnectionProfileId: pulumi.String("destination-cp"),
DisplayName: pulumi.String("destination-cp_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Postgresql: &databasemigrationservice.ConnectionProfilePostgresqlArgs{
AlloydbClusterId: pulumi.String("destination-alloydb"),
},
}, pulumi.DependsOn([]pulumi.Resource{
destinationAlloydb,
destinationAlloydbPrimary,
}))
if err != nil {
return err
}
_, err = databasemigrationservice.NewMigrationJob(ctx, "psqltoalloydb", &databasemigrationservice.MigrationJobArgs{
Location: pulumi.String("us-central1"),
MigrationJobId: pulumi.String("my-migrationid"),
DisplayName: pulumi.String("my-migrationid_display"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
StaticIpConnectivity: &databasemigrationservice.MigrationJobStaticIpConnectivityArgs{},
Source: sourceCp.Name,
Destination: destinationCp.Name,
Type: pulumi.String("CONTINUOUS"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = Gcp.Organizations.GetProject.Invoke();
var sourceCsql = new Gcp.Sql.DatabaseInstance("source_csql", new()
{
Name = "source-csql",
DatabaseVersion = "POSTGRES_15",
Settings = new Gcp.Sql.Inputs.DatabaseInstanceSettingsArgs
{
Tier = "db-custom-2-13312",
DeletionProtectionEnabled = false,
},
DeletionProtection = false,
});
var sourceSqlClientCert = new Gcp.Sql.SslCert("source_sql_client_cert", new()
{
CommonName = "cert",
Instance = sourceCsql.Name,
}, new CustomResourceOptions
{
DependsOn =
{
sourceCsql,
},
});
var sourceSqldbUser = new Gcp.Sql.User("source_sqldb_user", new()
{
Name = "username",
Instance = sourceCsql.Name,
Password = "password",
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqlClientCert,
},
});
var sourceCp = new Gcp.DatabaseMigrationService.ConnectionProfile("source_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "source-cp",
DisplayName = "source-cp_display",
Labels =
{
{ "foo", "bar" },
},
Postgresql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlArgs
{
Host = sourceCsql.IpAddresses.Apply(ipAddresses => ipAddresses[0].IpAddress),
Port = 3306,
Username = sourceSqldbUser.Name,
Password = sourceSqldbUser.Password,
Ssl = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlSslArgs
{
ClientKey = sourceSqlClientCert.PrivateKey,
ClientCertificate = sourceSqlClientCert.Cert,
CaCertificate = sourceSqlClientCert.ServerCaCert,
},
CloudSqlId = "source-csql",
},
}, new CustomResourceOptions
{
DependsOn =
{
sourceSqldbUser,
},
});
var @default = new Gcp.Compute.Network("default", new()
{
Name = "destination-alloydb",
});
var destinationAlloydb = new Gcp.Alloydb.Cluster("destination_alloydb", new()
{
ClusterId = "destination-alloydb",
Location = "us-central1",
NetworkConfig = new Gcp.Alloydb.Inputs.ClusterNetworkConfigArgs
{
Network = @default.Id,
},
DatabaseVersion = "POSTGRES_15",
InitialUser = new Gcp.Alloydb.Inputs.ClusterInitialUserArgs
{
User = "destination-alloydb",
Password = "destination-alloydb",
},
});
var privateIpAlloc = new Gcp.Compute.GlobalAddress("private_ip_alloc", new()
{
Name = "destination-alloydb",
AddressType = "INTERNAL",
Purpose = "VPC_PEERING",
PrefixLength = 16,
Network = @default.Id,
});
var vpcConnection = new Gcp.ServiceNetworking.Connection("vpc_connection", new()
{
Network = @default.Id,
Service = "servicenetworking.googleapis.com",
ReservedPeeringRanges = new[]
{
privateIpAlloc.Name,
},
});
var destinationAlloydbPrimary = new Gcp.Alloydb.Instance("destination_alloydb_primary", new()
{
Cluster = destinationAlloydb.Name,
InstanceId = "destination-alloydb-primary",
InstanceType = "PRIMARY",
}, new CustomResourceOptions
{
DependsOn =
{
vpcConnection,
},
});
var destinationCp = new Gcp.DatabaseMigrationService.ConnectionProfile("destination_cp", new()
{
Location = "us-central1",
ConnectionProfileId = "destination-cp",
DisplayName = "destination-cp_display",
Labels =
{
{ "foo", "bar" },
},
Postgresql = new Gcp.DatabaseMigrationService.Inputs.ConnectionProfilePostgresqlArgs
{
AlloydbClusterId = "destination-alloydb",
},
}, new CustomResourceOptions
{
DependsOn =
{
destinationAlloydb,
destinationAlloydbPrimary,
},
});
var psqltoalloydb = new Gcp.DatabaseMigrationService.MigrationJob("psqltoalloydb", new()
{
Location = "us-central1",
MigrationJobId = "my-migrationid",
DisplayName = "my-migrationid_display",
Labels =
{
{ "foo", "bar" },
},
StaticIpConnectivity = null,
Source = sourceCp.Name,
Destination = destinationCp.Name,
Type = "CONTINUOUS",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.sql.DatabaseInstance;
import com.pulumi.gcp.sql.DatabaseInstanceArgs;
import com.pulumi.gcp.sql.inputs.DatabaseInstanceSettingsArgs;
import com.pulumi.gcp.sql.SslCert;
import com.pulumi.gcp.sql.SslCertArgs;
import com.pulumi.gcp.sql.User;
import com.pulumi.gcp.sql.UserArgs;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfile;
import com.pulumi.gcp.databasemigrationservice.ConnectionProfileArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfilePostgresqlArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.ConnectionProfilePostgresqlSslArgs;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.alloydb.Cluster;
import com.pulumi.gcp.alloydb.ClusterArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterNetworkConfigArgs;
import com.pulumi.gcp.alloydb.inputs.ClusterInitialUserArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.alloydb.Instance;
import com.pulumi.gcp.alloydb.InstanceArgs;
import com.pulumi.gcp.databasemigrationservice.MigrationJob;
import com.pulumi.gcp.databasemigrationservice.MigrationJobArgs;
import com.pulumi.gcp.databasemigrationservice.inputs.MigrationJobStaticIpConnectivityArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var project = OrganizationsFunctions.getProject();
var sourceCsql = new DatabaseInstance("sourceCsql", DatabaseInstanceArgs.builder()
.name("source-csql")
.databaseVersion("POSTGRES_15")
.settings(DatabaseInstanceSettingsArgs.builder()
.tier("db-custom-2-13312")
.deletionProtectionEnabled(false)
.build())
.deletionProtection(false)
.build());
var sourceSqlClientCert = new SslCert("sourceSqlClientCert", SslCertArgs.builder()
.commonName("cert")
.instance(sourceCsql.name())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceCsql)
.build());
var sourceSqldbUser = new User("sourceSqldbUser", UserArgs.builder()
.name("username")
.instance(sourceCsql.name())
.password("password")
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqlClientCert)
.build());
var sourceCp = new ConnectionProfile("sourceCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("source-cp")
.displayName("source-cp_display")
.labels(Map.of("foo", "bar"))
.postgresql(ConnectionProfilePostgresqlArgs.builder()
.host(sourceCsql.ipAddresses().applyValue(ipAddresses -> ipAddresses[0].ipAddress()))
.port(3306)
.username(sourceSqldbUser.name())
.password(sourceSqldbUser.password())
.ssl(ConnectionProfilePostgresqlSslArgs.builder()
.clientKey(sourceSqlClientCert.privateKey())
.clientCertificate(sourceSqlClientCert.cert())
.caCertificate(sourceSqlClientCert.serverCaCert())
.build())
.cloudSqlId("source-csql")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(sourceSqldbUser)
.build());
var default_ = new Network("default", NetworkArgs.builder()
.name("destination-alloydb")
.build());
var destinationAlloydb = new Cluster("destinationAlloydb", ClusterArgs.builder()
.clusterId("destination-alloydb")
.location("us-central1")
.networkConfig(ClusterNetworkConfigArgs.builder()
.network(default_.id())
.build())
.databaseVersion("POSTGRES_15")
.initialUser(ClusterInitialUserArgs.builder()
.user("destination-alloydb")
.password("destination-alloydb")
.build())
.build());
var privateIpAlloc = new GlobalAddress("privateIpAlloc", GlobalAddressArgs.builder()
.name("destination-alloydb")
.addressType("INTERNAL")
.purpose("VPC_PEERING")
.prefixLength(16)
.network(default_.id())
.build());
var vpcConnection = new Connection("vpcConnection", ConnectionArgs.builder()
.network(default_.id())
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(privateIpAlloc.name())
.build());
var destinationAlloydbPrimary = new Instance("destinationAlloydbPrimary", InstanceArgs.builder()
.cluster(destinationAlloydb.name())
.instanceId("destination-alloydb-primary")
.instanceType("PRIMARY")
.build(), CustomResourceOptions.builder()
.dependsOn(vpcConnection)
.build());
var destinationCp = new ConnectionProfile("destinationCp", ConnectionProfileArgs.builder()
.location("us-central1")
.connectionProfileId("destination-cp")
.displayName("destination-cp_display")
.labels(Map.of("foo", "bar"))
.postgresql(ConnectionProfilePostgresqlArgs.builder()
.alloydbClusterId("destination-alloydb")
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(
destinationAlloydb,
destinationAlloydbPrimary)
.build());
var psqltoalloydb = new MigrationJob("psqltoalloydb", MigrationJobArgs.builder()
.location("us-central1")
.migrationJobId("my-migrationid")
.displayName("my-migrationid_display")
.labels(Map.of("foo", "bar"))
.staticIpConnectivity()
.source(sourceCp.name())
.destination(destinationCp.name())
.type("CONTINUOUS")
.build());
}
}
resources:
sourceCsql:
type: gcp:sql:DatabaseInstance
name: source_csql
properties:
name: source-csql
databaseVersion: POSTGRES_15
settings:
tier: db-custom-2-13312
deletionProtectionEnabled: false
deletionProtection: false
sourceSqlClientCert:
type: gcp:sql:SslCert
name: source_sql_client_cert
properties:
commonName: cert
instance: ${sourceCsql.name}
options:
dependson:
- ${sourceCsql}
sourceSqldbUser:
type: gcp:sql:User
name: source_sqldb_user
properties:
name: username
instance: ${sourceCsql.name}
password: password
options:
dependson:
- ${sourceSqlClientCert}
sourceCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: source_cp
properties:
location: us-central1
connectionProfileId: source-cp
displayName: source-cp_display
labels:
foo: bar
postgresql:
host: ${sourceCsql.ipAddresses[0].ipAddress}
port: 3306
username: ${sourceSqldbUser.name}
password: ${sourceSqldbUser.password}
ssl:
clientKey: ${sourceSqlClientCert.privateKey}
clientCertificate: ${sourceSqlClientCert.cert}
caCertificate: ${sourceSqlClientCert.serverCaCert}
cloudSqlId: source-csql
options:
dependson:
- ${sourceSqldbUser}
destinationAlloydb:
type: gcp:alloydb:Cluster
name: destination_alloydb
properties:
clusterId: destination-alloydb
location: us-central1
networkConfig:
network: ${default.id}
databaseVersion: POSTGRES_15
initialUser:
user: destination-alloydb
password: destination-alloydb
destinationAlloydbPrimary:
type: gcp:alloydb:Instance
name: destination_alloydb_primary
properties:
cluster: ${destinationAlloydb.name}
instanceId: destination-alloydb-primary
instanceType: PRIMARY
options:
dependson:
- ${vpcConnection}
privateIpAlloc:
type: gcp:compute:GlobalAddress
name: private_ip_alloc
properties:
name: destination-alloydb
addressType: INTERNAL
purpose: VPC_PEERING
prefixLength: 16
network: ${default.id}
vpcConnection:
type: gcp:servicenetworking:Connection
name: vpc_connection
properties:
network: ${default.id}
service: servicenetworking.googleapis.com
reservedPeeringRanges:
- ${privateIpAlloc.name}
default:
type: gcp:compute:Network
properties:
name: destination-alloydb
destinationCp:
type: gcp:databasemigrationservice:ConnectionProfile
name: destination_cp
properties:
location: us-central1
connectionProfileId: destination-cp
displayName: destination-cp_display
labels:
foo: bar
postgresql:
alloydbClusterId: destination-alloydb
options:
dependson:
- ${destinationAlloydb}
- ${destinationAlloydbPrimary}
psqltoalloydb:
type: gcp:databasemigrationservice:MigrationJob
properties:
location: us-central1
migrationJobId: my-migrationid
displayName: my-migrationid_display
labels:
foo: bar
staticIpConnectivity: {}
source: ${sourceCp.name}
destination: ${destinationCp.name}
type: CONTINUOUS
variables:
project:
fn::invoke:
Function: gcp:organizations:getProject
Arguments: {}
Create MigrationJob Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MigrationJob(name: string, args: MigrationJobArgs, opts?: CustomResourceOptions);
@overload
def MigrationJob(resource_name: str,
args: MigrationJobArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MigrationJob(resource_name: str,
opts: Optional[ResourceOptions] = None,
destination: Optional[str] = None,
type: Optional[str] = None,
source: Optional[str] = None,
migration_job_id: Optional[str] = None,
location: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
dump_type: Optional[str] = None,
dump_path: Optional[str] = None,
performance_config: Optional[MigrationJobPerformanceConfigArgs] = None,
project: Optional[str] = None,
reverse_ssh_connectivity: Optional[MigrationJobReverseSshConnectivityArgs] = None,
dump_flags: Optional[MigrationJobDumpFlagsArgs] = None,
static_ip_connectivity: Optional[MigrationJobStaticIpConnectivityArgs] = None,
display_name: Optional[str] = None,
vpc_peering_connectivity: Optional[MigrationJobVpcPeeringConnectivityArgs] = None)
func NewMigrationJob(ctx *Context, name string, args MigrationJobArgs, opts ...ResourceOption) (*MigrationJob, error)
public MigrationJob(string name, MigrationJobArgs args, CustomResourceOptions? opts = null)
public MigrationJob(String name, MigrationJobArgs args)
public MigrationJob(String name, MigrationJobArgs args, CustomResourceOptions options)
type: gcp:databasemigrationservice:MigrationJob
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MigrationJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MigrationJobArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MigrationJobArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MigrationJobArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MigrationJobArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var migrationJobResource = new Gcp.DatabaseMigrationService.MigrationJob("migrationJobResource", new()
{
Destination = "string",
Type = "string",
Source = "string",
MigrationJobId = "string",
Location = "string",
Labels =
{
{ "string", "string" },
},
DumpType = "string",
DumpPath = "string",
PerformanceConfig = new Gcp.DatabaseMigrationService.Inputs.MigrationJobPerformanceConfigArgs
{
DumpParallelLevel = "string",
},
Project = "string",
ReverseSshConnectivity = new Gcp.DatabaseMigrationService.Inputs.MigrationJobReverseSshConnectivityArgs
{
Vm = "string",
VmIp = "string",
VmPort = 0,
Vpc = "string",
},
DumpFlags = new Gcp.DatabaseMigrationService.Inputs.MigrationJobDumpFlagsArgs
{
DumpFlags = new[]
{
new Gcp.DatabaseMigrationService.Inputs.MigrationJobDumpFlagsDumpFlagArgs
{
Name = "string",
Value = "string",
},
},
},
StaticIpConnectivity = null,
DisplayName = "string",
VpcPeeringConnectivity = new Gcp.DatabaseMigrationService.Inputs.MigrationJobVpcPeeringConnectivityArgs
{
Vpc = "string",
},
});
example, err := databasemigrationservice.NewMigrationJob(ctx, "migrationJobResource", &databasemigrationservice.MigrationJobArgs{
Destination: pulumi.String("string"),
Type: pulumi.String("string"),
Source: pulumi.String("string"),
MigrationJobId: pulumi.String("string"),
Location: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
DumpType: pulumi.String("string"),
DumpPath: pulumi.String("string"),
PerformanceConfig: &databasemigrationservice.MigrationJobPerformanceConfigArgs{
DumpParallelLevel: pulumi.String("string"),
},
Project: pulumi.String("string"),
ReverseSshConnectivity: &databasemigrationservice.MigrationJobReverseSshConnectivityArgs{
Vm: pulumi.String("string"),
VmIp: pulumi.String("string"),
VmPort: pulumi.Int(0),
Vpc: pulumi.String("string"),
},
DumpFlags: &databasemigrationservice.MigrationJobDumpFlagsArgs{
DumpFlags: databasemigrationservice.MigrationJobDumpFlagsDumpFlagArray{
&databasemigrationservice.MigrationJobDumpFlagsDumpFlagArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
StaticIpConnectivity: &databasemigrationservice.MigrationJobStaticIpConnectivityArgs{},
DisplayName: pulumi.String("string"),
VpcPeeringConnectivity: &databasemigrationservice.MigrationJobVpcPeeringConnectivityArgs{
Vpc: pulumi.String("string"),
},
})
var migrationJobResource = new MigrationJob("migrationJobResource", MigrationJobArgs.builder()
.destination("string")
.type("string")
.source("string")
.migrationJobId("string")
.location("string")
.labels(Map.of("string", "string"))
.dumpType("string")
.dumpPath("string")
.performanceConfig(MigrationJobPerformanceConfigArgs.builder()
.dumpParallelLevel("string")
.build())
.project("string")
.reverseSshConnectivity(MigrationJobReverseSshConnectivityArgs.builder()
.vm("string")
.vmIp("string")
.vmPort(0)
.vpc("string")
.build())
.dumpFlags(MigrationJobDumpFlagsArgs.builder()
.dumpFlags(MigrationJobDumpFlagsDumpFlagArgs.builder()
.name("string")
.value("string")
.build())
.build())
.staticIpConnectivity()
.displayName("string")
.vpcPeeringConnectivity(MigrationJobVpcPeeringConnectivityArgs.builder()
.vpc("string")
.build())
.build());
migration_job_resource = gcp.databasemigrationservice.MigrationJob("migrationJobResource",
destination="string",
type="string",
source="string",
migration_job_id="string",
location="string",
labels={
"string": "string",
},
dump_type="string",
dump_path="string",
performance_config={
"dump_parallel_level": "string",
},
project="string",
reverse_ssh_connectivity={
"vm": "string",
"vm_ip": "string",
"vm_port": 0,
"vpc": "string",
},
dump_flags={
"dump_flags": [{
"name": "string",
"value": "string",
}],
},
static_ip_connectivity={},
display_name="string",
vpc_peering_connectivity={
"vpc": "string",
})
const migrationJobResource = new gcp.databasemigrationservice.MigrationJob("migrationJobResource", {
destination: "string",
type: "string",
source: "string",
migrationJobId: "string",
location: "string",
labels: {
string: "string",
},
dumpType: "string",
dumpPath: "string",
performanceConfig: {
dumpParallelLevel: "string",
},
project: "string",
reverseSshConnectivity: {
vm: "string",
vmIp: "string",
vmPort: 0,
vpc: "string",
},
dumpFlags: {
dumpFlags: [{
name: "string",
value: "string",
}],
},
staticIpConnectivity: {},
displayName: "string",
vpcPeeringConnectivity: {
vpc: "string",
},
});
type: gcp:databasemigrationservice:MigrationJob
properties:
destination: string
displayName: string
dumpFlags:
dumpFlags:
- name: string
value: string
dumpPath: string
dumpType: string
labels:
string: string
location: string
migrationJobId: string
performanceConfig:
dumpParallelLevel: string
project: string
reverseSshConnectivity:
vm: string
vmIp: string
vmPort: 0
vpc: string
source: string
staticIpConnectivity: {}
type: string
vpcPeeringConnectivity:
vpc: string
MigrationJob Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MigrationJob resource accepts the following input properties:
- Destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- Migration
Job stringId - The ID of the migration job.
- Source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- Type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - Display
Name string - The migration job display name.
- Dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- Dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- Dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - Labels Dictionary<string, string>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- Location string
- The location where the migration job should reside.
- Performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- Static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - Vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- Destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- Migration
Job stringId - The ID of the migration job.
- Source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- Type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - Display
Name string - The migration job display name.
- Dump
Flags MigrationJob Dump Flags Args - The initial dump flags. Structure is documented below.
- Dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- Dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - Labels map[string]string
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- Location string
- The location where the migration job should reside.
- Performance
Config MigrationJob Performance Config Args - Data dump parallelism settings used by the migration. Structure is documented below.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- Static
Ip MigrationConnectivity Job Static Ip Connectivity Args - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - Vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- destination String
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- migration
Job StringId - The ID of the migration job.
- source String
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- type String
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - display
Name String - The migration job display name.
- dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- dump
Path String - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type String - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - labels Map<String,String>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location String
- The location where the migration job should reside.
- performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- migration
Job stringId - The ID of the migration job.
- source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - display
Name string - The migration job display name.
- dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - labels {[key: string]: string}
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location string
- The location where the migration job should reside.
- performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- destination str
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- migration_
job_ strid - The ID of the migration job.
- source str
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- type str
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - display_
name str - The migration job display name.
- dump_
flags MigrationJob Dump Flags Args - The initial dump flags. Structure is documented below.
- dump_
path str - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump_
type str - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - labels Mapping[str, str]
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location str
- The location where the migration job should reside.
- performance_
config MigrationJob Performance Config Args - Data dump parallelism settings used by the migration. Structure is documented below.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- reverse_
ssh_ Migrationconnectivity Job Reverse Ssh Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- static_
ip_ Migrationconnectivity Job Static Ip Connectivity Args - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - vpc_
peering_ Migrationconnectivity Job Vpc Peering Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- destination String
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- migration
Job StringId - The ID of the migration job.
- source String
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- type String
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - display
Name String - The migration job display name.
- dump
Flags Property Map - The initial dump flags. Structure is documented below.
- dump
Path String - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type String - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - labels Map<String>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location String
- The location where the migration job should reside.
- performance
Config Property Map - Data dump parallelism settings used by the migration. Structure is documented below.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- reverse
Ssh Property MapConnectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- static
Ip Property MapConnectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - vpc
Peering Property MapConnectivity - The details of the VPC network that the source database is located in. Structure is documented below.
Outputs
All input properties are implicitly available as output properties. Additionally, the MigrationJob resource produces the following output properties:
- Create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Errors
List<Migration
Job Error> - Output only. The error details in case of state FAILED. Structure is documented below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- Phase string
- The current migration job phase.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- The current migration job state.
- Create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Errors
[]Migration
Job Error - Output only. The error details in case of state FAILED. Structure is documented below.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- Phase string
- The current migration job phase.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- State string
- The current migration job state.
- create
Time String - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
List<Migration
Job Error> - Output only. The error details in case of state FAILED. Structure is documented below.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- phase String
- The current migration job phase.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- The current migration job state.
- create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
Migration
Job Error[] - Output only. The error details in case of state FAILED. Structure is documented below.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- phase string
- The current migration job phase.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- state string
- The current migration job state.
- create_
time str - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
Sequence[Migration
Job Error] - Output only. The error details in case of state FAILED. Structure is documented below.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- phase str
- The current migration job phase.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- state str
- The current migration job state.
- create
Time String - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors List<Property Map>
- Output only. The error details in case of state FAILED. Structure is documented below.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- phase String
- The current migration job phase.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- state String
- The current migration job state.
Look up Existing MigrationJob Resource
Get an existing MigrationJob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MigrationJobState, opts?: CustomResourceOptions): MigrationJob
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
destination: Optional[str] = None,
display_name: Optional[str] = None,
dump_flags: Optional[MigrationJobDumpFlagsArgs] = None,
dump_path: Optional[str] = None,
dump_type: Optional[str] = None,
effective_labels: Optional[Mapping[str, str]] = None,
errors: Optional[Sequence[MigrationJobErrorArgs]] = None,
labels: Optional[Mapping[str, str]] = None,
location: Optional[str] = None,
migration_job_id: Optional[str] = None,
name: Optional[str] = None,
performance_config: Optional[MigrationJobPerformanceConfigArgs] = None,
phase: Optional[str] = None,
project: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
reverse_ssh_connectivity: Optional[MigrationJobReverseSshConnectivityArgs] = None,
source: Optional[str] = None,
state: Optional[str] = None,
static_ip_connectivity: Optional[MigrationJobStaticIpConnectivityArgs] = None,
type: Optional[str] = None,
vpc_peering_connectivity: Optional[MigrationJobVpcPeeringConnectivityArgs] = None) -> MigrationJob
func GetMigrationJob(ctx *Context, name string, id IDInput, state *MigrationJobState, opts ...ResourceOption) (*MigrationJob, error)
public static MigrationJob Get(string name, Input<string> id, MigrationJobState? state, CustomResourceOptions? opts = null)
public static MigrationJob get(String name, Output<String> id, MigrationJobState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- Destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- Display
Name string - The migration job display name.
- Dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- Dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- Dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Errors
List<Migration
Job Error> - Output only. The error details in case of state FAILED. Structure is documented below.
- Labels Dictionary<string, string>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- Location string
- The location where the migration job should reside.
- Migration
Job stringId - The ID of the migration job.
- Name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- Performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- Phase string
- The current migration job phase.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- Source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- State string
- The current migration job state.
- Static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - Type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - Vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- Create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- Destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- Display
Name string - The migration job display name.
- Dump
Flags MigrationJob Dump Flags Args - The initial dump flags. Structure is documented below.
- Dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- Dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Errors
[]Migration
Job Error Args - Output only. The error details in case of state FAILED. Structure is documented below.
- Labels map[string]string
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- Location string
- The location where the migration job should reside.
- Migration
Job stringId - The ID of the migration job.
- Name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- Performance
Config MigrationJob Performance Config Args - Data dump parallelism settings used by the migration. Structure is documented below.
- Phase string
- The current migration job phase.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- Source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- State string
- The current migration job state.
- Static
Ip MigrationConnectivity Job Static Ip Connectivity Args - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - Type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - Vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- create
Time String - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- destination String
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- display
Name String - The migration job display name.
- dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- dump
Path String - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type String - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
List<Migration
Job Error> - Output only. The error details in case of state FAILED. Structure is documented below.
- labels Map<String,String>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location String
- The location where the migration job should reside.
- migration
Job StringId - The ID of the migration job.
- name String
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- phase String
- The current migration job phase.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- source String
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- state String
- The current migration job state.
- static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - type String
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- create
Time string - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- destination string
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- display
Name string - The migration job display name.
- dump
Flags MigrationJob Dump Flags - The initial dump flags. Structure is documented below.
- dump
Path string - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type string - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
Migration
Job Error[] - Output only. The error details in case of state FAILED. Structure is documented below.
- labels {[key: string]: string}
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location string
- The location where the migration job should reside.
- migration
Job stringId - The ID of the migration job.
- name string
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- performance
Config MigrationJob Performance Config - Data dump parallelism settings used by the migration. Structure is documented below.
- phase string
- The current migration job phase.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- reverse
Ssh MigrationConnectivity Job Reverse Ssh Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- source string
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- state string
- The current migration job state.
- static
Ip MigrationConnectivity Job Static Ip Connectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - type string
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - vpc
Peering MigrationConnectivity Job Vpc Peering Connectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- create_
time str - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- destination str
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- display_
name str - The migration job display name.
- dump_
flags MigrationJob Dump Flags Args - The initial dump flags. Structure is documented below.
- dump_
path str - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump_
type str - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors
Sequence[Migration
Job Error Args] - Output only. The error details in case of state FAILED. Structure is documented below.
- labels Mapping[str, str]
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location str
- The location where the migration job should reside.
- migration_
job_ strid - The ID of the migration job.
- name str
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- performance_
config MigrationJob Performance Config Args - Data dump parallelism settings used by the migration. Structure is documented below.
- phase str
- The current migration job phase.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- reverse_
ssh_ Migrationconnectivity Job Reverse Ssh Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- source str
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- state str
- The current migration job state.
- static_
ip_ Migrationconnectivity Job Static Ip Connectivity Args - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - type str
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - vpc_
peering_ Migrationconnectivity Job Vpc Peering Connectivity Args - The details of the VPC network that the source database is located in. Structure is documented below.
- create
Time String - Output only. The timestamp when the resource was created. A timestamp in RFC3339 UTC 'Zulu' format, accurate to nanoseconds. Example: '2014-10-02T15:01:23.045123456Z'.
- destination String
- The name of the destination connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{destinationConnectionProfile}.
- display
Name String - The migration job display name.
- dump
Flags Property Map - The initial dump flags. Structure is documented below.
- dump
Path String - The path to the dump file in Google Cloud Storage, in the format: (gs://[BUCKET_NAME]/[OBJECT_NAME]). This field and the "dump_flags" field are mutually exclusive.
- dump
Type String - The type of the data dump. Supported for MySQL to CloudSQL for MySQL
migrations only.
Possible values are:
LOGICAL
,PHYSICAL
. - effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- errors List<Property Map>
- Output only. The error details in case of state FAILED. Structure is documented below.
- labels Map<String>
The resource labels for migration job to use to annotate any related underlying resources such as Compute Engine VMs.
Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field
effective_labels
for all of the labels present on the resource.- location String
- The location where the migration job should reside.
- migration
Job StringId - The ID of the migration job.
- name String
- The name of this migration job resource in the form of projects/{project}/locations/{location}/migrationJobs/{migrationJob}.
- performance
Config Property Map - Data dump parallelism settings used by the migration. Structure is documented below.
- phase String
- The current migration job phase.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- reverse
Ssh Property MapConnectivity - The details of the VPC network that the source database is located in. Structure is documented below.
- source String
- The name of the source connection profile resource in the form of projects/{project}/locations/{location}/connectionProfiles/{sourceConnectionProfile}.
- state String
- The current migration job state.
- static
Ip Property MapConnectivity - If set to an empty object (
{}
), the source database will allow incoming connections from the public IP of the destination database. You can retrieve the public IP of the Cloud SQL instance from the Cloud SQL console or using Cloud SQL APIs. - type String
- The type of the migration job.
Possible values are:
ONE_TIME
,CONTINUOUS
. - vpc
Peering Property MapConnectivity - The details of the VPC network that the source database is located in. Structure is documented below.
Supporting Types
MigrationJobDumpFlags, MigrationJobDumpFlagsArgs
- Dump
Flags List<MigrationJob Dump Flags Dump Flag> - A list of dump flags Structure is documented below.
- Dump
Flags []MigrationJob Dump Flags Dump Flag - A list of dump flags Structure is documented below.
- dump
Flags List<MigrationJob Dump Flags Dump Flag> - A list of dump flags Structure is documented below.
- dump
Flags MigrationJob Dump Flags Dump Flag[] - A list of dump flags Structure is documented below.
- dump_
flags Sequence[MigrationJob Dump Flags Dump Flag] - A list of dump flags Structure is documented below.
- dump
Flags List<Property Map> - A list of dump flags Structure is documented below.
MigrationJobDumpFlagsDumpFlag, MigrationJobDumpFlagsDumpFlagArgs
MigrationJobError, MigrationJobErrorArgs
MigrationJobPerformanceConfig, MigrationJobPerformanceConfigArgs
- Dump
Parallel stringLevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
- Dump
Parallel stringLevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
- dump
Parallel StringLevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
- dump
Parallel stringLevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
- dump_
parallel_ strlevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
- dump
Parallel StringLevel - Initial dump parallelism level.
Possible values are:
MIN
,OPTIMAL
,MAX
.
MigrationJobReverseSshConnectivity, MigrationJobReverseSshConnectivityArgs
- Vm string
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vm
Ip string - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vm
Port int - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vpc string
- The name of the VPC to peer with the Cloud SQL private network.
- Vm string
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vm
Ip string - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vm
Port int - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- Vpc string
- The name of the VPC to peer with the Cloud SQL private network.
- vm String
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Ip String - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Port Integer - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vpc String
- The name of the VPC to peer with the Cloud SQL private network.
- vm string
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Ip string - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Port number - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vpc string
- The name of the VPC to peer with the Cloud SQL private network.
- vm str
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm_
ip str - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm_
port int - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vpc str
- The name of the VPC to peer with the Cloud SQL private network.
- vm String
- The name of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Ip String - The IP of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vm
Port Number - The forwarding port of the virtual machine (Compute Engine) used as the bastion server for the SSH tunnel.
- vpc String
- The name of the VPC to peer with the Cloud SQL private network.
MigrationJobVpcPeeringConnectivity, MigrationJobVpcPeeringConnectivityArgs
- Vpc string
- The name of the VPC network to peer with the Cloud SQL private network.
- Vpc string
- The name of the VPC network to peer with the Cloud SQL private network.
- vpc String
- The name of the VPC network to peer with the Cloud SQL private network.
- vpc string
- The name of the VPC network to peer with the Cloud SQL private network.
- vpc str
- The name of the VPC network to peer with the Cloud SQL private network.
- vpc String
- The name of the VPC network to peer with the Cloud SQL private network.
Import
MigrationJob can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/migrationJobs/{{migration_job_id}}
{{project}}/{{location}}/{{migration_job_id}}
{{location}}/{{migration_job_id}}
When using the pulumi import
command, MigrationJob can be imported using one of the formats above. For example:
$ pulumi import gcp:databasemigrationservice/migrationJob:MigrationJob default projects/{{project}}/locations/{{location}}/migrationJobs/{{migration_job_id}}
$ pulumi import gcp:databasemigrationservice/migrationJob:MigrationJob default {{project}}/{{location}}/{{migration_job_id}}
$ pulumi import gcp:databasemigrationservice/migrationJob:MigrationJob default {{location}}/{{migration_job_id}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.