com.pulumi.alicloud.ens.Image 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.ens;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.ens.ImageArgs;
import com.pulumi.alicloud.ens.inputs.ImageState;
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;
/**
* Provides a ENS Image resource.
*
* For information about ENS Image and how to use it, see [What is Image](https://www.alibabacloud.com/help/en/).
*
* > **NOTE:** Available since v1.216.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.ens.Instance;
* import com.pulumi.alicloud.ens.InstanceArgs;
* import com.pulumi.alicloud.ens.inputs.InstanceSystemDiskArgs;
* import com.pulumi.alicloud.ens.Image;
* import com.pulumi.alicloud.ens.ImageArgs;
* 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("terraform-example");
* var default_ = new Instance("default", InstanceArgs.builder()
* .systemDisk(InstanceSystemDiskArgs.builder()
* .size("20")
* .build())
* .scheduleAreaLevel("Region")
* .imageId("centos_6_08_64_20G_alibase_20171208")
* .paymentType("PayAsYouGo")
* .password("12345678ABCabc")
* .amount("1")
* .internetMaxBandwidthOut("10")
* .publicIpIdentification(true)
* .ensRegionId("cn-chenzhou-telecom_unicom_cmcc")
* .periodUnit("Month")
* .instanceType("ens.sn1.stiny")
* .status("Stopped")
* .build());
*
* var defaultImage = new Image("defaultImage", ImageArgs.builder()
* .imageName(name)
* .instanceId(default_.id())
* .deleteAfterImageUpload("false")
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* ENS Image can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:ens/image:Image example <id>
* ```
*
*/
@ResourceType(type="alicloud:ens/image:Image")
public class Image extends com.pulumi.resources.CustomResource {
/**
* Image creation time.
*
*/
@Export(name="createTime", refs={String.class}, tree="[0]")
private Output createTime;
/**
* @return Image creation time.
*
*/
public Output createTime() {
return this.createTime;
}
/**
* Whether the instance is automatically released after the image is packaged and uploaded successfully, only the build machine is supported. Optional values: true: When the instance is released, the image is released together with the instance. false: When the instance is released, the image is retained and is not released together with the instance. Empty means false by default.
*
*/
@Export(name="deleteAfterImageUpload", refs={String.class}, tree="[0]")
private Output deleteAfterImageUpload;
/**
* @return Whether the instance is automatically released after the image is packaged and uploaded successfully, only the build machine is supported. Optional values: true: When the instance is released, the image is released together with the instance. false: When the instance is released, the image is retained and is not released together with the instance. Empty means false by default.
*
*/
public Output> deleteAfterImageUpload() {
return Codegen.optional(this.deleteAfterImageUpload);
}
/**
* Image Name.
*
*/
@Export(name="imageName", refs={String.class}, tree="[0]")
private Output imageName;
/**
* @return Image Name.
*
*/
public Output imageName() {
return this.imageName;
}
/**
* The ID of the instance corresponding to the image.
*
*/
@Export(name="instanceId", refs={String.class}, tree="[0]")
private Output instanceId;
/**
* @return The ID of the instance corresponding to the image.
*
*/
public Output> instanceId() {
return Codegen.optional(this.instanceId);
}
/**
* Mirror Status Optional values: Creating: Creating Packing: Packing Uploading: Uploading Pack_failed: Packing failed Upload_failed: Upload failed Available: Only images in the Available state can be used and operated. Unavailable: Not available Copying: Copying.
*
*/
@Export(name="status", refs={String.class}, tree="[0]")
private Output status;
/**
* @return Mirror Status Optional values: Creating: Creating Packing: Packing Uploading: Uploading Pack_failed: Packing failed Upload_failed: Upload failed Available: Only images in the Available state can be used and operated. Unavailable: Not available Copying: Copying.
*
*/
public Output status() {
return this.status;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Image(java.lang.String name) {
this(name, ImageArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Image(java.lang.String name, ImageArgs 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 Image(java.lang.String name, ImageArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:ens/image:Image", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Image(java.lang.String name, Output id, @Nullable ImageState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:ens/image:Image", name, state, makeResourceOptions(options, id), false);
}
private static ImageArgs makeArgs(ImageArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ImageArgs.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 Image get(java.lang.String name, Output id, @Nullable ImageState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Image(name, id, state, options);
}
}