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

com.pulumi.alicloud.slb.LoadBalancer Maven / Gradle / Ivy

There is a newer version: 3.63.0-alpha.1727424957
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.alicloud.slb;

import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.slb.LoadBalancerArgs;
import com.pulumi.alicloud.slb.inputs.LoadBalancerState;
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.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * > **NOTE:** Deprecated since v1.123.1.
 * 
 * > **DEPRECATED:** This resource has been renamed to alicloud.slb.ApplicationLoadBalancer from version 1.123.1.
 * 
 * Provides an Application Load Balancer resource.
 * 
 * > **NOTE:** At present, to avoid some unnecessary regulation confusion, SLB can not support alicloud international account to create "paybybandwidth" instance.
 * 
 * > **NOTE:** The supported specifications vary by region. Currently not all regions support guaranteed-performance instances.
 * For more details about guaranteed-performance instance, see [Guaranteed-performance instances](https://www.alibabacloud.com/help/en/slb/classic-load-balancer/developer-reference/api-createloadbalancer-2#t4182.html).
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.alicloud.AlicloudFunctions;
 * import com.pulumi.alicloud.inputs.GetZonesArgs;
 * import com.pulumi.alicloud.vpc.Network;
 * import com.pulumi.alicloud.vpc.NetworkArgs;
 * import com.pulumi.alicloud.vpc.Switch;
 * import com.pulumi.alicloud.vpc.SwitchArgs;
 * import com.pulumi.alicloud.slb.LoadBalancer;
 * import com.pulumi.alicloud.slb.LoadBalancerArgs;
 * 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) {
 *         final var config = ctx.config();
 *         final var name = config.get("name").orElse("terraformslbconfig");
 *         final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
 *             .availableResourceCreation("VSwitch")
 *             .build());
 * 
 *         var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
 *             .vpcName(name)
 *             .cidrBlock("172.16.0.0/12")
 *             .build());
 * 
 *         var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
 *             .vpcId(defaultNetwork.id())
 *             .cidrBlock("172.16.0.0/21")
 *             .zoneId(default_.zones()[0].id())
 *             .vswitchName(name)
 *             .build());
 * 
 *         var defaultLoadBalancer = new LoadBalancer("defaultLoadBalancer", LoadBalancerArgs.builder()
 *             .loadBalancerName(name)
 *             .loadBalancerSpec("slb.s2.small")
 *             .vswitchId(defaultSwitch.id())
 *             .tags(Map.ofEntries(
 *                 Map.entry("tag_a", 1),
 *                 Map.entry("tag_b", 2),
 *                 Map.entry("tag_c", 3),
 *                 Map.entry("tag_d", 4),
 *                 Map.entry("tag_e", 5),
 *                 Map.entry("tag_f", 6),
 *                 Map.entry("tag_g", 7),
 *                 Map.entry("tag_h", 8),
 *                 Map.entry("tag_i", 9),
 *                 Map.entry("tag_j", 10)
 *             ))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Load balancer can be imported using the id, e.g. * * ```sh * $ pulumi import alicloud:slb/loadBalancer:LoadBalancer example lb-abc123456 * ``` * * @deprecated * This resource has been deprecated in favour of the ApplicationLoadBalancer resource * */ @Deprecated /* This resource has been deprecated in favour of the ApplicationLoadBalancer resource */ @ResourceType(type="alicloud:slb/loadBalancer:LoadBalancer") public class LoadBalancer extends com.pulumi.resources.CustomResource { /** * Specify the IP address of the private network for the SLB instance, which must be in the destination CIDR block of the correspond ing switch. * */ @Export(name="address", refs={String.class}, tree="[0]") private Output address; /** * @return Specify the IP address of the private network for the SLB instance, which must be in the destination CIDR block of the correspond ing switch. * */ public Output address() { return this.address; } /** * The IP version of the SLB instance to be created, which can be set to ipv4 or ipv6 . Default to "ipv4". Now, only internet instance support ipv6 address. * */ @Export(name="addressIpVersion", refs={String.class}, tree="[0]") private Output addressIpVersion; /** * @return The IP version of the SLB instance to be created, which can be set to ipv4 or ipv6 . Default to "ipv4". Now, only internet instance support ipv6 address. * */ public Output> addressIpVersion() { return Codegen.optional(this.addressIpVersion); } /** * The network type of the SLB instance. Valid values: ["internet", "intranet"]. If load balancer launched in VPC, this value must be "intranet". * - internet: After an Internet SLB instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet. * - intranet: After an intranet SLB instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests. * */ @Export(name="addressType", refs={String.class}, tree="[0]") private Output addressType; /** * @return The network type of the SLB instance. Valid values: ["internet", "intranet"]. If load balancer launched in VPC, this value must be "intranet". * - internet: After an Internet SLB instance is created, the system allocates a public IP address so that the instance can forward requests from the Internet. * - intranet: After an intranet SLB instance is created, the system allocates an intranet IP address so that the instance can only forward intranet requests. * */ public Output addressType() { return this.addressType; } /** * Valid * value is between 1 and 1000, If argument "internet_charge_type" is "paybytraffic", then this value will be ignore. * */ @Export(name="bandwidth", refs={Integer.class}, tree="[0]") private Output bandwidth; /** * @return Valid * value is between 1 and 1000, If argument "internet_charge_type" is "paybytraffic", then this value will be ignore. * */ public Output> bandwidth() { return Codegen.optional(this.bandwidth); } /** * Whether enable the deletion protection or not. on: Enable deletion protection. off: Disable deletion protection. Default to off. Only postpaid instance support this function. * */ @Export(name="deleteProtection", refs={String.class}, tree="[0]") private Output deleteProtection; /** * @return Whether enable the deletion protection or not. on: Enable deletion protection. off: Disable deletion protection. Default to off. Only postpaid instance support this function. * */ public Output> deleteProtection() { return Codegen.optional(this.deleteProtection); } /** * The billing method of the load balancer. Valid values are "PrePaid" and "PostPaid". Default to "PostPaid". * */ @Export(name="instanceChargeType", refs={String.class}, tree="[0]") private Output instanceChargeType; /** * @return The billing method of the load balancer. Valid values are "PrePaid" and "PostPaid". Default to "PostPaid". * */ public Output instanceChargeType() { return this.instanceChargeType; } /** * Valid * values are `PayByBandwidth`, `PayByTraffic`. If this value is "PayByBandwidth", then argument "internet" must be "true". Default is "PayByTraffic". If load balancer launched in VPC, this value must be "PayByTraffic". * Before version 1.10.1, the valid values are "paybybandwidth" and "paybytraffic". * */ @Export(name="internetChargeType", refs={String.class}, tree="[0]") private Output internetChargeType; /** * @return Valid * values are `PayByBandwidth`, `PayByTraffic`. If this value is "PayByBandwidth", then argument "internet" must be "true". Default is "PayByTraffic". If load balancer launched in VPC, this value must be "PayByTraffic". * Before version 1.10.1, the valid values are "paybybandwidth" and "paybytraffic". * */ public Output> internetChargeType() { return Codegen.optional(this.internetChargeType); } @Export(name="loadBalancerName", refs={String.class}, tree="[0]") private Output loadBalancerName; public Output loadBalancerName() { return this.loadBalancerName; } /** * The specification of the Server Load Balancer instance. Default to empty string indicating it is "Shared-Performance" instance. Launching "Performance-guaranteed" instance, it must be specified. Valid values: `slb.s1.small`, `slb.s2.small`, `slb.s2.medium`. * */ @Export(name="loadBalancerSpec", refs={String.class}, tree="[0]") private Output loadBalancerSpec; /** * @return The specification of the Server Load Balancer instance. Default to empty string indicating it is "Shared-Performance" instance. Launching "Performance-guaranteed" instance, it must be specified. Valid values: `slb.s1.small`, `slb.s2.small`, `slb.s2.medium`. * */ public Output loadBalancerSpec() { return this.loadBalancerSpec; } /** * The primary zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API. * */ @Export(name="masterZoneId", refs={String.class}, tree="[0]") private Output masterZoneId; /** * @return The primary zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API. * */ public Output masterZoneId() { return this.masterZoneId; } /** * The reason of modification protection. It's effective when `modification_protection_status` is `ConsoleProtection`. * */ @Export(name="modificationProtectionReason", refs={String.class}, tree="[0]") private Output modificationProtectionReason; /** * @return The reason of modification protection. It's effective when `modification_protection_status` is `ConsoleProtection`. * */ public Output> modificationProtectionReason() { return Codegen.optional(this.modificationProtectionReason); } /** * The status of modification protection. Valid values: `ConsoleProtection` and `NonProtection`. Default value: `NonProtection`. * */ @Export(name="modificationProtectionStatus", refs={String.class}, tree="[0]") private Output modificationProtectionStatus; /** * @return The status of modification protection. Valid values: `ConsoleProtection` and `NonProtection`. Default value: `NonProtection`. * */ public Output modificationProtectionStatus() { return this.modificationProtectionStatus; } /** * Field `name` has been deprecated from provider version 1.123.1 New field `load_balancer_name` instead. * * @deprecated * Field 'name' has been deprecated from provider version 1.123.1. New field 'load_balancer_name' instead * */ @Deprecated /* Field 'name' has been deprecated from provider version 1.123.1. New field 'load_balancer_name' instead */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Field `name` has been deprecated from provider version 1.123.1 New field `load_balancer_name` instead. * */ public Output name() { return this.name; } /** * The billing method of the load balancer. Valid values are `PayAsYouGo` and `Subscription`. Default to `PayAsYouGo`. * */ @Export(name="paymentType", refs={String.class}, tree="[0]") private Output paymentType; /** * @return The billing method of the load balancer. Valid values are `PayAsYouGo` and `Subscription`. Default to `PayAsYouGo`. * */ public Output paymentType() { return this.paymentType; } /** * The duration that you will buy the resource, in month. It is valid when `instance_charge_type` is `PrePaid`. Valid values: [1-9, 12, 24, 36]. * > **NOTE:** The attribute `period` is only used to create Subscription instance or modify the PayAsYouGo instance to Subscription. Once effect, it will not be modified that means running `pulumi up` will not effect the resource. * */ @Export(name="period", refs={Integer.class}, tree="[0]") private Output period; /** * @return The duration that you will buy the resource, in month. It is valid when `instance_charge_type` is `PrePaid`. Valid values: [1-9, 12, 24, 36]. * > **NOTE:** The attribute `period` is only used to create Subscription instance or modify the PayAsYouGo instance to Subscription. Once effect, it will not be modified that means running `pulumi up` will not effect the resource. * */ public Output> period() { return Codegen.optional(this.period); } /** * The Id of resource group which the SLB belongs. * */ @Export(name="resourceGroupId", refs={String.class}, tree="[0]") private Output resourceGroupId; /** * @return The Id of resource group which the SLB belongs. * */ public Output resourceGroupId() { return this.resourceGroupId; } /** * The standby zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API. * */ @Export(name="slaveZoneId", refs={String.class}, tree="[0]") private Output slaveZoneId; /** * @return The standby zone ID of the SLB instance. If not specified, the system will be randomly assigned. You can query the primary and standby zones in a region by calling the DescribeZone API. * */ public Output slaveZoneId() { return this.slaveZoneId; } /** * The specification of the Server Load Balancer instance. Default to empty string indicating it is "Shared-Performance" instance. * Launching "[Performance-guaranteed](https://www.alibabacloud.com/help/en/slb/product-overview/announcements-and-updates)" instance, it is must be specified and it valid values are: "slb.s1.small", "slb.s2.small", "slb.s2.medium", * "slb.s3.small", "slb.s3.medium", "slb.s3.large" and "slb.s4.large". * * @deprecated * Field 'specification' has been deprecated from provider version 1.123.1. New field 'load_balancer_spec' instead * */ @Deprecated /* Field 'specification' has been deprecated from provider version 1.123.1. New field 'load_balancer_spec' instead */ @Export(name="specification", refs={String.class}, tree="[0]") private Output specification; /** * @return The specification of the Server Load Balancer instance. Default to empty string indicating it is "Shared-Performance" instance. * Launching "[Performance-guaranteed](https://www.alibabacloud.com/help/en/slb/product-overview/announcements-and-updates)" instance, it is must be specified and it valid values are: "slb.s1.small", "slb.s2.small", "slb.s2.medium", * "slb.s3.small", "slb.s3.medium", "slb.s3.large" and "slb.s4.large". * */ public Output specification() { return this.specification; } /** * The status of slb load balancer. Valid values: `active` and `inactice`. The system default value is `active`. * * > **NOTE:** A "Shared-Performance" instance can be changed to "Performance-guaranteed", but the change is irreversible. * * > **NOTE:** To change a "Shared-Performance" instance to a "Performance-guaranteed" instance, the SLB will have a short probability of business interruption (10 seconds-30 seconds). Advise to change it during the business downturn, or migrate business to other SLB Instances by using GSLB before changing. * * > **NOTE:** Currently, the alibaba cloud international account does not support creating a PrePaid SLB instance. * */ @Export(name="status", refs={String.class}, tree="[0]") private Output status; /** * @return The status of slb load balancer. Valid values: `active` and `inactice`. The system default value is `active`. * * > **NOTE:** A "Shared-Performance" instance can be changed to "Performance-guaranteed", but the change is irreversible. * * > **NOTE:** To change a "Shared-Performance" instance to a "Performance-guaranteed" instance, the SLB will have a short probability of business interruption (10 seconds-30 seconds). Advise to change it during the business downturn, or migrate business to other SLB Instances by using GSLB before changing. * * > **NOTE:** Currently, the alibaba cloud international account does not support creating a PrePaid SLB instance. * */ public Output status() { return this.status; } /** * A mapping of tags to assign to the resource. The `tags` can have a maximum of 10 tag for every load balancer instance. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags to assign to the resource. The `tags` can have a maximum of 10 tag for every load balancer instance. * */ public Output> tags() { return this.tags; } /** * The vSwitch ID to launch in. If `address_type` is internet, it will be ignore. * */ @Export(name="vswitchId", refs={String.class}, tree="[0]") private Output vswitchId; /** * @return The vSwitch ID to launch in. If `address_type` is internet, it will be ignore. * */ public Output> vswitchId() { return Codegen.optional(this.vswitchId); } /** * * @param name The _unique_ name of the resulting resource. */ public LoadBalancer(java.lang.String name) { this(name, LoadBalancerArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public LoadBalancer(java.lang.String name, @Nullable LoadBalancerArgs 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 LoadBalancer(java.lang.String name, @Nullable LoadBalancerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:slb/loadBalancer:LoadBalancer", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private LoadBalancer(java.lang.String name, Output id, @Nullable LoadBalancerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("alicloud:slb/loadBalancer:LoadBalancer", name, state, makeResourceOptions(options, id), false); } private static LoadBalancerArgs makeArgs(@Nullable LoadBalancerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? LoadBalancerArgs.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()) .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 state * @param options Optional settings to control the behavior of the CustomResource. */ public static LoadBalancer get(java.lang.String name, Output id, @Nullable LoadBalancerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new LoadBalancer(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy