com.pulumi.alicloud.edas.ApplicationDeployment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** 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.edas;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.edas.ApplicationDeploymentArgs;
import com.pulumi.alicloud.edas.inputs.ApplicationDeploymentState;
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.Optional;
import javax.annotation.Nullable;
/**
* Deploys applications on EDAS, see [What is EDAS Application Deployment](https://www.alibabacloud.com/help/en/edas/developer-reference/api-edas-2017-08-01-deployapplication).
*
* > **NOTE:** Available since v1.82.0.
*
* ## Example Usage
*
* Basic 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.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.ApplicationDeployment;
* import com.pulumi.alicloud.edas.ApplicationDeploymentArgs;
* 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 default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
* .current(true)
* .build());
*
* final var defaultGetZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
* .availableResourceCreation("VSwitch")
* .build());
*
* final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
* .nameRegex("^ubuntu_[0-9]+_[0-9]+_x64*")
* .owners("system")
* .build());
*
* final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
* .availabilityZone(defaultGetZones.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(defaultGetZones.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(defaultGetZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
* .instanceName(name)
* .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
* .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
* .securityGroups(defaultSecurityGroup.id())
* .vswitchId(defaultSwitch.id())
* .build());
*
* var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
* .clusterName(name)
* .clusterType("2")
* .networkMode("2")
* .logicalRegionId(default_.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 defaultDeployGroup = new DeployGroup("defaultDeployGroup", DeployGroupArgs.builder()
* .appId(defaultApplication.id())
* .groupName(name)
* .build());
*
* var defaultApplicationDeployment = new ApplicationDeployment("defaultApplicationDeployment", ApplicationDeploymentArgs.builder()
* .appId(defaultApplication.id())
* .groupId("all")
* .warUrl("http://edas-sz.oss-cn-shenzhen.aliyuncs.com/prod/demo/SPRING_CLOUD_CONSUMER.jar")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
*/
@ResourceType(type="alicloud:edas/applicationDeployment:ApplicationDeployment")
public class ApplicationDeployment extends com.pulumi.resources.CustomResource {
/**
* The ID of the application that you want to deploy.
*
*/
@Export(name="appId", refs={String.class}, tree="[0]")
private Output appId;
/**
* @return The ID of the application that you want to deploy.
*
*/
public Output appId() {
return this.appId;
}
/**
* The ID of the instance group where the application is going to be deployed. Set this parameter to all if you want to deploy the application to all groups.
*
*/
@Export(name="groupId", refs={String.class}, tree="[0]")
private Output groupId;
/**
* @return The ID of the instance group where the application is going to be deployed. Set this parameter to all if you want to deploy the application to all groups.
*
*/
public Output groupId() {
return this.groupId;
}
/**
* Last package version deployed.
*
*/
@Export(name="lastPackageVersion", refs={String.class}, tree="[0]")
private Output lastPackageVersion;
/**
* @return Last package version deployed.
*
*/
public Output lastPackageVersion() {
return this.lastPackageVersion;
}
/**
* The version of the application that you want to deploy. It must be unique for every application. The length cannot exceed 64 characters. We recommended you to use a timestamp.
*
*/
@Export(name="packageVersion", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> packageVersion;
/**
* @return The version of the application that you want to deploy. It must be unique for every application. The length cannot exceed 64 characters. We recommended you to use a timestamp.
*
*/
public Output> packageVersion() {
return Codegen.optional(this.packageVersion);
}
/**
* The address to store the uploaded web application (WAR) package for application deployment. This parameter is required when the deployType parameter is set as url.
*
*/
@Export(name="warUrl", refs={String.class}, tree="[0]")
private Output warUrl;
/**
* @return The address to store the uploaded web application (WAR) package for application deployment. This parameter is required when the deployType parameter is set as url.
*
*/
public Output warUrl() {
return this.warUrl;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ApplicationDeployment(java.lang.String name) {
this(name, ApplicationDeploymentArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ApplicationDeployment(java.lang.String name, ApplicationDeploymentArgs 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 ApplicationDeployment(java.lang.String name, ApplicationDeploymentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:edas/applicationDeployment:ApplicationDeployment", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ApplicationDeployment(java.lang.String name, Output id, @Nullable ApplicationDeploymentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:edas/applicationDeployment:ApplicationDeployment", name, state, makeResourceOptions(options, id), false);
}
private static ApplicationDeploymentArgs makeArgs(ApplicationDeploymentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ApplicationDeploymentArgs.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 ApplicationDeployment get(java.lang.String name, Output id, @Nullable ApplicationDeploymentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ApplicationDeployment(name, id, state, options);
}
}