com.pulumi.azure.compute.GalleryApplicationVersion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.azure.compute;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.compute.GalleryApplicationVersionArgs;
import com.pulumi.azure.compute.inputs.GalleryApplicationVersionState;
import com.pulumi.azure.compute.outputs.GalleryApplicationVersionManageAction;
import com.pulumi.azure.compute.outputs.GalleryApplicationVersionSource;
import com.pulumi.azure.compute.outputs.GalleryApplicationVersionTargetRegion;
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.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Gallery Application Version.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.compute.SharedImageGallery;
* import com.pulumi.azure.compute.SharedImageGalleryArgs;
* import com.pulumi.azure.compute.GalleryApplication;
* import com.pulumi.azure.compute.GalleryApplicationArgs;
* import com.pulumi.azure.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.storage.Container;
* import com.pulumi.azure.storage.ContainerArgs;
* import com.pulumi.azure.storage.Blob;
* import com.pulumi.azure.storage.BlobArgs;
* import com.pulumi.azure.compute.GalleryApplicationVersion;
* import com.pulumi.azure.compute.GalleryApplicationVersionArgs;
* import com.pulumi.azure.compute.inputs.GalleryApplicationVersionManageActionArgs;
* import com.pulumi.azure.compute.inputs.GalleryApplicationVersionSourceArgs;
* import com.pulumi.azure.compute.inputs.GalleryApplicationVersionTargetRegionArgs;
* 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) {
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-rg")
* .location("West Europe")
* .build());
*
* var exampleSharedImageGallery = new SharedImageGallery("exampleSharedImageGallery", SharedImageGalleryArgs.builder()
* .name("examplegallery")
* .resourceGroupName(example.name())
* .location(example.location())
* .build());
*
* var exampleGalleryApplication = new GalleryApplication("exampleGalleryApplication", GalleryApplicationArgs.builder()
* .name("example-app")
* .galleryId(exampleSharedImageGallery.id())
* .location(example.location())
* .supportedOsType("Linux")
* .build());
*
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("examplestorage")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .build());
*
* var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
* .name("example-container")
* .storageAccountName(exampleAccount.name())
* .containerAccessType("blob")
* .build());
*
* var exampleBlob = new Blob("exampleBlob", BlobArgs.builder()
* .name("scripts")
* .storageAccountName(exampleAccount.name())
* .storageContainerName(exampleContainer.name())
* .type("Block")
* .sourceContent("[scripts file content]")
* .build());
*
* var exampleGalleryApplicationVersion = new GalleryApplicationVersion("exampleGalleryApplicationVersion", GalleryApplicationVersionArgs.builder()
* .name("0.0.1")
* .galleryApplicationId(exampleGalleryApplication.id())
* .location(exampleGalleryApplication.location())
* .manageAction(GalleryApplicationVersionManageActionArgs.builder()
* .install("[install command]")
* .remove("[remove command]")
* .build())
* .source(GalleryApplicationVersionSourceArgs.builder()
* .mediaLink(exampleBlob.id())
* .build())
* .targetRegions(GalleryApplicationVersionTargetRegionArgs.builder()
* .name(exampleGalleryApplication.location())
* .regionalReplicaCount(1)
* .build())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Gallery Application Versions can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:compute/galleryApplicationVersion:GalleryApplicationVersion example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1/versions/galleryApplicationVersion1
* ```
*
*/
@ResourceType(type="azure:compute/galleryApplicationVersion:GalleryApplicationVersion")
public class GalleryApplicationVersion extends com.pulumi.resources.CustomResource {
/**
* Specifies the name of the config file on the VM. Changing this forces a new resource to be created.
*
*/
@Export(name="configFile", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> configFile;
/**
* @return Specifies the name of the config file on the VM. Changing this forces a new resource to be created.
*
*/
public Output> configFile() {
return Codegen.optional(this.configFile);
}
/**
* Should the Gallery Application reports health. Defaults to `false`.
*
*/
@Export(name="enableHealthCheck", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> enableHealthCheck;
/**
* @return Should the Gallery Application reports health. Defaults to `false`.
*
*/
public Output> enableHealthCheck() {
return Codegen.optional(this.enableHealthCheck);
}
/**
* The end of life date in RFC3339 format of the Gallery Application Version.
*
*/
@Export(name="endOfLifeDate", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> endOfLifeDate;
/**
* @return The end of life date in RFC3339 format of the Gallery Application Version.
*
*/
public Output> endOfLifeDate() {
return Codegen.optional(this.endOfLifeDate);
}
/**
* Should the Gallery Application Version be excluded from the `latest` filter? If set to `true` this Gallery Application Version won't be returned for the `latest` version. Defaults to `false`.
*
*/
@Export(name="excludeFromLatest", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> excludeFromLatest;
/**
* @return Should the Gallery Application Version be excluded from the `latest` filter? If set to `true` this Gallery Application Version won't be returned for the `latest` version. Defaults to `false`.
*
*/
public Output> excludeFromLatest() {
return Codegen.optional(this.excludeFromLatest);
}
/**
* The ID of the Gallery Application. Changing this forces a new resource to be created.
*
*/
@Export(name="galleryApplicationId", refs={String.class}, tree="[0]")
private Output galleryApplicationId;
/**
* @return The ID of the Gallery Application. Changing this forces a new resource to be created.
*
*/
public Output galleryApplicationId() {
return this.galleryApplicationId;
}
/**
* The Azure Region where the Gallery Application Version exists. Changing this forces a new resource to be created.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The Azure Region where the Gallery Application Version exists. Changing this forces a new resource to be created.
*
*/
public Output location() {
return this.location;
}
/**
* A `manage_action` block as defined below.
*
*/
@Export(name="manageAction", refs={GalleryApplicationVersionManageAction.class}, tree="[0]")
private Output manageAction;
/**
* @return A `manage_action` block as defined below.
*
*/
public Output manageAction() {
return this.manageAction;
}
/**
* The version name of the Gallery Application Version, such as `1.0.0`. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The version name of the Gallery Application Version, such as `1.0.0`. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* Specifies the name of the package file on the VM. Changing this forces a new resource to be created.
*
*/
@Export(name="packageFile", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> packageFile;
/**
* @return Specifies the name of the package file on the VM. Changing this forces a new resource to be created.
*
*/
public Output> packageFile() {
return Codegen.optional(this.packageFile);
}
/**
* A `source` block as defined below.
*
*/
@Export(name="source", refs={GalleryApplicationVersionSource.class}, tree="[0]")
private Output source;
/**
* @return A `source` block as defined below.
*
*/
public Output source() {
return this.source;
}
/**
* A mapping of tags to assign to the Gallery Application Version.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A mapping of tags to assign to the Gallery Application Version.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* One or more `target_region` blocks as defined below.
*
*/
@Export(name="targetRegions", refs={List.class,GalleryApplicationVersionTargetRegion.class}, tree="[0,1]")
private Output> targetRegions;
/**
* @return One or more `target_region` blocks as defined below.
*
*/
public Output> targetRegions() {
return this.targetRegions;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public GalleryApplicationVersion(java.lang.String name) {
this(name, GalleryApplicationVersionArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public GalleryApplicationVersion(java.lang.String name, GalleryApplicationVersionArgs 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 GalleryApplicationVersion(java.lang.String name, GalleryApplicationVersionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:compute/galleryApplicationVersion:GalleryApplicationVersion", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private GalleryApplicationVersion(java.lang.String name, Output id, @Nullable GalleryApplicationVersionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:compute/galleryApplicationVersion:GalleryApplicationVersion", name, state, makeResourceOptions(options, id), false);
}
private static GalleryApplicationVersionArgs makeArgs(GalleryApplicationVersionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? GalleryApplicationVersionArgs.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 GalleryApplicationVersion get(java.lang.String name, Output id, @Nullable GalleryApplicationVersionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new GalleryApplicationVersion(name, id, state, options);
}
}