Package com.pulumi.alicloud.edas
Class ApplicationScale
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.alicloud.edas.ApplicationScale
-
public class ApplicationScale extends com.pulumi.resources.CustomResource
This operation is provided to scale out an EDAS application, see [What is EDAS Application Scale](https://www.alibabacloud.com/help/en/edas/developer-reference/api-edas-2017-08-01-scaleoutapplication). > **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.edas.DeployGroup; import com.pulumi.alicloud.edas.DeployGroupArgs; import com.pulumi.alicloud.edas.EdasFunctions; import com.pulumi.alicloud.edas.inputs.GetDeployGroupsArgs; import com.pulumi.alicloud.edas.ApplicationScale; import com.pulumi.alicloud.edas.ApplicationScaleArgs; 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("WAR") .build()); var defaultDeployGroup = new DeployGroup("defaultDeployGroup", DeployGroupArgs.builder() .appId(defaultApplication.id()) .groupName(name) .build()); final var defaultDeployGroups = EdasFunctions.getDeployGroups(GetDeployGroupsArgs.builder() .appId(defaultDeployGroup.appId()) .build()); var defaultApplicationScale = new ApplicationScale("defaultApplicationScale", ApplicationScaleArgs.builder() .appId(defaultApplication.id()) .deployGroup(defaultDeployGroups.applyValue(getDeployGroupsResult -> getDeployGroupsResult).applyValue(defaultDeployGroups -> defaultDeployGroups.applyValue(getDeployGroupsResult -> getDeployGroupsResult.groups()[0].groupId()))) .ecuInfos(Output.tuple(defaultInstanceClusterAttachment.ecuMap(), defaultInstance.id()).applyValue(values -> { var ecuMap = values.t1; var id = values.t2; return ecuMap[id]; })) .build()); } } ```
-
-
Constructor Summary
Constructors Constructor Description ApplicationScale(java.lang.String name)
ApplicationScale(java.lang.String name, ApplicationScaleArgs args)
ApplicationScale(java.lang.String name, ApplicationScaleArgs 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()
com.pulumi.core.Output<java.lang.String>
deployGroup()
com.pulumi.core.Output<java.lang.String>
eccInfo()
com.pulumi.core.Output<java.util.List<java.lang.String>>
ecuInfos()
com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>>
forceStatus()
static ApplicationScale
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ApplicationScaleState 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.
-
-
-
Constructor Detail
-
ApplicationScale
public ApplicationScale(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
ApplicationScale
public ApplicationScale(java.lang.String name, ApplicationScaleArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
ApplicationScale
public ApplicationScale(java.lang.String name, ApplicationScaleArgs 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 that you want to deploy.
-
deployGroup
public com.pulumi.core.Output<java.lang.String> deployGroup()
- Returns:
- The ID of the instance group to which you want to add ECS instances to scale out the application.
-
eccInfo
public com.pulumi.core.Output<java.lang.String> eccInfo()
- Returns:
- The ecc information of the resource supplied above. The value is formulated as `<ecc1,ecc2>`.
-
ecuInfos
public com.pulumi.core.Output<java.util.List<java.lang.String>> ecuInfos()
- Returns:
- The IDs of the Elastic Compute Unit (ECU) where you want to deploy the application. Type: List.
-
forceStatus
public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> forceStatus()
- Returns:
- This parameter specifies whether to forcibly remove an ECS instance where the application is deployed. It is set as true only after the ECS instance expires. In normal cases, this parameter do not need to be specified.
-
get
public static ApplicationScale get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ApplicationScaleState 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.
-
-