com.pulumi.azurenative.dbforpostgresql.Migration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.dbforpostgresql;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.dbforpostgresql.MigrationArgs;
import com.pulumi.azurenative.dbforpostgresql.outputs.DbServerMetadataResponse;
import com.pulumi.azurenative.dbforpostgresql.outputs.MigrationStatusResponse;
import com.pulumi.azurenative.dbforpostgresql.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Represents a migration resource.
* Azure REST API version: 2023-03-01-preview.
*
* Other available API versions: 2021-06-15-privatepreview, 2022-05-01-preview, 2023-06-01-preview, 2023-12-01-preview, 2024-03-01-preview.
*
* ## Example Usage
* ### Migrations Create by passing user names
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbforpostgresql.Migration;
* import com.pulumi.azurenative.dbforpostgresql.MigrationArgs;
* import com.pulumi.azurenative.dbforpostgresql.inputs.MigrationSecretParametersArgs;
* import com.pulumi.azurenative.dbforpostgresql.inputs.AdminCredentialsArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App }{{@code
* public static void main(String[] args) }{{@code
* Pulumi.run(App::stack);
* }}{@code
*
* public static void stack(Context ctx) }{{@code
* var migration = new Migration("migration", MigrationArgs.builder()
* .dbsToMigrate(
* "db1",
* "db2",
* "db3",
* "db4")
* .location("westus")
* .migrationMode("Offline")
* .migrationName("testmigration")
* .resourceGroupName("testrg")
* .secretParameters(MigrationSecretParametersArgs.builder()
* .adminCredentials(AdminCredentialsArgs.builder()
* .sourceServerPassword("xxxxxxxx")
* .targetServerPassword("xxxxxxxx")
* .build())
* .sourceServerUsername("newadmin}{@literal @}{@code testsource")
* .targetServerUsername("targetadmin")
* .build())
* .sourceDbServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource")
* .targetDbServerName("testtarget")
* .build());
*
* }}{@code
* }}{@code
*
* }
*
* ### Migrations_Create
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.dbforpostgresql.Migration;
* import com.pulumi.azurenative.dbforpostgresql.MigrationArgs;
* import com.pulumi.azurenative.dbforpostgresql.inputs.MigrationSecretParametersArgs;
* import com.pulumi.azurenative.dbforpostgresql.inputs.AdminCredentialsArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var migration = new Migration("migration", MigrationArgs.builder()
* .dbsToMigrate(
* "db1",
* "db2",
* "db3",
* "db4")
* .location("westus")
* .migrationMode("Offline")
* .migrationName("testmigration")
* .overwriteDbsInTarget("True")
* .resourceGroupName("testrg")
* .secretParameters(MigrationSecretParametersArgs.builder()
* .adminCredentials(AdminCredentialsArgs.builder()
* .sourceServerPassword("xxxxxxxx")
* .targetServerPassword("xxxxxxxx")
* .build())
* .build())
* .sourceDbServerResourceId("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testrg/providers/Microsoft.DBForPostgreSql/servers/testsource")
* .targetDbServerName("testtarget")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:dbforpostgresql:Migration d3ceacbb-a5fd-43dc-a9db-6022b5154856 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{targetDbServerName}/migrations/{migrationName}
* ```
*
*/
@ResourceType(type="azure-native:dbforpostgresql:Migration")
public class Migration extends com.pulumi.resources.CustomResource {
/**
* To trigger cancel for entire migration we need to send this flag as True
*
*/
@Export(name="cancel", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> cancel;
/**
* @return To trigger cancel for entire migration we need to send this flag as True
*
*/
public Output> cancel() {
return Codegen.optional(this.cancel);
}
/**
* Current status of migration
*
*/
@Export(name="currentStatus", refs={MigrationStatusResponse.class}, tree="[0]")
private Output currentStatus;
/**
* @return Current status of migration
*
*/
public Output currentStatus() {
return this.currentStatus;
}
/**
* When you want to trigger cancel for specific databases send cancel flag as True and database names in this array
*
*/
@Export(name="dbsToCancelMigrationOn", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> dbsToCancelMigrationOn;
/**
* @return When you want to trigger cancel for specific databases send cancel flag as True and database names in this array
*
*/
public Output>> dbsToCancelMigrationOn() {
return Codegen.optional(this.dbsToCancelMigrationOn);
}
/**
* Number of databases to migrate
*
*/
@Export(name="dbsToMigrate", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> dbsToMigrate;
/**
* @return Number of databases to migrate
*
*/
public Output>> dbsToMigrate() {
return Codegen.optional(this.dbsToMigrate);
}
/**
* When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array
*
*/
@Export(name="dbsToTriggerCutoverOn", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> dbsToTriggerCutoverOn;
/**
* @return When you want to trigger cutover for specific databases send triggerCutover flag as True and database names in this array
*
*/
public Output>> dbsToTriggerCutoverOn() {
return Codegen.optional(this.dbsToTriggerCutoverOn);
}
/**
* The geo-location where the resource lives
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The geo-location where the resource lives
*
*/
public Output location() {
return this.location;
}
/**
* ID for migration, a GUID.
*
*/
@Export(name="migrationId", refs={String.class}, tree="[0]")
private Output migrationId;
/**
* @return ID for migration, a GUID.
*
*/
public Output migrationId() {
return this.migrationId;
}
/**
* There are two types of migration modes Online and Offline
*
*/
@Export(name="migrationMode", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> migrationMode;
/**
* @return There are two types of migration modes Online and Offline
*
*/
public Output> migrationMode() {
return Codegen.optional(this.migrationMode);
}
/**
* End time in UTC for migration window
*
*/
@Export(name="migrationWindowEndTimeInUtc", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> migrationWindowEndTimeInUtc;
/**
* @return End time in UTC for migration window
*
*/
public Output> migrationWindowEndTimeInUtc() {
return Codegen.optional(this.migrationWindowEndTimeInUtc);
}
/**
* Start time in UTC for migration window
*
*/
@Export(name="migrationWindowStartTimeInUtc", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> migrationWindowStartTimeInUtc;
/**
* @return Start time in UTC for migration window
*
*/
public Output> migrationWindowStartTimeInUtc() {
return Codegen.optional(this.migrationWindowStartTimeInUtc);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists.
*
*/
@Export(name="overwriteDbsInTarget", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> overwriteDbsInTarget;
/**
* @return Indicates whether the databases on the target server can be overwritten, if already present. If set to False, the migration workflow will wait for a confirmation, if it detects that the database already exists.
*
*/
public Output> overwriteDbsInTarget() {
return Codegen.optional(this.overwriteDbsInTarget);
}
/**
* Indicates whether to setup LogicalReplicationOnSourceDb, if needed
*
*/
@Export(name="setupLogicalReplicationOnSourceDbIfNeeded", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> setupLogicalReplicationOnSourceDbIfNeeded;
/**
* @return Indicates whether to setup LogicalReplicationOnSourceDb, if needed
*
*/
public Output> setupLogicalReplicationOnSourceDbIfNeeded() {
return Codegen.optional(this.setupLogicalReplicationOnSourceDbIfNeeded);
}
/**
* Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection
*
*/
@Export(name="sourceDbServerFullyQualifiedDomainName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceDbServerFullyQualifiedDomainName;
/**
* @return Source server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection
*
*/
public Output> sourceDbServerFullyQualifiedDomainName() {
return Codegen.optional(this.sourceDbServerFullyQualifiedDomainName);
}
/**
* Metadata of the source database server
*
*/
@Export(name="sourceDbServerMetadata", refs={DbServerMetadataResponse.class}, tree="[0]")
private Output sourceDbServerMetadata;
/**
* @return Metadata of the source database server
*
*/
public Output sourceDbServerMetadata() {
return this.sourceDbServerMetadata;
}
/**
* ResourceId of the source database server
*
*/
@Export(name="sourceDbServerResourceId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> sourceDbServerResourceId;
/**
* @return ResourceId of the source database server
*
*/
public Output> sourceDbServerResourceId() {
return Codegen.optional(this.sourceDbServerResourceId);
}
/**
* Indicates whether the data migration should start right away
*
*/
@Export(name="startDataMigration", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> startDataMigration;
/**
* @return Indicates whether the data migration should start right away
*
*/
public Output> startDataMigration() {
return Codegen.optional(this.startDataMigration);
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection
*
*/
@Export(name="targetDbServerFullyQualifiedDomainName", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> targetDbServerFullyQualifiedDomainName;
/**
* @return Target server fully qualified domain name or ip. It is a optional value, if customer provide it, dms will always use it for connection
*
*/
public Output> targetDbServerFullyQualifiedDomainName() {
return Codegen.optional(this.targetDbServerFullyQualifiedDomainName);
}
/**
* Metadata of the target database server
*
*/
@Export(name="targetDbServerMetadata", refs={DbServerMetadataResponse.class}, tree="[0]")
private Output targetDbServerMetadata;
/**
* @return Metadata of the target database server
*
*/
public Output targetDbServerMetadata() {
return this.targetDbServerMetadata;
}
/**
* ResourceId of the source database server
*
*/
@Export(name="targetDbServerResourceId", refs={String.class}, tree="[0]")
private Output targetDbServerResourceId;
/**
* @return ResourceId of the source database server
*
*/
public Output targetDbServerResourceId() {
return this.targetDbServerResourceId;
}
/**
* To trigger cutover for entire migration we need to send this flag as True
*
*/
@Export(name="triggerCutover", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> triggerCutover;
/**
* @return To trigger cutover for entire migration we need to send this flag as True
*
*/
public Output> triggerCutover() {
return Codegen.optional(this.triggerCutover);
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Migration(java.lang.String name) {
this(name, MigrationArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Migration(java.lang.String name, MigrationArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Migration(java.lang.String name, MigrationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbforpostgresql:Migration", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Migration(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:dbforpostgresql:Migration", name, null, makeResourceOptions(options, id), false);
}
private static MigrationArgs makeArgs(MigrationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? MigrationArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20210615privatepreview:Migration").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20220501preview:Migration").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20230301preview:Migration").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20230601preview:Migration").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20231201preview:Migration").build()),
Output.of(Alias.builder().type("azure-native:dbforpostgresql/v20240301preview:Migration").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Migration get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Migration(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy