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

com.pulumi.azure.cognitive.kotlin.DeploymentArgs.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.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.cognitive.kotlin

import com.pulumi.azure.cognitive.DeploymentArgs.builder
import com.pulumi.azure.cognitive.kotlin.inputs.DeploymentModelArgs
import com.pulumi.azure.cognitive.kotlin.inputs.DeploymentModelArgsBuilder
import com.pulumi.azure.cognitive.kotlin.inputs.DeploymentScaleArgs
import com.pulumi.azure.cognitive.kotlin.inputs.DeploymentScaleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Manages a Cognitive Services Account Deployment.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAccount = new azure.cognitive.Account("example", {
 *     name: "example-ca",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     kind: "OpenAI",
 *     skuName: "S0",
 * });
 * const exampleDeployment = new azure.cognitive.Deployment("example", {
 *     name: "example-cd",
 *     cognitiveAccountId: exampleAccount.id,
 *     model: {
 *         format: "OpenAI",
 *         name: "text-curie-001",
 *         version: "1",
 *     },
 *     scale: {
 *         type: "Standard",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_account = azure.cognitive.Account("example",
 *     name="example-ca",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     kind="OpenAI",
 *     sku_name="S0")
 * example_deployment = azure.cognitive.Deployment("example",
 *     name="example-cd",
 *     cognitive_account_id=example_account.id,
 *     model=azure.cognitive.DeploymentModelArgs(
 *         format="OpenAI",
 *         name="text-curie-001",
 *         version="1",
 *     ),
 *     scale=azure.cognitive.DeploymentScaleArgs(
 *         type="Standard",
 *     ))
 * ```
 * ```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-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAccount = new Azure.Cognitive.Account("example", new()
 *     {
 *         Name = "example-ca",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Kind = "OpenAI",
 *         SkuName = "S0",
 *     });
 *     var exampleDeployment = new Azure.Cognitive.Deployment("example", new()
 *     {
 *         Name = "example-cd",
 *         CognitiveAccountId = exampleAccount.Id,
 *         Model = new Azure.Cognitive.Inputs.DeploymentModelArgs
 *         {
 *             Format = "OpenAI",
 *             Name = "text-curie-001",
 *             Version = "1",
 *         },
 *         Scale = new Azure.Cognitive.Inputs.DeploymentScaleArgs
 *         {
 *             Type = "Standard",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/cognitive"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleAccount, err := cognitive.NewAccount(ctx, "example", &cognitive.AccountArgs{
 * 			Name:              pulumi.String("example-ca"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Kind:              pulumi.String("OpenAI"),
 * 			SkuName:           pulumi.String("S0"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cognitive.NewDeployment(ctx, "example", &cognitive.DeploymentArgs{
 * 			Name:               pulumi.String("example-cd"),
 * 			CognitiveAccountId: exampleAccount.ID(),
 * 			Model: &cognitive.DeploymentModelArgs{
 * 				Format:  pulumi.String("OpenAI"),
 * 				Name:    pulumi.String("text-curie-001"),
 * 				Version: pulumi.String("1"),
 * 			},
 * 			Scale: &cognitive.DeploymentScaleArgs{
 * 				Type: pulumi.String("Standard"),
 * 			},
 * 		})
 * 		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.cognitive.Account;
 * import com.pulumi.azure.cognitive.AccountArgs;
 * import com.pulumi.azure.cognitive.Deployment;
 * import com.pulumi.azure.cognitive.DeploymentArgs;
 * import com.pulumi.azure.cognitive.inputs.DeploymentModelArgs;
 * import com.pulumi.azure.cognitive.inputs.DeploymentScaleArgs;
 * 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-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("example-ca")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .kind("OpenAI")
 *             .skuName("S0")
 *             .build());
 *         var exampleDeployment = new Deployment("exampleDeployment", DeploymentArgs.builder()
 *             .name("example-cd")
 *             .cognitiveAccountId(exampleAccount.id())
 *             .model(DeploymentModelArgs.builder()
 *                 .format("OpenAI")
 *                 .name("text-curie-001")
 *                 .version("1")
 *                 .build())
 *             .scale(DeploymentScaleArgs.builder()
 *                 .type("Standard")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAccount:
 *     type: azure:cognitive:Account
 *     name: example
 *     properties:
 *       name: example-ca
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       kind: OpenAI
 *       skuName: S0
 *   exampleDeployment:
 *     type: azure:cognitive:Deployment
 *     name: example
 *     properties:
 *       name: example-cd
 *       cognitiveAccountId: ${exampleAccount.id}
 *       model:
 *         format: OpenAI
 *         name: text-curie-001
 *         version: '1'
 *       scale:
 *         type: Standard
 * ```
 * 
 * ## Import
 * Cognitive Services Account Deployment can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:cognitive/deployment:Deployment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.CognitiveServices/accounts/account1/deployments/deployment1
 * ```
 * @property cognitiveAccountId The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
 * @property model A `model` block as defined below. Changing this forces a new resource to be created.
 * @property name The name of the Cognitive Services Account Deployment. Changing this forces a new resource to be created.
 * @property raiPolicyName The name of RAI policy.
 * @property scale A `scale` block as defined below.
 * @property versionUpgradeOption Deployment model version upgrade option. Possible values are `OnceNewDefaultVersionAvailable`, `OnceCurrentVersionExpired`, and `NoAutoUpgrade`. Defaults to `OnceNewDefaultVersionAvailable`.
 */
public data class DeploymentArgs(
    public val cognitiveAccountId: Output? = null,
    public val model: Output? = null,
    public val name: Output? = null,
    public val raiPolicyName: Output? = null,
    public val scale: Output? = null,
    public val versionUpgradeOption: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.cognitive.DeploymentArgs =
        com.pulumi.azure.cognitive.DeploymentArgs.builder()
            .cognitiveAccountId(cognitiveAccountId?.applyValue({ args0 -> args0 }))
            .model(model?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .raiPolicyName(raiPolicyName?.applyValue({ args0 -> args0 }))
            .scale(scale?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .versionUpgradeOption(versionUpgradeOption?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DeploymentArgs].
 */
@PulumiTagMarker
public class DeploymentArgsBuilder internal constructor() {
    private var cognitiveAccountId: Output? = null

    private var model: Output? = null

    private var name: Output? = null

    private var raiPolicyName: Output? = null

    private var scale: Output? = null

    private var versionUpgradeOption: Output? = null

    /**
     * @param value The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
     */
    @JvmName("nepnywjntbxdshjf")
    public suspend fun cognitiveAccountId(`value`: Output) {
        this.cognitiveAccountId = value
    }

    /**
     * @param value A `model` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("eksxwhbmkagjukjt")
    public suspend fun model(`value`: Output) {
        this.model = value
    }

    /**
     * @param value The name of the Cognitive Services Account Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("gmkvbggwvfxywvyh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of RAI policy.
     */
    @JvmName("icfbgjbsfhwdrtbv")
    public suspend fun raiPolicyName(`value`: Output) {
        this.raiPolicyName = value
    }

    /**
     * @param value A `scale` block as defined below.
     */
    @JvmName("strnwyiqporoyojm")
    public suspend fun scale(`value`: Output) {
        this.scale = value
    }

    /**
     * @param value Deployment model version upgrade option. Possible values are `OnceNewDefaultVersionAvailable`, `OnceCurrentVersionExpired`, and `NoAutoUpgrade`. Defaults to `OnceNewDefaultVersionAvailable`.
     */
    @JvmName("dvcetfotoefwrwea")
    public suspend fun versionUpgradeOption(`value`: Output) {
        this.versionUpgradeOption = value
    }

    /**
     * @param value The ID of the Cognitive Services Account. Changing this forces a new resource to be created.
     */
    @JvmName("lbtdfxkwpcbijlgl")
    public suspend fun cognitiveAccountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cognitiveAccountId = mapped
    }

    /**
     * @param value A `model` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("gnfnnemomjrcrbgt")
    public suspend fun model(`value`: DeploymentModelArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.model = mapped
    }

    /**
     * @param argument A `model` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("fvkquvcbyylrpqew")
    public suspend fun model(argument: suspend DeploymentModelArgsBuilder.() -> Unit) {
        val toBeMapped = DeploymentModelArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.model = mapped
    }

    /**
     * @param value The name of the Cognitive Services Account Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("aovsigchrrofjpet")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of RAI policy.
     */
    @JvmName("bshxpqkibtxiemfs")
    public suspend fun raiPolicyName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.raiPolicyName = mapped
    }

    /**
     * @param value A `scale` block as defined below.
     */
    @JvmName("ewgfbhxpchwqccdk")
    public suspend fun scale(`value`: DeploymentScaleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scale = mapped
    }

    /**
     * @param argument A `scale` block as defined below.
     */
    @JvmName("bwpkbvnoajpfkiiu")
    public suspend fun scale(argument: suspend DeploymentScaleArgsBuilder.() -> Unit) {
        val toBeMapped = DeploymentScaleArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.scale = mapped
    }

    /**
     * @param value Deployment model version upgrade option. Possible values are `OnceNewDefaultVersionAvailable`, `OnceCurrentVersionExpired`, and `NoAutoUpgrade`. Defaults to `OnceNewDefaultVersionAvailable`.
     */
    @JvmName("xachvlmqyrpevxow")
    public suspend fun versionUpgradeOption(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionUpgradeOption = mapped
    }

    internal fun build(): DeploymentArgs = DeploymentArgs(
        cognitiveAccountId = cognitiveAccountId,
        model = model,
        name = name,
        raiPolicyName = raiPolicyName,
        scale = scale,
        versionUpgradeOption = versionUpgradeOption,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy