All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.databasemigration.kotlin.ProjectArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.databasemigration.kotlin

import com.pulumi.azure.databasemigration.ProjectArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manage a Azure Database Migration Project.
 * > **NOTE:** Destroying a Database Migration Project will leave any outstanding tasks untouched. This is to avoid unexpectedly deleting any tasks managed outside of this provider.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-vnet",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-subnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.1.0/24"],
 * });
 * const exampleService = new azure.databasemigration.Service("example", {
 *     name: "example-dbms",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     subnetId: exampleSubnet.id,
 *     skuName: "Standard_1vCores",
 * });
 * const exampleProject = new azure.databasemigration.Project("example", {
 *     name: "example-dbms-project",
 *     serviceName: exampleService.name,
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sourcePlatform: "SQL",
 *     targetPlatform: "SQLDB",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-rg",
 *     location="West Europe")
 * example_virtual_network = azure.network.VirtualNetwork("example",
 *     name="example-vnet",
 *     address_spaces=["10.0.0.0/16"],
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_subnet = azure.network.Subnet("example",
 *     name="example-subnet",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_virtual_network.name,
 *     address_prefixes=["10.0.1.0/24"])
 * example_service = azure.databasemigration.Service("example",
 *     name="example-dbms",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     subnet_id=example_subnet.id,
 *     sku_name="Standard_1vCores")
 * example_project = azure.databasemigration.Project("example",
 *     name="example-dbms-project",
 *     service_name=example_service.name,
 *     resource_group_name=example.name,
 *     location=example.location,
 *     source_platform="SQL",
 *     target_platform="SQLDB")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-rg",
 *         Location = "West Europe",
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-vnet",
 *         AddressSpaces = new[]
 *         {
 *             "10.0.0.0/16",
 *         },
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleSubnet = new Azure.Network.Subnet("example", new()
 *     {
 *         Name = "example-subnet",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = exampleVirtualNetwork.Name,
 *         AddressPrefixes = new[]
 *         {
 *             "10.0.1.0/24",
 *         },
 *     });
 *     var exampleService = new Azure.DatabaseMigration.Service("example", new()
 *     {
 *         Name = "example-dbms",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SubnetId = exampleSubnet.Id,
 *         SkuName = "Standard_1vCores",
 *     });
 *     var exampleProject = new Azure.DatabaseMigration.Project("example", new()
 *     {
 *         Name = "example-dbms-project",
 *         ServiceName = exampleService.Name,
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         SourcePlatform = "SQL",
 *         TargetPlatform = "SQLDB",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-rg"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name: pulumi.String("example-vnet"),
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.0.0.0/16"),
 * 			},
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
 * 			Name:               pulumi.String("example-subnet"),
 * 			ResourceGroupName:  example.Name,
 * 			VirtualNetworkName: exampleVirtualNetwork.Name,
 * 			AddressPrefixes: pulumi.StringArray{
 * 				pulumi.String("10.0.1.0/24"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleService, err := databasemigration.NewService(ctx, "example", &databasemigration.ServiceArgs{
 * 			Name:              pulumi.String("example-dbms"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SubnetId:          exampleSubnet.ID(),
 * 			SkuName:           pulumi.String("Standard_1vCores"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = databasemigration.NewProject(ctx, "example", &databasemigration.ProjectArgs{
 * 			Name:              pulumi.String("example-dbms-project"),
 * 			ServiceName:       exampleService.Name,
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			SourcePlatform:    pulumi.String("SQL"),
 * 			TargetPlatform:    pulumi.String("SQLDB"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.Subnet;
 * import com.pulumi.azure.network.SubnetArgs;
 * import com.pulumi.azure.databasemigration.Service;
 * import com.pulumi.azure.databasemigration.ServiceArgs;
 * import com.pulumi.azure.databasemigration.Project;
 * import com.pulumi.azure.databasemigration.ProjectArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-rg")
 *             .location("West Europe")
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-vnet")
 *             .addressSpaces("10.0.0.0/16")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("example-subnet")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.0.1.0/24")
 *             .build());
 *         var exampleService = new Service("exampleService", ServiceArgs.builder()
 *             .name("example-dbms")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .subnetId(exampleSubnet.id())
 *             .skuName("Standard_1vCores")
 *             .build());
 *         var exampleProject = new Project("exampleProject", ProjectArgs.builder()
 *             .name("example-dbms-project")
 *             .serviceName(exampleService.name())
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sourcePlatform("SQL")
 *             .targetPlatform("SQLDB")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-rg
 *       location: West Europe
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-vnet
 *       addressSpaces:
 *         - 10.0.0.0/16
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleSubnet:
 *     type: azure:network:Subnet
 *     name: example
 *     properties:
 *       name: example-subnet
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${exampleVirtualNetwork.name}
 *       addressPrefixes:
 *         - 10.0.1.0/24
 *   exampleService:
 *     type: azure:databasemigration:Service
 *     name: example
 *     properties:
 *       name: example-dbms
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       subnetId: ${exampleSubnet.id}
 *       skuName: Standard_1vCores
 *   exampleProject:
 *     type: azure:databasemigration:Project
 *     name: example
 *     properties:
 *       name: example-dbms-project
 *       serviceName: ${exampleService.name}
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sourcePlatform: SQL
 *       targetPlatform: SQLDB
 * ```
 * 
 * ## Import
 * Database Migration Projects can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:databasemigration/project:Project example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-rg/providers/Microsoft.DataMigration/services/example-dms/projects/project1
 * ```
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specify the name of the database migration project. Changing this forces a new resource to be created.
 * @property resourceGroupName Name of the resource group in which to create the database migration project. Changing this forces a new resource to be created.
 * @property serviceName Name of the database migration service where resource belongs to. Changing this forces a new resource to be created.
 * @property sourcePlatform The platform type of the migration source. Possible values are `SQL`, `PostgreSQL`, `MySQL` and `MongoDb`. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assigned to the resource.
 * @property targetPlatform The platform type of the migration target. Possible values are `SQLDB`, `AzureDbForPostgreSql`, `AzureDbForMySql` and `MongoDb`. Changing this forces a new resource to be created.
 */
public data class ProjectArgs(
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val serviceName: Output? = null,
    public val sourcePlatform: Output? = null,
    public val tags: Output>? = null,
    public val targetPlatform: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.databasemigration.ProjectArgs =
        com.pulumi.azure.databasemigration.ProjectArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serviceName(serviceName?.applyValue({ args0 -> args0 }))
            .sourcePlatform(sourcePlatform?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .targetPlatform(targetPlatform?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProjectArgs].
 */
@PulumiTagMarker
public class ProjectArgsBuilder internal constructor() {
    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var serviceName: Output? = null

    private var sourcePlatform: Output? = null

    private var tags: Output>? = null

    private var targetPlatform: Output? = null

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("rdmubgxbfikqrlnt")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specify the name of the database migration project. Changing this forces a new resource to be created.
     */
    @JvmName("ofeiydehxbeniiel")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Name of the resource group in which to create the database migration project. Changing this forces a new resource to be created.
     */
    @JvmName("hefqljlagwrkjpjw")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Name of the database migration service where resource belongs to. Changing this forces a new resource to be created.
     */
    @JvmName("dyrbgimaybcnceam")
    public suspend fun serviceName(`value`: Output) {
        this.serviceName = value
    }

    /**
     * @param value The platform type of the migration source. Possible values are `SQL`, `PostgreSQL`, `MySQL` and `MongoDb`. Changing this forces a new resource to be created.
     */
    @JvmName("tjjyxfgdforikncx")
    public suspend fun sourcePlatform(`value`: Output) {
        this.sourcePlatform = value
    }

    /**
     * @param value A mapping of tags to assigned to the resource.
     */
    @JvmName("rdwubpxnnlnwbrjc")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The platform type of the migration target. Possible values are `SQLDB`, `AzureDbForPostgreSql`, `AzureDbForMySql` and `MongoDb`. Changing this forces a new resource to be created.
     */
    @JvmName("fjjsmoqlmrqwibso")
    public suspend fun targetPlatform(`value`: Output) {
        this.targetPlatform = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("ktuayjhergmjugqc")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specify the name of the database migration project. Changing this forces a new resource to be created.
     */
    @JvmName("qepgvpqoqeqyfaaw")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Name of the resource group in which to create the database migration project. Changing this forces a new resource to be created.
     */
    @JvmName("bfpokauxapownkho")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Name of the database migration service where resource belongs to. Changing this forces a new resource to be created.
     */
    @JvmName("orepxwighaddaece")
    public suspend fun serviceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceName = mapped
    }

    /**
     * @param value The platform type of the migration source. Possible values are `SQL`, `PostgreSQL`, `MySQL` and `MongoDb`. Changing this forces a new resource to be created.
     */
    @JvmName("fencoqykfrhxoijr")
    public suspend fun sourcePlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePlatform = mapped
    }

    /**
     * @param value A mapping of tags to assigned to the resource.
     */
    @JvmName("fnfudgoxbnsrhcmv")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assigned to the resource.
     */
    @JvmName("ptdndemptibtmteu")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The platform type of the migration target. Possible values are `SQLDB`, `AzureDbForPostgreSql`, `AzureDbForMySql` and `MongoDb`. Changing this forces a new resource to be created.
     */
    @JvmName("bqbpwweshfcxfjxs")
    public suspend fun targetPlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetPlatform = mapped
    }

    internal fun build(): ProjectArgs = ProjectArgs(
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        serviceName = serviceName,
        sourcePlatform = sourcePlatform,
        tags = tags,
        targetPlatform = targetPlatform,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy