CloudService

class CloudService : KotlinCustomResource

Describes the cloud service. API Version: 2021-03-01.

Example Usage

Create New Cloud Service with Multiple Roles

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIPConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoBackend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIPConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles",
Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
),
Map.ofEntries(
Map.entry("name", "ContosoBackend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Single Role

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "myLoadBalancer",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIPConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationArgs
{
Name = "myfe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "myLoadBalancer"),
Map.entry("properties", Map.of("frontendIPConfigurations", Map.ofEntries(
Map.entry("name", "myfe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Single Role and Certificate from Key Vault

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIPConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
OsProfile = new AzureNative.Compute.Inputs.CloudServiceOsProfileArgs
{
Secrets = new[]
{
new AzureNative.Compute.Inputs.CloudServiceVaultSecretGroupArgs
{
SourceVault = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}",
},
VaultCertificates = new[]
{
new AzureNative.Compute.Inputs.CloudServiceVaultCertificateArgs
{
CertificateUrl = "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}",
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIPConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("osProfile", Map.of("secrets", Map.ofEntries(
Map.entry("sourceVault", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}")),
Map.entry("vaultCertificates", Map.of("certificateUrl", "https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}"))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Create New Cloud Service with Single Role and RDP Extension

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cloudService = new AzureNative.Compute.CloudService("cloudService", new()
{
CloudServiceName = "{cs-name}",
Location = "westus",
Properties = new AzureNative.Compute.Inputs.CloudServicePropertiesArgs
{
Configuration = "{ServiceConfiguration}",
ExtensionProfile = new AzureNative.Compute.Inputs.CloudServiceExtensionProfileArgs
{
Extensions = new[]
{
new AzureNative.Compute.Inputs.ExtensionArgs
{
Name = "RDPExtension",
Properties = new AzureNative.Compute.Inputs.CloudServiceExtensionPropertiesArgs
{
AutoUpgradeMinorVersion = false,
ProtectedSettings = "<PrivateConfig><Password>{password}</Password></PrivateConfig>",
Publisher = "Microsoft.Windows.Azure.Extensions",
Settings = "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>",
Type = "RDP",
TypeHandlerVersion = "1.2.1",
},
},
},
},
NetworkProfile = new AzureNative.Compute.Inputs.CloudServiceNetworkProfileArgs
{
LoadBalancerConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerConfigurationArgs
{
Name = "contosolb",
Properties = new AzureNative.Compute.Inputs.LoadBalancerConfigurationPropertiesArgs
{
FrontendIPConfigurations = new[]
{
new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationArgs
{
Name = "contosofe",
Properties = new AzureNative.Compute.Inputs.LoadBalancerFrontendIPConfigurationPropertiesArgs
{
PublicIPAddress = new AzureNative.Compute.Inputs.SubResourceArgs
{
Id = "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip",
},
},
},
},
},
},
},
},
PackageUrl = "{PackageUrl}",
RoleProfile = new AzureNative.Compute.Inputs.CloudServiceRoleProfileArgs
{
Roles = new[]
{
new AzureNative.Compute.Inputs.CloudServiceRoleProfilePropertiesArgs
{
Name = "ContosoFrontend",
Sku = new AzureNative.Compute.Inputs.CloudServiceRoleSkuArgs
{
Capacity = 1,
Name = "Standard_D1_v2",
Tier = "Standard",
},
},
},
},
UpgradeMode = "Auto",
},
ResourceGroupName = "ConstosoRG",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.compute.CloudService;
import com.pulumi.azurenative.compute.CloudServiceArgs;
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 cloudService = new CloudService("cloudService", CloudServiceArgs.builder()
.cloudServiceName("{cs-name}")
.location("westus")
.properties(Map.ofEntries(
Map.entry("configuration", "{ServiceConfiguration}"),
Map.entry("extensionProfile", Map.of("extensions", Map.ofEntries(
Map.entry("name", "RDPExtension"),
Map.entry("properties", Map.ofEntries(
Map.entry("autoUpgradeMinorVersion", false),
Map.entry("protectedSettings", "<PrivateConfig><Password>{password}</Password></PrivateConfig>"),
Map.entry("publisher", "Microsoft.Windows.Azure.Extensions"),
Map.entry("settings", "<PublicConfig><UserName>UserAzure</UserName><Expiration>10/22/2021 15:05:45</Expiration></PublicConfig>"),
Map.entry("type", "RDP"),
Map.entry("typeHandlerVersion", "1.2.1")
))
))),
Map.entry("networkProfile", Map.of("loadBalancerConfigurations", Map.ofEntries(
Map.entry("name", "contosolb"),
Map.entry("properties", Map.of("frontendIPConfigurations", Map.ofEntries(
Map.entry("name", "contosofe"),
Map.entry("properties", Map.of("publicIPAddress", Map.of("id", "/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")))
)))
))),
Map.entry("packageUrl", "{PackageUrl}"),
Map.entry("roleProfile", Map.of("roles", Map.ofEntries(
Map.entry("name", "ContosoFrontend"),
Map.entry("sku", Map.ofEntries(
Map.entry("capacity", 1),
Map.entry("name", "Standard_D1_v2"),
Map.entry("tier", "Standard")
))
))),
Map.entry("upgradeMode", "Auto")
))
.resourceGroupName("ConstosoRG")
.build());
}
}

Import

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

$ pulumi import azure-native:compute:CloudService {cs-name} /subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Compute/cloudServices/{cs-name}

Properties

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

Resource location.

Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard

Cloud service properties

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

Resource tags.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>