ServiceArgs

data class ServiceArgs(val applicationName: Output<String>? = null, val clusterName: Output<String>? = null, val correlationScheme: Output<List<ServiceCorrelationDescriptionArgs>>? = null, val defaultMoveCost: Output<Either<String, MoveCost>>? = null, val location: Output<String>? = null, val partitionDescription: Output<Any>? = null, val placementConstraints: Output<String>? = null, val resourceGroupName: Output<String>? = null, val serviceDnsName: Output<String>? = null, val serviceKind: Output<Either<String, ServiceKind>>? = null, val serviceLoadMetrics: Output<List<ServiceLoadMetricDescriptionArgs>>? = null, val serviceName: Output<String>? = null, val servicePackageActivationMode: Output<Either<String, ArmServicePackageActivationMode>>? = null, val servicePlacementPolicies: Output<List<ServicePlacementPolicyDescriptionArgs>>? = null, val serviceTypeName: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ServiceArgs>

The service resource. API Version: 2020-03-01.

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 service = new AzureNative.ServiceFabric.Service("service", new()
{
ApplicationName = "myApp",
ClusterName = "myCluster",
CorrelationScheme = new[]
{
new AzureNative.ServiceFabric.Inputs.ServiceCorrelationDescriptionArgs
{
Scheme = "Affinity",
ServiceName = "fabric:/app1/app1~svc1",
},
},
DefaultMoveCost = "Medium",
PartitionDescription = new AzureNative.ServiceFabric.Inputs.SingletonPartitionSchemeDescriptionArgs
{
PartitionScheme = "Singleton",
},
PlacementConstraints = "NodeType==frontend",
ResourceGroupName = "resRg",
ServiceDnsName = "my.service.dns",
ServiceKind = "Stateless",
ServiceLoadMetrics = new[]
{
new AzureNative.ServiceFabric.Inputs.ServiceLoadMetricDescriptionArgs
{
Name = "metric1",
Weight = "Low",
},
},
ServiceName = "myService",
ServicePackageActivationMode = "SharedProcess",
ServicePlacementPolicies = new[] {},
ServiceTypeName = "myServiceType",
});
});
package main
import (
servicefabric "github.com/pulumi/pulumi-azure-native-sdk/servicefabric"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := servicefabric.NewService(ctx, "service", &servicefabric.ServiceArgs{
ApplicationName: pulumi.String("myApp"),
ClusterName: pulumi.String("myCluster"),
CorrelationScheme: []servicefabric.ServiceCorrelationDescriptionArgs{
{
Scheme: pulumi.String("Affinity"),
ServiceName: pulumi.String("fabric:/app1/app1~svc1"),
},
},
DefaultMoveCost: pulumi.String("Medium"),
PartitionDescription: servicefabric.SingletonPartitionSchemeDescription{
PartitionScheme: "Singleton",
},
PlacementConstraints: pulumi.String("NodeType==frontend"),
ResourceGroupName: pulumi.String("resRg"),
ServiceDnsName: pulumi.String("my.service.dns"),
ServiceKind: pulumi.String("Stateless"),
ServiceLoadMetrics: []servicefabric.ServiceLoadMetricDescriptionArgs{
{
Name: pulumi.String("metric1"),
Weight: pulumi.String("Low"),
},
},
ServiceName: pulumi.String("myService"),
ServicePackageActivationMode: pulumi.String("SharedProcess"),
ServicePlacementPolicies: servicefabric.ServicePlacementPolicyDescriptionArray{},
ServiceTypeName: pulumi.String("myServiceType"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.servicefabric.Service;
import com.pulumi.azurenative.servicefabric.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.applicationName("myApp")
.clusterName("myCluster")
.correlationScheme(Map.ofEntries(
Map.entry("scheme", "Affinity"),
Map.entry("serviceName", "fabric:/app1/app1~svc1")
))
.defaultMoveCost("Medium")
.partitionDescription(Map.of("partitionScheme", "Singleton"))
.placementConstraints("NodeType==frontend")
.resourceGroupName("resRg")
.serviceDnsName("my.service.dns")
.serviceKind("Stateless")
.serviceLoadMetrics(Map.ofEntries(
Map.entry("name", "metric1"),
Map.entry("weight", "Low")
))
.serviceName("myService")
.servicePackageActivationMode("SharedProcess")
.servicePlacementPolicies()
.serviceTypeName("myServiceType")
.build());
}
}

Put a service with minimum parameters

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.ServiceFabric.Service("service", new()
{
ApplicationName = "myApp",
ClusterName = "myCluster",
PartitionDescription = new AzureNative.ServiceFabric.Inputs.SingletonPartitionSchemeDescriptionArgs
{
PartitionScheme = "Singleton",
},
ResourceGroupName = "resRg",
ServiceKind = "Stateless",
ServiceName = "myService",
ServiceTypeName = "myServiceType",
});
});
package main
import (
servicefabric "github.com/pulumi/pulumi-azure-native-sdk/servicefabric"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := servicefabric.NewService(ctx, "service", &servicefabric.ServiceArgs{
ApplicationName: pulumi.String("myApp"),
ClusterName: pulumi.String("myCluster"),
PartitionDescription: servicefabric.SingletonPartitionSchemeDescription{
PartitionScheme: "Singleton",
},
ResourceGroupName: pulumi.String("resRg"),
ServiceKind: pulumi.String("Stateless"),
ServiceName: pulumi.String("myService"),
ServiceTypeName: pulumi.String("myServiceType"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.servicefabric.Service;
import com.pulumi.azurenative.servicefabric.ServiceArgs;
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 service = new Service("service", ServiceArgs.builder()
.applicationName("myApp")
.clusterName("myCluster")
.partitionDescription(Map.of("partitionScheme", "Singleton"))
.resourceGroupName("resRg")
.serviceKind("Stateless")
.serviceName("myService")
.serviceTypeName("myServiceType")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:servicefabric:Service myCluster /subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/clusters/myCluster/applications/myApp/services/myService

Constructors

Link copied to clipboard
constructor(applicationName: Output<String>? = null, clusterName: Output<String>? = null, correlationScheme: Output<List<ServiceCorrelationDescriptionArgs>>? = null, defaultMoveCost: Output<Either<String, MoveCost>>? = null, location: Output<String>? = null, partitionDescription: Output<Any>? = null, placementConstraints: Output<String>? = null, resourceGroupName: Output<String>? = null, serviceDnsName: Output<String>? = null, serviceKind: Output<Either<String, ServiceKind>>? = null, serviceLoadMetrics: Output<List<ServiceLoadMetricDescriptionArgs>>? = null, serviceName: Output<String>? = null, servicePackageActivationMode: Output<Either<String, ArmServicePackageActivationMode>>? = null, servicePlacementPolicies: Output<List<ServicePlacementPolicyDescriptionArgs>>? = null, serviceTypeName: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val applicationName: Output<String>? = null

The name of the application resource.

Link copied to clipboard
val clusterName: Output<String>? = null

The name of the cluster resource.

Link copied to clipboard

A list that describes the correlation of the service with other services.

Link copied to clipboard
val defaultMoveCost: Output<Either<String, MoveCost>>? = null

Specifies the move cost for the service.

Link copied to clipboard
val location: Output<String>? = null

It will be deprecated in New API, resource location depends on the parent resource.

Link copied to clipboard
val partitionDescription: Output<Any>? = null

Describes how the service is partitioned.

Link copied to clipboard
val placementConstraints: Output<String>? = null

The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)".

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group.

Link copied to clipboard
val serviceDnsName: Output<String>? = null

Dns name used for the service. If this is specified, then the service can be accessed via its DNS name instead of service name.

Link copied to clipboard
val serviceKind: Output<Either<String, ServiceKind>>? = null

The kind of service (Stateless or Stateful).

Link copied to clipboard

The service load metrics is given as an array of ServiceLoadMetricDescription objects.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of the service resource in the format of {applicationName}~{serviceName}.

Link copied to clipboard

The activation Mode of the service package

Link copied to clipboard

A list that describes the correlation of the service with other services.

Link copied to clipboard
val serviceTypeName: Output<String>? = null

The name of the service type

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Azure resource tags.

Functions

Link copied to clipboard
open override fun toJava(): ServiceArgs