Service

class Service : KotlinCustomResource

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

Properties

Link copied to clipboard

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

Link copied to clipboard
val defaultMoveCost: Output<String>?

Specifies the move cost for the service.

Link copied to clipboard
val etag: Output<String>

Azure resource etag.

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

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

Link copied to clipboard
val name: Output<String>

Azure resource name.

Link copied to clipboard

Describes how the service is partitioned.

Link copied to clipboard

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

The current deployment or provisioning state, which only appears in the response

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val serviceDnsName: Output<String>?

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<String>

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

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>?

The name of the service type

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

Azure resource tags.

Link copied to clipboard
val type: Output<String>

Azure resource type.

Link copied to clipboard
val urn: Output<String>