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

com.pulumi.azurenative.servicefabric.kotlin.ManagedClusterServiceArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.servicefabric.kotlin

import com.pulumi.azurenative.servicefabric.ManagedClusterServiceArgs.builder
import com.pulumi.azurenative.servicefabric.kotlin.inputs.StatefulServicePropertiesArgs
import com.pulumi.azurenative.servicefabric.kotlin.inputs.StatelessServicePropertiesArgs
import com.pulumi.core.Either
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

/**
 * The service resource.
 * Azure REST API version: 2023-03-01-preview.
 * Other available API versions: 2023-07-01-preview, 2023-09-01-preview, 2023-11-01-preview, 2023-12-01-preview, 2024-02-01-preview, 2024-04-01, 2024-06-01-preview.
 * ## Example Usage
 * ### Put a service with maximum parameters
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var managedClusterService = new AzureNative.ServiceFabric.ManagedClusterService("managedClusterService", new()
 *     {
 *         ApplicationName = "myApp",
 *         ClusterName = "myCluster",
 *         Location = "eastus",
 *         Properties = new AzureNative.ServiceFabric.Inputs.StatelessServicePropertiesArgs
 *         {
 *             CorrelationScheme = new[]
 *             {
 *                 new AzureNative.ServiceFabric.Inputs.ServiceCorrelationArgs
 *                 {
 *                     Scheme = AzureNative.ServiceFabric.ServiceCorrelationScheme.AlignedAffinity,
 *                     ServiceName = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1",
 *                 },
 *             },
 *             DefaultMoveCost = AzureNative.ServiceFabric.MoveCost.Medium,
 *             InstanceCount = 5,
 *             MinInstanceCount = 3,
 *             MinInstancePercentage = 30,
 *             PartitionDescription = new AzureNative.ServiceFabric.Inputs.SingletonPartitionSchemeArgs
 *             {
 *                 PartitionScheme = "Singleton",
 *             },
 *             PlacementConstraints = "NodeType==frontend",
 *             ScalingPolicies = new[]
 *             {
 *                 new AzureNative.ServiceFabric.Inputs.ScalingPolicyArgs
 *                 {
 *                     ScalingMechanism = new AzureNative.ServiceFabric.Inputs.PartitionInstanceCountScaleMechanismArgs
 *                     {
 *                         Kind = "ScalePartitionInstanceCount",
 *                         MaxInstanceCount = 9,
 *                         MinInstanceCount = 3,
 *                         ScaleIncrement = 2,
 *                     },
 *                     ScalingTrigger = new AzureNative.ServiceFabric.Inputs.AveragePartitionLoadScalingTriggerArgs
 *                     {
 *                         Kind = "AveragePartitionLoadTrigger",
 *                         LowerLoadThreshold = 2,
 *                         MetricName = "metricName",
 *                         ScaleInterval = "00:01:00",
 *                         UpperLoadThreshold = 8,
 *                     },
 *                 },
 *             },
 *             ServiceDnsName = "myservicednsname.myApp",
 *             ServiceKind = "Stateless",
 *             ServiceLoadMetrics = new[]
 *             {
 *                 new AzureNative.ServiceFabric.Inputs.ServiceLoadMetricArgs
 *                 {
 *                     DefaultLoad = 3,
 *                     Name = "metric1",
 *                     Weight = AzureNative.ServiceFabric.ServiceLoadMetricWeight.Low,
 *                 },
 *             },
 *             ServicePackageActivationMode = AzureNative.ServiceFabric.ServicePackageActivationMode.SharedProcess,
 *             ServicePlacementPolicies = new[]
 *             {
 *                 new AzureNative.ServiceFabric.Inputs.ServicePlacementNonPartiallyPlaceServicePolicyArgs
 *                 {
 *                     Type = "NonPartiallyPlaceService",
 *                 },
 *             },
 *             ServiceTypeName = "myServiceType",
 *         },
 *         ResourceGroupName = "resRg",
 *         ServiceName = "myService",
 *         Tags =
 *         {
 *             { "a", "b" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	servicefabric "github.com/pulumi/pulumi-azure-native-sdk/servicefabric/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := servicefabric.NewManagedClusterService(ctx, "managedClusterService", &servicefabric.ManagedClusterServiceArgs{
 * 			ApplicationName: pulumi.String("myApp"),
 * 			ClusterName:     pulumi.String("myCluster"),
 * 			Location:        pulumi.String("eastus"),
 * 			Properties: &servicefabric.StatelessServicePropertiesArgs{
 * 				CorrelationScheme: servicefabric.ServiceCorrelationArray{
 * 					&servicefabric.ServiceCorrelationArgs{
 * 						Scheme:      pulumi.String(servicefabric.ServiceCorrelationSchemeAlignedAffinity),
 * 						ServiceName: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1"),
 * 					},
 * 				},
 * 				DefaultMoveCost:       pulumi.String(servicefabric.MoveCostMedium),
 * 				InstanceCount:         pulumi.Int(5),
 * 				MinInstanceCount:      pulumi.Int(3),
 * 				MinInstancePercentage: pulumi.Int(30),
 * 				PartitionDescription: servicefabric.SingletonPartitionScheme{
 * 					PartitionScheme: "Singleton",
 * 				},
 * 				PlacementConstraints: pulumi.String("NodeType==frontend"),
 * 				ScalingPolicies: servicefabric.ScalingPolicyArray{
 * 					&servicefabric.ScalingPolicyArgs{
 * 						ScalingMechanism: servicefabric.PartitionInstanceCountScaleMechanism{
 * 							Kind:             "ScalePartitionInstanceCount",
 * 							MaxInstanceCount: 9,
 * 							MinInstanceCount: 3,
 * 							ScaleIncrement:   2,
 * 						},
 * 						ScalingTrigger: servicefabric.AveragePartitionLoadScalingTrigger{
 * 							Kind:               "AveragePartitionLoadTrigger",
 * 							LowerLoadThreshold: 2,
 * 							MetricName:         "metricName",
 * 							ScaleInterval:      "00:01:00",
 * 							UpperLoadThreshold: 8,
 * 						},
 * 					},
 * 				},
 * 				ServiceDnsName: pulumi.String("myservicednsname.myApp"),
 * 				ServiceKind:    pulumi.String("Stateless"),
 * 				ServiceLoadMetrics: servicefabric.ServiceLoadMetricArray{
 * 					&servicefabric.ServiceLoadMetricArgs{
 * 						DefaultLoad: pulumi.Int(3),
 * 						Name:        pulumi.String("metric1"),
 * 						Weight:      pulumi.String(servicefabric.ServiceLoadMetricWeightLow),
 * 					},
 * 				},
 * 				ServicePackageActivationMode: pulumi.String(servicefabric.ServicePackageActivationModeSharedProcess),
 * 				ServicePlacementPolicies: pulumi.Array{
 * 					servicefabric.ServicePlacementNonPartiallyPlaceServicePolicy{
 * 						Type: "NonPartiallyPlaceService",
 * 					},
 * 				},
 * 				ServiceTypeName: pulumi.String("myServiceType"),
 * 			},
 * 			ResourceGroupName: pulumi.String("resRg"),
 * 			ServiceName:       pulumi.String("myService"),
 * 			Tags: pulumi.StringMap{
 * 				"a": pulumi.String("b"),
 * 			},
 * 		})
 * 		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.azurenative.servicefabric.ManagedClusterService;
 * import com.pulumi.azurenative.servicefabric.ManagedClusterServiceArgs;
 * 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 managedClusterService = new ManagedClusterService("managedClusterService", ManagedClusterServiceArgs.builder()
 *             .applicationName("myApp")
 *             .clusterName("myCluster")
 *             .location("eastus")
 *             .properties(StatelessServicePropertiesArgs.builder()
 *                 .correlationScheme(ServiceCorrelationArgs.builder()
 *                     .scheme("AlignedAffinity")
 *                     .serviceName("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1")
 *                     .build())
 *                 .defaultMoveCost("Medium")
 *                 .instanceCount(5)
 *                 .minInstanceCount(3)
 *                 .minInstancePercentage(30)
 *                 .partitionDescription(SingletonPartitionSchemeArgs.builder()
 *                     .partitionScheme("Singleton")
 *                     .build())
 *                 .placementConstraints("NodeType==frontend")
 *                 .scalingPolicies(ScalingPolicyArgs.builder()
 *                     .scalingMechanism(AddRemoveIncrementalNamedPartitionScalingMechanismArgs.builder()
 *                         .kind("ScalePartitionInstanceCount")
 *                         .maxInstanceCount(9)
 *                         .minInstanceCount(3)
 *                         .scaleIncrement(2)
 *                         .build())
 *                     .scalingTrigger(AveragePartitionLoadScalingTriggerArgs.builder()
 *                         .kind("AveragePartitionLoadTrigger")
 *                         .lowerLoadThreshold(2)
 *                         .metricName("metricName")
 *                         .scaleInterval("00:01:00")
 *                         .upperLoadThreshold(8)
 *                         .build())
 *                     .build())
 *                 .serviceDnsName("myservicednsname.myApp")
 *                 .serviceKind("Stateless")
 *                 .serviceLoadMetrics(ServiceLoadMetricArgs.builder()
 *                     .defaultLoad(3)
 *                     .name("metric1")
 *                     .weight("Low")
 *                     .build())
 *                 .servicePackageActivationMode("SharedProcess")
 *                 .servicePlacementPolicies(ServicePlacementNonPartiallyPlaceServicePolicyArgs.builder()
 *                     .type("NonPartiallyPlaceService")
 *                     .build())
 *                 .serviceTypeName("myServiceType")
 *                 .build())
 *             .resourceGroupName("resRg")
 *             .serviceName("myService")
 *             .tags(Map.of("a", "b"))
 *             .build());
 *     }
 * }
 * ```
 * ### Put a service with minimum parameters
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var managedClusterService = new AzureNative.ServiceFabric.ManagedClusterService("managedClusterService", new()
 *     {
 *         ApplicationName = "myApp",
 *         ClusterName = "myCluster",
 *         Location = "eastus",
 *         Properties = new AzureNative.ServiceFabric.Inputs.StatelessServicePropertiesArgs
 *         {
 *             InstanceCount = 1,
 *             PartitionDescription = new AzureNative.ServiceFabric.Inputs.SingletonPartitionSchemeArgs
 *             {
 *                 PartitionScheme = "Singleton",
 *             },
 *             ServiceKind = "Stateless",
 *             ServiceTypeName = "myServiceType",
 *         },
 *         ResourceGroupName = "resRg",
 *         ServiceName = "myService",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	servicefabric "github.com/pulumi/pulumi-azure-native-sdk/servicefabric/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := servicefabric.NewManagedClusterService(ctx, "managedClusterService", &servicefabric.ManagedClusterServiceArgs{
 * 			ApplicationName: pulumi.String("myApp"),
 * 			ClusterName:     pulumi.String("myCluster"),
 * 			Location:        pulumi.String("eastus"),
 * 			Properties: &servicefabric.StatelessServicePropertiesArgs{
 * 				InstanceCount: pulumi.Int(1),
 * 				PartitionDescription: servicefabric.SingletonPartitionScheme{
 * 					PartitionScheme: "Singleton",
 * 				},
 * 				ServiceKind:     pulumi.String("Stateless"),
 * 				ServiceTypeName: pulumi.String("myServiceType"),
 * 			},
 * 			ResourceGroupName: pulumi.String("resRg"),
 * 			ServiceName:       pulumi.String("myService"),
 * 		})
 * 		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.azurenative.servicefabric.ManagedClusterService;
 * import com.pulumi.azurenative.servicefabric.ManagedClusterServiceArgs;
 * 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 managedClusterService = new ManagedClusterService("managedClusterService", ManagedClusterServiceArgs.builder()
 *             .applicationName("myApp")
 *             .clusterName("myCluster")
 *             .location("eastus")
 *             .properties(StatelessServicePropertiesArgs.builder()
 *                 .instanceCount(1)
 *                 .partitionDescription(SingletonPartitionSchemeArgs.builder()
 *                     .partitionScheme("Singleton")
 *                     .build())
 *                 .serviceKind("Stateless")
 *                 .serviceTypeName("myServiceType")
 *                 .build())
 *             .resourceGroupName("resRg")
 *             .serviceName("myService")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:servicefabric:ManagedClusterService myService /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}
 * ```
 * @property applicationName The name of the application resource.
 * @property clusterName The name of the cluster resource.
 * @property location Resource location depends on the parent resource.
 * @property properties The service resource properties.
 * @property resourceGroupName The name of the resource group.
 * @property serviceName The name of the service resource in the format of {applicationName}~{serviceName}.
 * @property tags Azure resource tags.
 */
public data class ManagedClusterServiceArgs(
    public val applicationName: Output? = null,
    public val clusterName: Output? = null,
    public val location: Output? = null,
    public val properties: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val serviceName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.servicefabric.ManagedClusterServiceArgs =
        com.pulumi.azurenative.servicefabric.ManagedClusterServiceArgs.builder()
            .applicationName(applicationName?.applyValue({ args0 -> args0 }))
            .clusterName(clusterName?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .properties(
                properties?.applyValue({ args0 ->
                    args0.transform({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    }, { args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serviceName(serviceName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [ManagedClusterServiceArgs].
 */
@PulumiTagMarker
public class ManagedClusterServiceArgsBuilder internal constructor() {
    private var applicationName: Output? = null

    private var clusterName: Output? = null

    private var location: Output? = null

    private var properties:
        Output>? = null

    private var resourceGroupName: Output? = null

    private var serviceName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value The name of the application resource.
     */
    @JvmName("ktbnprftukkvxjhv")
    public suspend fun applicationName(`value`: Output) {
        this.applicationName = value
    }

    /**
     * @param value The name of the cluster resource.
     */
    @JvmName("oiiptispmbhjrber")
    public suspend fun clusterName(`value`: Output) {
        this.clusterName = value
    }

    /**
     * @param value Resource location depends on the parent resource.
     */
    @JvmName("wtntlhnagtfchiwk")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The service resource properties.
     */
    @JvmName("akkvnvntfiqldhfq")
    public suspend fun properties(`value`: Output>) {
        this.properties = value
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("lcpragikrgtlctby")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the service resource in the format of {applicationName}~{serviceName}.
     */
    @JvmName("ivfebvogqsusgghr")
    public suspend fun serviceName(`value`: Output) {
        this.serviceName = value
    }

    /**
     * @param value Azure resource tags.
     */
    @JvmName("hdfdmegggrmryqhn")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The name of the application resource.
     */
    @JvmName("yodjfecsuqrqfsvs")
    public suspend fun applicationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationName = mapped
    }

    /**
     * @param value The name of the cluster resource.
     */
    @JvmName("pxoerspxhkrgrell")
    public suspend fun clusterName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.clusterName = mapped
    }

    /**
     * @param value Resource location depends on the parent resource.
     */
    @JvmName("wcjjwoqptwmdyhgm")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The service resource properties.
     */
    @JvmName("vhtxppsfifnqiwjr")
    public suspend fun properties(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param value The service resource properties.
     */
    @JvmName("lptyncqwtwcdrqea")
    public fun properties(`value`: StatefulServicePropertiesArgs) {
        val toBeMapped = Either.ofLeft<
            StatefulServicePropertiesArgs,
            StatelessServicePropertiesArgs,
            >(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param value The service resource properties.
     */
    @JvmName("qysniotprfungfwx")
    public fun properties(`value`: StatelessServicePropertiesArgs) {
        val toBeMapped = Either.ofRight<
            StatefulServicePropertiesArgs,
            StatelessServicePropertiesArgs,
            >(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.properties = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("nvlhxbgflenoryms")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the service resource in the format of {applicationName}~{serviceName}.
     */
    @JvmName("twsiqqkvnylnever")
    public suspend fun serviceName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceName = mapped
    }

    /**
     * @param value Azure resource tags.
     */
    @JvmName("gpbhwklgslgidpnw")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values Azure resource tags.
     */
    @JvmName("xgrhmsxdsuyguooa")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): ManagedClusterServiceArgs = ManagedClusterServiceArgs(
        applicationName = applicationName,
        clusterName = clusterName,
        location = location,
        properties = properties,
        resourceGroupName = resourceGroupName,
        serviceName = serviceName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy