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

com.pulumi.azure.appplatform.kotlin.SpringCloudBuildDeploymentArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appplatform.kotlin

import com.pulumi.azure.appplatform.SpringCloudBuildDeploymentArgs.builder
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudBuildDeploymentQuotaArgs
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudBuildDeploymentQuotaArgsBuilder
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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Spring Cloud Build Deployment.
 * > **NOTE:** This resource is applicable only for Spring Cloud Service with enterprise tier.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "West Europe",
 * });
 * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     skuName: "E0",
 * });
 * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("example", {
 *     name: "example",
 *     resourceGroupName: exampleSpringCloudService.resourceGroupName,
 *     serviceName: exampleSpringCloudService.name,
 * });
 * const exampleSpringCloudBuildDeployment = new azure.appplatform.SpringCloudBuildDeployment("example", {
 *     name: "example",
 *     springCloudAppId: exampleSpringCloudApp.id,
 *     buildResultId: "",
 *     instanceCount: 2,
 *     environmentVariables: {
 *         Foo: "Bar",
 *         Env: "Staging",
 *     },
 *     quota: {
 *         cpu: "2",
 *         memory: "4Gi",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example",
 *     location="West Europe")
 * example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
 *     name="example",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku_name="E0")
 * example_spring_cloud_app = azure.appplatform.SpringCloudApp("example",
 *     name="example",
 *     resource_group_name=example_spring_cloud_service.resource_group_name,
 *     service_name=example_spring_cloud_service.name)
 * example_spring_cloud_build_deployment = azure.appplatform.SpringCloudBuildDeployment("example",
 *     name="example",
 *     spring_cloud_app_id=example_spring_cloud_app.id,
 *     build_result_id="",
 *     instance_count=2,
 *     environment_variables={
 *         "Foo": "Bar",
 *         "Env": "Staging",
 *     },
 *     quota=azure.appplatform.SpringCloudBuildDeploymentQuotaArgs(
 *         cpu="2",
 *         memory="4Gi",
 *     ))
 * ```
 * ```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",
 *         Location = "West Europe",
 *     });
 *     var exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
 *     {
 *         Name = "example",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         SkuName = "E0",
 *     });
 *     var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = exampleSpringCloudService.ResourceGroupName,
 *         ServiceName = exampleSpringCloudService.Name,
 *     });
 *     var exampleSpringCloudBuildDeployment = new Azure.AppPlatform.SpringCloudBuildDeployment("example", new()
 *     {
 *         Name = "example",
 *         SpringCloudAppId = exampleSpringCloudApp.Id,
 *         BuildResultId = "",
 *         InstanceCount = 2,
 *         EnvironmentVariables =
 *         {
 *             { "Foo", "Bar" },
 *             { "Env", "Staging" },
 *         },
 *         Quota = new Azure.AppPlatform.Inputs.SpringCloudBuildDeploymentQuotaArgs
 *         {
 *             Cpu = "2",
 *             Memory = "4Gi",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appplatform"
 * 	"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"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			SkuName:           pulumi.String("E0"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "example", &appplatform.SpringCloudAppArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: exampleSpringCloudService.ResourceGroupName,
 * 			ServiceName:       exampleSpringCloudService.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudBuildDeployment(ctx, "example", &appplatform.SpringCloudBuildDeploymentArgs{
 * 			Name:             pulumi.String("example"),
 * 			SpringCloudAppId: exampleSpringCloudApp.ID(),
 * 			BuildResultId:    pulumi.String(""),
 * 			InstanceCount:    pulumi.Int(2),
 * 			EnvironmentVariables: pulumi.StringMap{
 * 				"Foo": pulumi.String("Bar"),
 * 				"Env": pulumi.String("Staging"),
 * 			},
 * 			Quota: &appplatform.SpringCloudBuildDeploymentQuotaArgs{
 * 				Cpu:    pulumi.String("2"),
 * 				Memory: pulumi.String("4Gi"),
 * 			},
 * 		})
 * 		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.appplatform.SpringCloudService;
 * import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
 * import com.pulumi.azure.appplatform.SpringCloudApp;
 * import com.pulumi.azure.appplatform.SpringCloudAppArgs;
 * import com.pulumi.azure.appplatform.SpringCloudBuildDeployment;
 * import com.pulumi.azure.appplatform.SpringCloudBuildDeploymentArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudBuildDeploymentQuotaArgs;
 * 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")
 *             .location("West Europe")
 *             .build());
 *         var exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .skuName("E0")
 *             .build());
 *         var exampleSpringCloudApp = new SpringCloudApp("exampleSpringCloudApp", SpringCloudAppArgs.builder()
 *             .name("example")
 *             .resourceGroupName(exampleSpringCloudService.resourceGroupName())
 *             .serviceName(exampleSpringCloudService.name())
 *             .build());
 *         var exampleSpringCloudBuildDeployment = new SpringCloudBuildDeployment("exampleSpringCloudBuildDeployment", SpringCloudBuildDeploymentArgs.builder()
 *             .name("example")
 *             .springCloudAppId(exampleSpringCloudApp.id())
 *             .buildResultId("")
 *             .instanceCount(2)
 *             .environmentVariables(Map.ofEntries(
 *                 Map.entry("Foo", "Bar"),
 *                 Map.entry("Env", "Staging")
 *             ))
 *             .quota(SpringCloudBuildDeploymentQuotaArgs.builder()
 *                 .cpu("2")
 *                 .memory("4Gi")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example
 *       location: West Europe
 *   exampleSpringCloudService:
 *     type: azure:appplatform:SpringCloudService
 *     name: example
 *     properties:
 *       name: example
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       skuName: E0
 *   exampleSpringCloudApp:
 *     type: azure:appplatform:SpringCloudApp
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${exampleSpringCloudService.resourceGroupName}
 *       serviceName: ${exampleSpringCloudService.name}
 *   exampleSpringCloudBuildDeployment:
 *     type: azure:appplatform:SpringCloudBuildDeployment
 *     name: example
 *     properties:
 *       name: example
 *       springCloudAppId: ${exampleSpringCloudApp.id}
 *       buildResultId: 
 *       instanceCount: 2
 *       environmentVariables:
 *         Foo: Bar
 *         Env: Staging
 *       quota:
 *         cpu: '2'
 *         memory: 4Gi
 * ```
 * 
 * ## Import
 * Spring Cloud Build Deployments can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudBuildDeployment:SpringCloudBuildDeployment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.AppPlatform/spring/spring1/apps/app1/deployments/deploy1
 * ```
 * @property addonJson A JSON object that contains the addon configurations of the Spring Cloud Build Deployment.
 * @property applicationPerformanceMonitoringIds Specifies a list of Spring Cloud Application Performance Monitoring IDs.
 * @property buildResultId The ID of the Spring Cloud Build Result.
 * @property environmentVariables Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
 * @property instanceCount Specifies the required instance count of the Spring Cloud Deployment. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
 * @property name The name which should be used for this Spring Cloud Build Deployment. Changing this forces a new Spring Cloud Build Deployment to be created.
 * @property quota A `quota` block as defined below.
 * @property springCloudAppId The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud Build Deployment to be created.
 */
public data class SpringCloudBuildDeploymentArgs(
    public val addonJson: Output? = null,
    public val applicationPerformanceMonitoringIds: Output>? = null,
    public val buildResultId: Output? = null,
    public val environmentVariables: Output>? = null,
    public val instanceCount: Output? = null,
    public val name: Output? = null,
    public val quota: Output? = null,
    public val springCloudAppId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appplatform.SpringCloudBuildDeploymentArgs =
        com.pulumi.azure.appplatform.SpringCloudBuildDeploymentArgs.builder()
            .addonJson(addonJson?.applyValue({ args0 -> args0 }))
            .applicationPerformanceMonitoringIds(
                applicationPerformanceMonitoringIds?.applyValue({ args0 ->
                    args0.map({ args0 -> args0 })
                }),
            )
            .buildResultId(buildResultId?.applyValue({ args0 -> args0 }))
            .environmentVariables(
                environmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .instanceCount(instanceCount?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .quota(quota?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .springCloudAppId(springCloudAppId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SpringCloudBuildDeploymentArgs].
 */
@PulumiTagMarker
public class SpringCloudBuildDeploymentArgsBuilder internal constructor() {
    private var addonJson: Output? = null

    private var applicationPerformanceMonitoringIds: Output>? = null

    private var buildResultId: Output? = null

    private var environmentVariables: Output>? = null

    private var instanceCount: Output? = null

    private var name: Output? = null

    private var quota: Output? = null

    private var springCloudAppId: Output? = null

    /**
     * @param value A JSON object that contains the addon configurations of the Spring Cloud Build Deployment.
     */
    @JvmName("mxgmjvitfsriiapk")
    public suspend fun addonJson(`value`: Output) {
        this.addonJson = value
    }

    /**
     * @param value Specifies a list of Spring Cloud Application Performance Monitoring IDs.
     */
    @JvmName("ltvgawjexpdjcnsu")
    public suspend fun applicationPerformanceMonitoringIds(`value`: Output>) {
        this.applicationPerformanceMonitoringIds = value
    }

    @JvmName("ewcoicvrneauxuik")
    public suspend fun applicationPerformanceMonitoringIds(vararg values: Output) {
        this.applicationPerformanceMonitoringIds = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of Spring Cloud Application Performance Monitoring IDs.
     */
    @JvmName("mvyhqotrmrbagpkg")
    public suspend fun applicationPerformanceMonitoringIds(values: List>) {
        this.applicationPerformanceMonitoringIds = Output.all(values)
    }

    /**
     * @param value The ID of the Spring Cloud Build Result.
     */
    @JvmName("vywmtciefpqjkktx")
    public suspend fun buildResultId(`value`: Output) {
        this.buildResultId = value
    }

    /**
     * @param value Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
     */
    @JvmName("efckncuclkyxdyow")
    public suspend fun environmentVariables(`value`: Output>) {
        this.environmentVariables = value
    }

    /**
     * @param value Specifies the required instance count of the Spring Cloud Deployment. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
     */
    @JvmName("kdnhdqdocplheeea")
    public suspend fun instanceCount(`value`: Output) {
        this.instanceCount = value
    }

    /**
     * @param value The name which should be used for this Spring Cloud Build Deployment. Changing this forces a new Spring Cloud Build Deployment to be created.
     */
    @JvmName("hgrstbtphihokcon")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud Build Deployment to be created.
     */
    @JvmName("quafdmxoakoinjwo")
    public suspend fun springCloudAppId(`value`: Output) {
        this.springCloudAppId = value
    }

    /**
     * @param value A JSON object that contains the addon configurations of the Spring Cloud Build Deployment.
     */
    @JvmName("hwlqbogiopvrjyew")
    public suspend fun addonJson(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addonJson = mapped
    }

    /**
     * @param value Specifies a list of Spring Cloud Application Performance Monitoring IDs.
     */
    @JvmName("mfblgcgrtivgsknb")
    public suspend fun applicationPerformanceMonitoringIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationPerformanceMonitoringIds = mapped
    }

    /**
     * @param values Specifies a list of Spring Cloud Application Performance Monitoring IDs.
     */
    @JvmName("kvlgidkldedvbnnh")
    public suspend fun applicationPerformanceMonitoringIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.applicationPerformanceMonitoringIds = mapped
    }

    /**
     * @param value The ID of the Spring Cloud Build Result.
     */
    @JvmName("vxibrmlhkmjnxacc")
    public suspend fun buildResultId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.buildResultId = mapped
    }

    /**
     * @param value Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
     */
    @JvmName("hqhcqtyfwlqsxbtm")
    public suspend fun environmentVariables(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param values Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
     */
    @JvmName("qqsebuutbmpcqgrg")
    public fun environmentVariables(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.environmentVariables = mapped
    }

    /**
     * @param value Specifies the required instance count of the Spring Cloud Deployment. Possible Values are between `1` and `500`. Defaults to `1` if not specified.
     */
    @JvmName("xffrpcqnlosdamrj")
    public suspend fun instanceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceCount = mapped
    }

    /**
     * @param value The name which should be used for this Spring Cloud Build Deployment. Changing this forces a new Spring Cloud Build Deployment to be created.
     */
    @JvmName("yqecuokfakxxkifa")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

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

    /**
     * @param value The ID of the Spring Cloud Service. Changing this forces a new Spring Cloud Build Deployment to be created.
     */
    @JvmName("gicpmrmpqjlyuour")
    public suspend fun springCloudAppId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.springCloudAppId = mapped
    }

    internal fun build(): SpringCloudBuildDeploymentArgs = SpringCloudBuildDeploymentArgs(
        addonJson = addonJson,
        applicationPerformanceMonitoringIds = applicationPerformanceMonitoringIds,
        buildResultId = buildResultId,
        environmentVariables = environmentVariables,
        instanceCount = instanceCount,
        name = name,
        quota = quota,
        springCloudAppId = springCloudAppId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy