Managed Cluster Service
The service resource. Azure REST API version: 2023-03-01-preview. Other available API versions: 2023-07-01-preview, 2023-09-01-preview.
Example Usage
Put a service with maximum parameters
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 = "AlignedAffinity",
ServiceName = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1",
},
},
DefaultMoveCost = "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 = "Low",
},
},
ServicePackageActivationMode = "SharedProcess",
ServicePlacementPolicies = new[]
{
new AzureNative.ServiceFabric.Inputs.ServicePlacementNonPartiallyPlaceServicePolicyArgs
{
Type = "NonPartiallyPlaceService",
},
},
ServiceTypeName = "myServiceType",
},
ResourceGroupName = "resRg",
ServiceName = "myService",
Tags =
{
{ "a", "b" },
},
});
});
Content copied to clipboard
package main
import (
"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.StatelessServiceProperties{
CorrelationScheme: []servicefabric.ServiceCorrelation{
{
Scheme: "AlignedAffinity",
ServiceName: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1",
},
},
DefaultMoveCost: "Medium",
InstanceCount: 5,
MinInstanceCount: 3,
MinInstancePercentage: 30,
PartitionDescription: servicefabric.SingletonPartitionScheme{
PartitionScheme: "Singleton",
},
PlacementConstraints: "NodeType==frontend",
ScalingPolicies: []servicefabric.ScalingPolicy{
{
ScalingMechanism: {
Kind: "ScalePartitionInstanceCount",
MaxInstanceCount: 9,
MinInstanceCount: 3,
ScaleIncrement: 2,
},
ScalingTrigger: {
Kind: "AveragePartitionLoadTrigger",
LowerLoadThreshold: 2,
MetricName: "metricName",
ScaleInterval: "00:01:00",
UpperLoadThreshold: 8,
},
},
},
ServiceDnsName: "myservicednsname.myApp",
ServiceKind: "Stateless",
ServiceLoadMetrics: []servicefabric.ServiceLoadMetric{
{
DefaultLoad: 3,
Name: "metric1",
Weight: "Low",
},
},
ServicePackageActivationMode: "SharedProcess",
ServicePlacementPolicies: []interface{}{
servicefabric.ServicePlacementNonPartiallyPlaceServicePolicy{
Type: "NonPartiallyPlaceService",
},
},
ServiceTypeName: "myServiceType",
},
ResourceGroupName: pulumi.String("resRg"),
ServiceName: pulumi.String("myService"),
Tags: pulumi.StringMap{
"a": pulumi.String("b"),
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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(Map.ofEntries(
Map.entry("correlationScheme", Map.ofEntries(
Map.entry("scheme", "AlignedAffinity"),
Map.entry("serviceName", "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1")
)),
Map.entry("defaultMoveCost", "Medium"),
Map.entry("instanceCount", 5),
Map.entry("minInstanceCount", 3),
Map.entry("minInstancePercentage", 30),
Map.entry("partitionDescription", Map.of("partitionScheme", "Singleton")),
Map.entry("placementConstraints", "NodeType==frontend"),
Map.entry("scalingPolicies", Map.ofEntries(
Map.entry("scalingMechanism", Map.ofEntries(
Map.entry("kind", "ScalePartitionInstanceCount"),
Map.entry("maxInstanceCount", 9),
Map.entry("minInstanceCount", 3),
Map.entry("scaleIncrement", 2)
)),
Map.entry("scalingTrigger", Map.ofEntries(
Map.entry("kind", "AveragePartitionLoadTrigger"),
Map.entry("lowerLoadThreshold", 2),
Map.entry("metricName", "metricName"),
Map.entry("scaleInterval", "00:01:00"),
Map.entry("upperLoadThreshold", 8)
))
)),
Map.entry("serviceDnsName", "myservicednsname.myApp"),
Map.entry("serviceKind", "Stateless"),
Map.entry("serviceLoadMetrics", Map.ofEntries(
Map.entry("defaultLoad", 3),
Map.entry("name", "metric1"),
Map.entry("weight", "Low")
)),
Map.entry("servicePackageActivationMode", "SharedProcess"),
Map.entry("servicePlacementPolicies", Map.of("type", "NonPartiallyPlaceService")),
Map.entry("serviceTypeName", "myServiceType")
))
.resourceGroupName("resRg")
.serviceName("myService")
.tags(Map.of("a", "b"))
.build());
}
}
Content copied to clipboard
Put a service with minimum parameters
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",
});
});
Content copied to clipboard
package main
import (
"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.StatelessServiceProperties{
InstanceCount: 1,
PartitionDescription: servicefabric.SingletonPartitionScheme{
PartitionScheme: "Singleton",
},
ServiceKind: "Stateless",
ServiceTypeName: "myServiceType",
},
ResourceGroupName: pulumi.String("resRg"),
ServiceName: pulumi.String("myService"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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(Map.ofEntries(
Map.entry("instanceCount", 1),
Map.entry("partitionDescription", Map.of("partitionScheme", "Singleton")),
Map.entry("serviceKind", "Stateless"),
Map.entry("serviceTypeName", "myServiceType")
))
.resourceGroupName("resRg")
.serviceName("myService")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:servicefabric:ManagedClusterService myService /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}
Content copied to clipboard
Properties
Link copied to clipboard
val properties: Output<Either<StatefulServicePropertiesResponse, StatelessServicePropertiesResponse>>