Package com.pulumi.alicloud.edas
Class SlbAttachment
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.alicloud.edas.SlbAttachment
-
public class SlbAttachment extends com.pulumi.resources.CustomResource
Binds SLB to an EDAS application. > **NOTE:** Available since v1.82.0. ## Example Usage Basic Usage ```java 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.GetRegionsArgs; import com.pulumi.alicloud.inputs.GetZonesArgs; import com.pulumi.alicloud.ecs.EcsFunctions; import com.pulumi.alicloud.ecs.inputs.GetImagesArgs; import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs; 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.ecs.SecurityGroup; import com.pulumi.alicloud.ecs.SecurityGroupArgs; import com.pulumi.alicloud.ecs.Instance; import com.pulumi.alicloud.ecs.InstanceArgs; import com.pulumi.alicloud.edas.Cluster; import com.pulumi.alicloud.edas.ClusterArgs; import com.pulumi.alicloud.edas.InstanceClusterAttachment; import com.pulumi.alicloud.edas.InstanceClusterAttachmentArgs; import com.pulumi.alicloud.edas.Application; import com.pulumi.alicloud.edas.ApplicationArgs; import com.pulumi.alicloud.slb.ApplicationLoadBalancer; import com.pulumi.alicloud.slb.ApplicationLoadBalancerArgs; import com.pulumi.alicloud.edas.SlbAttachment; import com.pulumi.alicloud.edas.SlbAttachmentArgs; 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("tf-example"); final var defaultRegions = AlicloudFunctions.getRegions(GetRegionsArgs.builder() .current(true) .build()); final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder() .availableResourceCreation("VSwitch") .build()); final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder() .nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*") .owners("system") .build()); final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder() .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id())) .cpuCoreCount(1) .memorySize(2) .build()); var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder() .vpcName(name) .cidrBlock("10.4.0.0/16") .build()); var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder() .vswitchName(name) .cidrBlock("10.4.0.0/24") .vpcId(defaultNetwork.id()) .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id())) .build()); var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder() .vpcId(defaultNetwork.id()) .build()); var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder() .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id())) .instanceName(name) .imageId(defaultImages.applyValue(getImagesResult -> getImagesResult.images()[0].id())) .instanceType(defaultInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id())) .securityGroups(defaultSecurityGroup.id()) .vswitchId(defaultSwitch.id()) .internetMaxBandwidthOut("10") .internetChargeType("PayByTraffic") .instanceChargeType("PostPaid") .systemDiskCategory("cloud_efficiency") .build()); var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder() .clusterName(name) .clusterType("2") .networkMode("2") .logicalRegionId(defaultRegions.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id())) .vpcId(defaultNetwork.id()) .build()); var defaultInstanceClusterAttachment = new InstanceClusterAttachment("defaultInstanceClusterAttachment", InstanceClusterAttachmentArgs.builder() .clusterId(defaultCluster.id()) .instanceIds(defaultInstance.id()) .build()); var defaultApplication = new Application("defaultApplication", ApplicationArgs.builder() .applicationName(name) .clusterId(defaultCluster.id()) .packageType("JAR") .build()); var defaultApplicationLoadBalancer = new ApplicationLoadBalancer("defaultApplicationLoadBalancer", ApplicationLoadBalancerArgs.builder() .loadBalancerName(name) .vswitchId(defaultSwitch.id()) .loadBalancerSpec("slb.s2.small") .addressType("intranet") .build()); var defaultSlbAttachment = new SlbAttachment("defaultSlbAttachment", SlbAttachmentArgs.builder() .appId(defaultApplication.id()) .slbId(defaultApplicationLoadBalancer.id()) .slbIp(defaultApplicationLoadBalancer.address()) .type(defaultApplicationLoadBalancer.addressType()) .build()); } } ```
-
-
Constructor Summary
Constructors Constructor Description SlbAttachment(java.lang.String name)
SlbAttachment(java.lang.String name, SlbAttachmentArgs args)
SlbAttachment(java.lang.String name, SlbAttachmentArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
appId()
static SlbAttachment
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, SlbAttachmentState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<java.lang.Integer>>
listenerPort()
com.pulumi.core.Output<java.lang.String>
slbId()
com.pulumi.core.Output<java.lang.String>
slbIp()
com.pulumi.core.Output<java.lang.String>
slbStatus()
com.pulumi.core.Output<java.lang.String>
type()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
vserverGroupId()
com.pulumi.core.Output<java.lang.String>
vswitchId()
-
-
-
Constructor Detail
-
SlbAttachment
public SlbAttachment(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
SlbAttachment
public SlbAttachment(java.lang.String name, SlbAttachmentArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
SlbAttachment
public SlbAttachment(java.lang.String name, SlbAttachmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
appId
public com.pulumi.core.Output<java.lang.String> appId()
- Returns:
- The ID of the application to which you want to bind an SLB instance.
-
listenerPort
public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> listenerPort()
- Returns:
- The listening port for the bound SLB instance.
-
slbId
public com.pulumi.core.Output<java.lang.String> slbId()
- Returns:
- The ID of the SLB instance that is going to be bound.
-
slbIp
public com.pulumi.core.Output<java.lang.String> slbIp()
- Returns:
- The IP address that is allocated to the bound SLB instance.
-
slbStatus
public com.pulumi.core.Output<java.lang.String> slbStatus()
- Returns:
- Running Status of SLB instance. Inactive:The instance is stopped, and listener will not monitor and forward traffic. Active:The instance is running. After the instance is created, the default state is active. Locked:The instance is locked, the instance has been owed or locked by Alibaba Cloud. Expired: The instance has expired.
-
type
public com.pulumi.core.Output<java.lang.String> type()
- Returns:
- The type of the bound SLB instance.
-
vserverGroupId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> vserverGroupId()
- Returns:
- The ID of the virtual server (VServer) group associated with the intranet SLB instance.
-
vswitchId
public com.pulumi.core.Output<java.lang.String> vswitchId()
- Returns:
- VPC related vswitch ID.
-
get
public static SlbAttachment get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable SlbAttachmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-