All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.compute.CloudService Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.compute;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.compute.CloudServiceArgs;
import com.pulumi.azurenative.compute.outputs.CloudServicePropertiesResponse;
import com.pulumi.azurenative.compute.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Describes the cloud service.
 * Azure REST API version: 2022-09-04. Prior API version in Azure Native 1.x: 2021-03-01.
 * 
 * ## Example Usage
 * ### Create New Cloud Service with Multiple Roles
 * 
 * 
 * {@code
 * 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 com.pulumi.azurenative.compute.inputs.CloudServicePropertiesArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceNetworkProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceRoleProfileArgs;
 * 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(CloudServicePropertiesArgs.builder()
 *                 .configuration("{ServiceConfiguration}")
 *                 .networkProfile(CloudServiceNetworkProfileArgs.builder()
 *                     .loadBalancerConfigurations(LoadBalancerConfigurationArgs.builder()
 *                         .name("contosolb")
 *                         .properties(LoadBalancerConfigurationPropertiesArgs.builder()
 *                             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                                 .name("contosofe")
 *                                 .properties(LoadBalancerFrontendIpConfigurationPropertiesArgs.builder()
 *                                     .publicIPAddress(SubResourceArgs.builder()
 *                                         .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")
 *                                         .build())
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .packageUrl("{PackageUrl}")
 *                 .roleProfile(CloudServiceRoleProfileArgs.builder()
 *                     .roles(                    
 *                         CloudServiceRoleProfilePropertiesArgs.builder()
 *                             .name("ContosoFrontend")
 *                             .sku(CloudServiceRoleSkuArgs.builder()
 *                                 .capacity(1)
 *                                 .name("Standard_D1_v2")
 *                                 .tier("Standard")
 *                                 .build())
 *                             .build(),
 *                         CloudServiceRoleProfilePropertiesArgs.builder()
 *                             .name("ContosoBackend")
 *                             .sku(CloudServiceRoleSkuArgs.builder()
 *                                 .capacity(1)
 *                                 .name("Standard_D1_v2")
 *                                 .tier("Standard")
 *                                 .build())
 *                             .build())
 *                     .build())
 *                 .upgradeMode("Auto")
 *                 .build())
 *             .resourceGroupName("ConstosoRG")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create New Cloud Service with Multiple Roles in a specific availability zone * *
 * {@code
 * 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 com.pulumi.azurenative.compute.inputs.CloudServicePropertiesArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceNetworkProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceRoleProfileArgs;
 * 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(CloudServicePropertiesArgs.builder()
 *                 .configuration("{ServiceConfiguration}")
 *                 .networkProfile(CloudServiceNetworkProfileArgs.builder()
 *                     .loadBalancerConfigurations(LoadBalancerConfigurationArgs.builder()
 *                         .name("contosolb")
 *                         .properties(LoadBalancerConfigurationPropertiesArgs.builder()
 *                             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                                 .name("contosofe")
 *                                 .properties(LoadBalancerFrontendIpConfigurationPropertiesArgs.builder()
 *                                     .publicIPAddress(SubResourceArgs.builder()
 *                                         .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")
 *                                         .build())
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .packageUrl("{PackageUrl}")
 *                 .roleProfile(CloudServiceRoleProfileArgs.builder()
 *                     .roles(                    
 *                         CloudServiceRoleProfilePropertiesArgs.builder()
 *                             .name("ContosoFrontend")
 *                             .sku(CloudServiceRoleSkuArgs.builder()
 *                                 .capacity(1)
 *                                 .name("Standard_D1_v2")
 *                                 .tier("Standard")
 *                                 .build())
 *                             .build(),
 *                         CloudServiceRoleProfilePropertiesArgs.builder()
 *                             .name("ContosoBackend")
 *                             .sku(CloudServiceRoleSkuArgs.builder()
 *                                 .capacity(1)
 *                                 .name("Standard_D1_v2")
 *                                 .tier("Standard")
 *                                 .build())
 *                             .build())
 *                     .build())
 *                 .upgradeMode("Auto")
 *                 .build())
 *             .resourceGroupName("ConstosoRG")
 *             .zones("1")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create New Cloud Service with Single Role * *
 * {@code
 * 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 com.pulumi.azurenative.compute.inputs.CloudServicePropertiesArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceNetworkProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceRoleProfileArgs;
 * 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(CloudServicePropertiesArgs.builder()
 *                 .configuration("{ServiceConfiguration}")
 *                 .networkProfile(CloudServiceNetworkProfileArgs.builder()
 *                     .loadBalancerConfigurations(LoadBalancerConfigurationArgs.builder()
 *                         .name("myLoadBalancer")
 *                         .properties(LoadBalancerConfigurationPropertiesArgs.builder()
 *                             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                                 .name("myfe")
 *                                 .properties(LoadBalancerFrontendIpConfigurationPropertiesArgs.builder()
 *                                     .publicIPAddress(SubResourceArgs.builder()
 *                                         .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/myPublicIP")
 *                                         .build())
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .packageUrl("{PackageUrl}")
 *                 .roleProfile(CloudServiceRoleProfileArgs.builder()
 *                     .roles(CloudServiceRoleProfilePropertiesArgs.builder()
 *                         .name("ContosoFrontend")
 *                         .sku(CloudServiceRoleSkuArgs.builder()
 *                             .capacity(1)
 *                             .name("Standard_D1_v2")
 *                             .tier("Standard")
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .upgradeMode("Auto")
 *                 .build())
 *             .resourceGroupName("ConstosoRG")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create New Cloud Service with Single Role and Certificate from Key Vault * *
 * {@code
 * 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 com.pulumi.azurenative.compute.inputs.CloudServicePropertiesArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceNetworkProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceOsProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceRoleProfileArgs;
 * 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(CloudServicePropertiesArgs.builder()
 *                 .configuration("{ServiceConfiguration}")
 *                 .networkProfile(CloudServiceNetworkProfileArgs.builder()
 *                     .loadBalancerConfigurations(LoadBalancerConfigurationArgs.builder()
 *                         .name("contosolb")
 *                         .properties(LoadBalancerConfigurationPropertiesArgs.builder()
 *                             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                                 .name("contosofe")
 *                                 .properties(LoadBalancerFrontendIpConfigurationPropertiesArgs.builder()
 *                                     .publicIPAddress(SubResourceArgs.builder()
 *                                         .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")
 *                                         .build())
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .osProfile(CloudServiceOsProfileArgs.builder()
 *                     .secrets(CloudServiceVaultSecretGroupArgs.builder()
 *                         .sourceVault(SubResourceArgs.builder()
 *                             .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.KeyVault/vaults/{keyvault-name}")
 *                             .build())
 *                         .vaultCertificates(CloudServiceVaultCertificateArgs.builder()
 *                             .certificateUrl("https://{keyvault-name}.vault.azure.net:443/secrets/ContosoCertificate/{secret-id}")
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .packageUrl("{PackageUrl}")
 *                 .roleProfile(CloudServiceRoleProfileArgs.builder()
 *                     .roles(CloudServiceRoleProfilePropertiesArgs.builder()
 *                         .name("ContosoFrontend")
 *                         .sku(CloudServiceRoleSkuArgs.builder()
 *                             .capacity(1)
 *                             .name("Standard_D1_v2")
 *                             .tier("Standard")
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .upgradeMode("Auto")
 *                 .build())
 *             .resourceGroupName("ConstosoRG")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create New Cloud Service with Single Role and RDP Extension * *
 * {@code
 * 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 com.pulumi.azurenative.compute.inputs.CloudServicePropertiesArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceExtensionProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceNetworkProfileArgs;
 * import com.pulumi.azurenative.compute.inputs.CloudServiceRoleProfileArgs;
 * 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(CloudServicePropertiesArgs.builder()
 *                 .configuration("{ServiceConfiguration}")
 *                 .extensionProfile(CloudServiceExtensionProfileArgs.builder()
 *                     .extensions(ExtensionArgs.builder()
 *                         .name("RDPExtension")
 *                         .properties(CloudServiceExtensionPropertiesArgs.builder()
 *                             .autoUpgradeMinorVersion(false)
 *                             .protectedSettings("{password}")
 *                             .publisher("Microsoft.Windows.Azure.Extensions")
 *                             .settings("UserAzure10/22/2021 15:05:45")
 *                             .type("RDP")
 *                             .typeHandlerVersion("1.2")
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .networkProfile(CloudServiceNetworkProfileArgs.builder()
 *                     .loadBalancerConfigurations(LoadBalancerConfigurationArgs.builder()
 *                         .name("contosolb")
 *                         .properties(LoadBalancerConfigurationPropertiesArgs.builder()
 *                             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                                 .name("contosofe")
 *                                 .properties(LoadBalancerFrontendIpConfigurationPropertiesArgs.builder()
 *                                     .publicIPAddress(SubResourceArgs.builder()
 *                                         .id("/subscriptions/{subscription-id}/resourceGroups/ConstosoRG/providers/Microsoft.Network/publicIPAddresses/contosopublicip")
 *                                         .build())
 *                                     .build())
 *                                 .build())
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .packageUrl("{PackageUrl}")
 *                 .roleProfile(CloudServiceRoleProfileArgs.builder()
 *                     .roles(CloudServiceRoleProfilePropertiesArgs.builder()
 *                         .name("ContosoFrontend")
 *                         .sku(CloudServiceRoleSkuArgs.builder()
 *                             .capacity(1)
 *                             .name("Standard_D1_v2")
 *                             .tier("Standard")
 *                             .build())
 *                         .build())
 *                     .build())
 *                 .upgradeMode("Auto")
 *                 .build())
 *             .resourceGroupName("ConstosoRG")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:compute:CloudService {cs-name} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/cloudServices/{cloudServiceName} * ``` * */ @ResourceType(type="azure-native:compute:CloudService") public class CloudService extends com.pulumi.resources.CustomResource { /** * Resource location. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location. * */ public Output location() { return this.location; } /** * Resource name. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name. * */ public Output name() { return this.name; } /** * Cloud service properties * */ @Export(name="properties", refs={CloudServicePropertiesResponse.class}, tree="[0]") private Output properties; /** * @return Cloud service properties * */ public Output properties() { return this.properties; } /** * The system meta data relating to this resource. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return The system meta data relating to this resource. * */ public Output> systemData() { return Codegen.optional(this.systemData); } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Resource type. * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type. * */ public Output type() { return this.type; } /** * List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional. * */ @Export(name="zones", refs={List.class,String.class}, tree="[0,1]") private Output> zones; /** * @return List of logical availability zone of the resource. List should contain only 1 zone where cloud service should be provisioned. This field is optional. * */ public Output>> zones() { return Codegen.optional(this.zones); } /** * * @param name The _unique_ name of the resulting resource. */ public CloudService(java.lang.String name) { this(name, CloudServiceArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public CloudService(java.lang.String name, CloudServiceArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public CloudService(java.lang.String name, CloudServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:CloudService", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private CloudService(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:CloudService", name, null, makeResourceOptions(options, id), false); } private static CloudServiceArgs makeArgs(CloudServiceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? CloudServiceArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:compute/v20201001preview:CloudService").build()), Output.of(Alias.builder().type("azure-native:compute/v20210301:CloudService").build()), Output.of(Alias.builder().type("azure-native:compute/v20220404:CloudService").build()), Output.of(Alias.builder().type("azure-native:compute/v20220904:CloudService").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param options Optional settings to control the behavior of the CustomResource. */ public static CloudService get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new CloudService(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy