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

com.pulumi.azure.appplatform.kotlin.SpringCloudJavaDeploymentArgs.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.appplatform.kotlin

import com.pulumi.azure.appplatform.SpringCloudJavaDeploymentArgs.builder
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudJavaDeploymentQuotaArgs
import com.pulumi.azure.appplatform.kotlin.inputs.SpringCloudJavaDeploymentQuotaArgsBuilder
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.Map
import kotlin.jvm.JvmName

/**
 * Manages an Azure Spring Cloud Deployment with a Java runtime.
 * > **NOTE:** This resource is applicable only for Spring Cloud Service with basic and standard 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-resources",
 *     location: "West Europe",
 * });
 * const exampleSpringCloudService = new azure.appplatform.SpringCloudService("example", {
 *     name: "example-springcloud",
 *     resourceGroupName: example.name,
 *     location: example.location,
 * });
 * const exampleSpringCloudApp = new azure.appplatform.SpringCloudApp("example", {
 *     name: "example-springcloudapp",
 *     resourceGroupName: example.name,
 *     serviceName: exampleSpringCloudService.name,
 *     identity: {
 *         type: "SystemAssigned",
 *     },
 * });
 * const exampleSpringCloudJavaDeployment = new azure.appplatform.SpringCloudJavaDeployment("example", {
 *     name: "deploy1",
 *     springCloudAppId: exampleSpringCloudApp.id,
 *     instanceCount: 2,
 *     jvmOptions: "-XX:+PrintGC",
 *     quota: {
 *         cpu: "2",
 *         memory: "4Gi",
 *     },
 *     runtimeVersion: "Java_11",
 *     environmentVariables: {
 *         Foo: "Bar",
 *         Env: "Staging",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_spring_cloud_service = azure.appplatform.SpringCloudService("example",
 *     name="example-springcloud",
 *     resource_group_name=example.name,
 *     location=example.location)
 * example_spring_cloud_app = azure.appplatform.SpringCloudApp("example",
 *     name="example-springcloudapp",
 *     resource_group_name=example.name,
 *     service_name=example_spring_cloud_service.name,
 *     identity={
 *         "type": "SystemAssigned",
 *     })
 * example_spring_cloud_java_deployment = azure.appplatform.SpringCloudJavaDeployment("example",
 *     name="deploy1",
 *     spring_cloud_app_id=example_spring_cloud_app.id,
 *     instance_count=2,
 *     jvm_options="-XX:+PrintGC",
 *     quota={
 *         "cpu": "2",
 *         "memory": "4Gi",
 *     },
 *     runtime_version="Java_11",
 *     environment_variables={
 *         "Foo": "Bar",
 *         "Env": "Staging",
 *     })
 * ```
 * ```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 exampleSpringCloudService = new Azure.AppPlatform.SpringCloudService("example", new()
 *     {
 *         Name = "example-springcloud",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *     });
 *     var exampleSpringCloudApp = new Azure.AppPlatform.SpringCloudApp("example", new()
 *     {
 *         Name = "example-springcloudapp",
 *         ResourceGroupName = example.Name,
 *         ServiceName = exampleSpringCloudService.Name,
 *         Identity = new Azure.AppPlatform.Inputs.SpringCloudAppIdentityArgs
 *         {
 *             Type = "SystemAssigned",
 *         },
 *     });
 *     var exampleSpringCloudJavaDeployment = new Azure.AppPlatform.SpringCloudJavaDeployment("example", new()
 *     {
 *         Name = "deploy1",
 *         SpringCloudAppId = exampleSpringCloudApp.Id,
 *         InstanceCount = 2,
 *         JvmOptions = "-XX:+PrintGC",
 *         Quota = new Azure.AppPlatform.Inputs.SpringCloudJavaDeploymentQuotaArgs
 *         {
 *             Cpu = "2",
 *             Memory = "4Gi",
 *         },
 *         RuntimeVersion = "Java_11",
 *         EnvironmentVariables =
 *         {
 *             { "Foo", "Bar" },
 *             { "Env", "Staging" },
 *         },
 *     });
 * });
 * ```
 * ```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-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudService, err := appplatform.NewSpringCloudService(ctx, "example", &appplatform.SpringCloudServiceArgs{
 * 			Name:              pulumi.String("example-springcloud"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSpringCloudApp, err := appplatform.NewSpringCloudApp(ctx, "example", &appplatform.SpringCloudAppArgs{
 * 			Name:              pulumi.String("example-springcloudapp"),
 * 			ResourceGroupName: example.Name,
 * 			ServiceName:       exampleSpringCloudService.Name,
 * 			Identity: &appplatform.SpringCloudAppIdentityArgs{
 * 				Type: pulumi.String("SystemAssigned"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appplatform.NewSpringCloudJavaDeployment(ctx, "example", &appplatform.SpringCloudJavaDeploymentArgs{
 * 			Name:             pulumi.String("deploy1"),
 * 			SpringCloudAppId: exampleSpringCloudApp.ID(),
 * 			InstanceCount:    pulumi.Int(2),
 * 			JvmOptions:       pulumi.String("-XX:+PrintGC"),
 * 			Quota: &appplatform.SpringCloudJavaDeploymentQuotaArgs{
 * 				Cpu:    pulumi.String("2"),
 * 				Memory: pulumi.String("4Gi"),
 * 			},
 * 			RuntimeVersion: pulumi.String("Java_11"),
 * 			EnvironmentVariables: pulumi.StringMap{
 * 				"Foo": pulumi.String("Bar"),
 * 				"Env": pulumi.String("Staging"),
 * 			},
 * 		})
 * 		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.inputs.SpringCloudAppIdentityArgs;
 * import com.pulumi.azure.appplatform.SpringCloudJavaDeployment;
 * import com.pulumi.azure.appplatform.SpringCloudJavaDeploymentArgs;
 * import com.pulumi.azure.appplatform.inputs.SpringCloudJavaDeploymentQuotaArgs;
 * 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 exampleSpringCloudService = new SpringCloudService("exampleSpringCloudService", SpringCloudServiceArgs.builder()
 *             .name("example-springcloud")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .build());
 *         var exampleSpringCloudApp = new SpringCloudApp("exampleSpringCloudApp", SpringCloudAppArgs.builder()
 *             .name("example-springcloudapp")
 *             .resourceGroupName(example.name())
 *             .serviceName(exampleSpringCloudService.name())
 *             .identity(SpringCloudAppIdentityArgs.builder()
 *                 .type("SystemAssigned")
 *                 .build())
 *             .build());
 *         var exampleSpringCloudJavaDeployment = new SpringCloudJavaDeployment("exampleSpringCloudJavaDeployment", SpringCloudJavaDeploymentArgs.builder()
 *             .name("deploy1")
 *             .springCloudAppId(exampleSpringCloudApp.id())
 *             .instanceCount(2)
 *             .jvmOptions("-XX:+PrintGC")
 *             .quota(SpringCloudJavaDeploymentQuotaArgs.builder()
 *                 .cpu("2")
 *                 .memory("4Gi")
 *                 .build())
 *             .runtimeVersion("Java_11")
 *             .environmentVariables(Map.ofEntries(
 *                 Map.entry("Foo", "Bar"),
 *                 Map.entry("Env", "Staging")
 *             ))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleSpringCloudService:
 *     type: azure:appplatform:SpringCloudService
 *     name: example
 *     properties:
 *       name: example-springcloud
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *   exampleSpringCloudApp:
 *     type: azure:appplatform:SpringCloudApp
 *     name: example
 *     properties:
 *       name: example-springcloudapp
 *       resourceGroupName: ${example.name}
 *       serviceName: ${exampleSpringCloudService.name}
 *       identity:
 *         type: SystemAssigned
 *   exampleSpringCloudJavaDeployment:
 *     type: azure:appplatform:SpringCloudJavaDeployment
 *     name: example
 *     properties:
 *       name: deploy1
 *       springCloudAppId: ${exampleSpringCloudApp.id}
 *       instanceCount: 2
 *       jvmOptions: -XX:+PrintGC
 *       quota:
 *         cpu: '2'
 *         memory: 4Gi
 *       runtimeVersion: Java_11
 *       environmentVariables:
 *         Foo: Bar
 *         Env: Staging
 * ```
 * 
 * ## Import
 * Spring Cloud Deployment can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appplatform/springCloudJavaDeployment:SpringCloudJavaDeployment example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourcegroup1/providers/Microsoft.AppPlatform/spring/service1/apps/app1/deployments/deploy1
 * ```
 * @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 jvmOptions Specifies the jvm option of the Spring Cloud Deployment.
 * @property name Specifies the name of the Spring Cloud Deployment. Changing this forces a new resource to be created.
 * @property quota A `quota` block as defined below.
 * @property runtimeVersion Specifies the runtime version of the Spring Cloud Deployment. Possible Values are `Java_8`, `Java_11` and `Java_17`. Defaults to `Java_8`.
 * @property springCloudAppId Specifies the id of the Spring Cloud Application in which to create the Deployment. Changing this forces a new resource to be created.
 */
public data class SpringCloudJavaDeploymentArgs(
    public val environmentVariables: Output>? = null,
    public val instanceCount: Output? = null,
    public val jvmOptions: Output? = null,
    public val name: Output? = null,
    public val quota: Output? = null,
    public val runtimeVersion: Output? = null,
    public val springCloudAppId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appplatform.SpringCloudJavaDeploymentArgs =
        com.pulumi.azure.appplatform.SpringCloudJavaDeploymentArgs.builder()
            .environmentVariables(
                environmentVariables?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .instanceCount(instanceCount?.applyValue({ args0 -> args0 }))
            .jvmOptions(jvmOptions?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .quota(quota?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .runtimeVersion(runtimeVersion?.applyValue({ args0 -> args0 }))
            .springCloudAppId(springCloudAppId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SpringCloudJavaDeploymentArgs].
 */
@PulumiTagMarker
public class SpringCloudJavaDeploymentArgsBuilder internal constructor() {
    private var environmentVariables: Output>? = null

    private var instanceCount: Output? = null

    private var jvmOptions: Output? = null

    private var name: Output? = null

    private var quota: Output? = null

    private var runtimeVersion: Output? = null

    private var springCloudAppId: Output? = null

    /**
     * @param value Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
     */
    @JvmName("omvqwipquxdfgxln")
    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("bolgblwegbbtypns")
    public suspend fun instanceCount(`value`: Output) {
        this.instanceCount = value
    }

    /**
     * @param value Specifies the jvm option of the Spring Cloud Deployment.
     */
    @JvmName("sxeiwptunhskjfsp")
    public suspend fun jvmOptions(`value`: Output) {
        this.jvmOptions = value
    }

    /**
     * @param value Specifies the name of the Spring Cloud Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("vgjhxpqfwuvsfcts")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value Specifies the runtime version of the Spring Cloud Deployment. Possible Values are `Java_8`, `Java_11` and `Java_17`. Defaults to `Java_8`.
     */
    @JvmName("pltfsqpvgojfstya")
    public suspend fun runtimeVersion(`value`: Output) {
        this.runtimeVersion = value
    }

    /**
     * @param value Specifies the id of the Spring Cloud Application in which to create the Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("cdltdfqaqkyeadhr")
    public suspend fun springCloudAppId(`value`: Output) {
        this.springCloudAppId = value
    }

    /**
     * @param value Specifies the environment variables of the Spring Cloud Deployment as a map of key-value pairs.
     */
    @JvmName("thyxdawwdngcimyd")
    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("niuybecqudkjkhvx")
    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("ljdbmcqqbictngid")
    public suspend fun instanceCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceCount = mapped
    }

    /**
     * @param value Specifies the jvm option of the Spring Cloud Deployment.
     */
    @JvmName("sxmihwdqdorwogdc")
    public suspend fun jvmOptions(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.jvmOptions = mapped
    }

    /**
     * @param value Specifies the name of the Spring Cloud Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("pdvkaeabhwmaauei")
    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("npkdmhnxmhrbgtgu")
    public suspend fun quota(`value`: SpringCloudJavaDeploymentQuotaArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.quota = mapped
    }

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

    /**
     * @param value Specifies the runtime version of the Spring Cloud Deployment. Possible Values are `Java_8`, `Java_11` and `Java_17`. Defaults to `Java_8`.
     */
    @JvmName("dxkejvnwlbjmtfdy")
    public suspend fun runtimeVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.runtimeVersion = mapped
    }

    /**
     * @param value Specifies the id of the Spring Cloud Application in which to create the Deployment. Changing this forces a new resource to be created.
     */
    @JvmName("temobxpntxywshwt")
    public suspend fun springCloudAppId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.springCloudAppId = mapped
    }

    internal fun build(): SpringCloudJavaDeploymentArgs = SpringCloudJavaDeploymentArgs(
        environmentVariables = environmentVariables,
        instanceCount = instanceCount,
        jvmOptions = jvmOptions,
        name = name,
        quota = quota,
        runtimeVersion = runtimeVersion,
        springCloudAppId = springCloudAppId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy