Service Args
data class ServiceArgs(val location: Output<String>? = null, val properties: Output<ClusterResourcePropertiesArgs>? = null, val resourceGroupName: Output<String>? = null, val serviceName: Output<String>? = null, val sku: Output<SkuArgs>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<ServiceArgs>
Service resource API Version: 2020-07-01.
Example Usage
Services_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.AppPlatform.Service("service", new()
{
Location = "eastus",
Properties = null,
ResourceGroupName = "myResourceGroup",
ServiceName = "myservice",
Sku = new AzureNative.AppPlatform.Inputs.SkuArgs
{
Name = "S0",
Tier = "Standard",
},
Tags =
{
{ "key1", "value1" },
},
});
});
Content copied to clipboard
package main
import (
appplatform "github.com/pulumi/pulumi-azure-native-sdk/appplatform"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := appplatform.NewService(ctx, "service", &appplatform.ServiceArgs{
Location: pulumi.String("eastus"),
Properties: nil,
ResourceGroupName: pulumi.String("myResourceGroup"),
ServiceName: pulumi.String("myservice"),
Sku: &appplatform.SkuArgs{
Name: pulumi.String("S0"),
Tier: pulumi.String("Standard"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
},
})
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.appplatform.Service;
import com.pulumi.azurenative.appplatform.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()
.location("eastus")
.properties()
.resourceGroupName("myResourceGroup")
.serviceName("myservice")
.sku(Map.ofEntries(
Map.entry("name", "S0"),
Map.entry("tier", "Standard")
))
.tags(Map.of("key1", "value1"))
.build());
}
}
Content copied to clipboard
Services_CreateOrUpdate_VNetInjection
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var service = new AzureNative.AppPlatform.Service("service", new()
{
Location = "eastus",
Properties = new AzureNative.AppPlatform.Inputs.ClusterResourcePropertiesArgs
{
NetworkProfile = new AzureNative.AppPlatform.Inputs.NetworkProfileArgs
{
AppNetworkResourceGroup = "my-app-network-rg",
AppSubnetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps",
ServiceCidr = "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16",
ServiceRuntimeNetworkResourceGroup = "my-service-runtime-network-rg",
ServiceRuntimeSubnetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime",
},
},
ResourceGroupName = "myResourceGroup",
ServiceName = "myservice",
Sku = new AzureNative.AppPlatform.Inputs.SkuArgs
{
Name = "S0",
Tier = "Standard",
},
Tags =
{
{ "key1", "value1" },
},
});
});
Content copied to clipboard
package main
import (
appplatform "github.com/pulumi/pulumi-azure-native-sdk/appplatform"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := appplatform.NewService(ctx, "service", &appplatform.ServiceArgs{
Location: pulumi.String("eastus"),
Properties: appplatform.ClusterResourcePropertiesResponse{
NetworkProfile: &appplatform.NetworkProfileArgs{
AppNetworkResourceGroup: pulumi.String("my-app-network-rg"),
AppSubnetId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps"),
ServiceCidr: pulumi.String("10.8.0.0/16,10.244.0.0/16,10.245.0.1/16"),
ServiceRuntimeNetworkResourceGroup: pulumi.String("my-service-runtime-network-rg"),
ServiceRuntimeSubnetId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime"),
},
},
ResourceGroupName: pulumi.String("myResourceGroup"),
ServiceName: pulumi.String("myservice"),
Sku: &appplatform.SkuArgs{
Name: pulumi.String("S0"),
Tier: pulumi.String("Standard"),
},
Tags: pulumi.StringMap{
"key1": pulumi.String("value1"),
},
})
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.appplatform.Service;
import com.pulumi.azurenative.appplatform.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()
.location("eastus")
.properties(Map.of("networkProfile", Map.ofEntries(
Map.entry("appNetworkResourceGroup", "my-app-network-rg"),
Map.entry("appSubnetId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/apps"),
Map.entry("serviceCidr", "10.8.0.0/16,10.244.0.0/16,10.245.0.1/16"),
Map.entry("serviceRuntimeNetworkResourceGroup", "my-service-runtime-network-rg"),
Map.entry("serviceRuntimeSubnetId", "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVirtualNetwork/subnets/serviceRuntime")
)))
.resourceGroupName("myResourceGroup")
.serviceName("myservice")
.sku(Map.ofEntries(
Map.entry("name", "S0"),
Map.entry("tier", "Standard")
))
.tags(Map.of("key1", "value1"))
.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:appplatform:Service myservice /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice
Content copied to clipboard