![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.compute.kotlin.SharedImage.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.compute.kotlin
import com.pulumi.azure.compute.kotlin.outputs.SharedImageIdentifier
import com.pulumi.azure.compute.kotlin.outputs.SharedImagePurchasePlan
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.compute.kotlin.outputs.SharedImageIdentifier.Companion.toKotlin as sharedImageIdentifierToKotlin
import com.pulumi.azure.compute.kotlin.outputs.SharedImagePurchasePlan.Companion.toKotlin as sharedImagePurchasePlanToKotlin
/**
* Builder for [SharedImage].
*/
@PulumiTagMarker
public class SharedImageResourceBuilder internal constructor() {
public var name: String? = null
public var args: SharedImageArgs = SharedImageArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend SharedImageArgsBuilder.() -> Unit) {
val builder = SharedImageArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): SharedImage {
val builtJavaResource = com.pulumi.azure.compute.SharedImage(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return SharedImage(builtJavaResource)
}
}
/**
* Manages a Shared Image within a Shared Image Gallery.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleSharedImageGallery = new azure.compute.SharedImageGallery("example", {
* name: "example_image_gallery",
* resourceGroupName: example.name,
* location: example.location,
* description: "Shared images and things.",
* tags: {
* Hello: "There",
* World: "Example",
* },
* });
* const exampleSharedImage = new azure.compute.SharedImage("example", {
* name: "my-image",
* galleryName: exampleSharedImageGallery.name,
* resourceGroupName: example.name,
* location: example.location,
* osType: "Linux",
* identifier: {
* publisher: "PublisherName",
* offer: "OfferName",
* sku: "ExampleSku",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_shared_image_gallery = azure.compute.SharedImageGallery("example",
* name="example_image_gallery",
* resource_group_name=example.name,
* location=example.location,
* description="Shared images and things.",
* tags={
* "Hello": "There",
* "World": "Example",
* })
* example_shared_image = azure.compute.SharedImage("example",
* name="my-image",
* gallery_name=example_shared_image_gallery.name,
* resource_group_name=example.name,
* location=example.location,
* os_type="Linux",
* identifier={
* "publisher": "PublisherName",
* "offer": "OfferName",
* "sku": "ExampleSku",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var exampleSharedImageGallery = new Azure.Compute.SharedImageGallery("example", new()
* {
* Name = "example_image_gallery",
* ResourceGroupName = example.Name,
* Location = example.Location,
* Description = "Shared images and things.",
* Tags =
* {
* { "Hello", "There" },
* { "World", "Example" },
* },
* });
* var exampleSharedImage = new Azure.Compute.SharedImage("example", new()
* {
* Name = "my-image",
* GalleryName = exampleSharedImageGallery.Name,
* ResourceGroupName = example.Name,
* Location = example.Location,
* OsType = "Linux",
* Identifier = new Azure.Compute.Inputs.SharedImageIdentifierArgs
* {
* Publisher = "PublisherName",
* Offer = "OfferName",
* Sku = "ExampleSku",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleSharedImageGallery, err := compute.NewSharedImageGallery(ctx, "example", &compute.SharedImageGalleryArgs{
* Name: pulumi.String("example_image_gallery"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* Description: pulumi.String("Shared images and things."),
* Tags: pulumi.StringMap{
* "Hello": pulumi.String("There"),
* "World": pulumi.String("Example"),
* },
* })
* if err != nil {
* return err
* }
* _, err = compute.NewSharedImage(ctx, "example", &compute.SharedImageArgs{
* Name: pulumi.String("my-image"),
* GalleryName: exampleSharedImageGallery.Name,
* ResourceGroupName: example.Name,
* Location: example.Location,
* OsType: pulumi.String("Linux"),
* Identifier: &compute.SharedImageIdentifierArgs{
* Publisher: pulumi.String("PublisherName"),
* Offer: pulumi.String("OfferName"),
* Sku: pulumi.String("ExampleSku"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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.SharedImage;
* import com.pulumi.azure.compute.SharedImageArgs;
* import com.pulumi.azure.compute.inputs.SharedImageIdentifierArgs;
* 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-resources")
* .location("West Europe")
* .build());
* var exampleSharedImageGallery = new SharedImageGallery("exampleSharedImageGallery", SharedImageGalleryArgs.builder()
* .name("example_image_gallery")
* .resourceGroupName(example.name())
* .location(example.location())
* .description("Shared images and things.")
* .tags(Map.ofEntries(
* Map.entry("Hello", "There"),
* Map.entry("World", "Example")
* ))
* .build());
* var exampleSharedImage = new SharedImage("exampleSharedImage", SharedImageArgs.builder()
* .name("my-image")
* .galleryName(exampleSharedImageGallery.name())
* .resourceGroupName(example.name())
* .location(example.location())
* .osType("Linux")
* .identifier(SharedImageIdentifierArgs.builder()
* .publisher("PublisherName")
* .offer("OfferName")
* .sku("ExampleSku")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleSharedImageGallery:
* type: azure:compute:SharedImageGallery
* name: example
* properties:
* name: example_image_gallery
* resourceGroupName: ${example.name}
* location: ${example.location}
* description: Shared images and things.
* tags:
* Hello: There
* World: Example
* exampleSharedImage:
* type: azure:compute:SharedImage
* name: example
* properties:
* name: my-image
* galleryName: ${exampleSharedImageGallery.name}
* resourceGroupName: ${example.name}
* location: ${example.location}
* osType: Linux
* identifier:
* publisher: PublisherName
* offer: OfferName
* sku: ExampleSku
* ```
*
* ## Import
* Shared Images can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:compute/sharedImage:SharedImage image1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/images/image1
* ```
*/
public class SharedImage internal constructor(
override val javaResource: com.pulumi.azure.compute.SharedImage,
) : KotlinCustomResource(javaResource, SharedImageMapper) {
/**
* Specifies if the Shared Image supports Accelerated Network. Changing this forces a new resource to be created.
*/
public val acceleratedNetworkSupportEnabled: Output?
get() = javaResource.acceleratedNetworkSupportEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* CPU architecture supported by an OS. Possible values are `x64` and `Arm64`. Defaults to `x64`. Changing this forces a new resource to be created.
*/
public val architecture: Output?
get() = javaResource.architecture().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies if Confidential Virtual Machines enabled. It will enable all the features of trusted, with higher confidentiality features for isolate machines or encrypted data. Available for Gen2 machines. Changing this forces a new resource to be created.
* > **Note:**: Only one of `trusted_launch_supported`, `trusted_launch_enabled`, `confidential_vm_supported` and `confidential_vm_enabled` can be specified.
*/
public val confidentialVmEnabled: Output?
get() = javaResource.confidentialVmEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies if supports creation of both Confidential virtual machines and Gen2 virtual machines with standard security from a compatible Gen2 OS disk VHD or Gen2 Managed image. Changing this forces a new resource to be created.
*/
public val confidentialVmSupported: Output?
get() = javaResource.confidentialVmSupported().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A description of this Shared Image.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* One or more Disk Types not allowed for the Image. Possible values include `Standard_LRS` and `Premium_LRS`.
*/
public val diskTypesNotAlloweds: Output>?
get() = javaResource.diskTypesNotAlloweds().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 -> args0 })
}).orElse(null)
})
/**
* The end of life date in RFC3339 format of the Image.
*/
public val endOfLifeDate: Output?
get() = javaResource.endOfLifeDate().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The End User Licence Agreement for the Shared Image. Changing this forces a new resource to be created.
*/
public val eula: Output?
get() = javaResource.eula().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Specifies the name of the Shared Image Gallery in which this Shared Image should exist. Changing this forces a new resource to be created.
*/
public val galleryName: Output
get() = javaResource.galleryName().applyValue({ args0 -> args0 })
/**
* The generation of HyperV that the Virtual Machine used to create the Shared Image is based on. Possible values are `V1` and `V2`. Defaults to `V1`. Changing this forces a new resource to be created.
*/
public val hyperVGeneration: Output?
get() = javaResource.hyperVGeneration().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An `identifier` block as defined below.
*/
public val identifier: Output
get() = javaResource.identifier().applyValue({ args0 ->
args0.let({ args0 ->
sharedImageIdentifierToKotlin(args0)
})
})
/**
* Specifies the supported Azure location where the Shared Image Gallery exists. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* Maximum memory in GB recommended for the Image.
*/
public val maxRecommendedMemoryInGb: Output?
get() = javaResource.maxRecommendedMemoryInGb().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Maximum count of vCPUs recommended for the Image.
*/
public val maxRecommendedVcpuCount: Output?
get() = javaResource.maxRecommendedVcpuCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Minimum memory in GB recommended for the Image.
*/
public val minRecommendedMemoryInGb: Output?
get() = javaResource.minRecommendedMemoryInGb().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Minimum count of vCPUs recommended for the Image.
*/
public val minRecommendedVcpuCount: Output?
get() = javaResource.minRecommendedVcpuCount().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Specifies the name of the Shared Image. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The type of Operating System present in this Shared Image. Possible values are `Linux` and `Windows`. Changing this forces a new resource to be created.
*/
public val osType: Output
get() = javaResource.osType().applyValue({ args0 -> args0 })
/**
* The URI containing the Privacy Statement associated with this Shared Image. Changing this forces a new resource to be created.
*/
public val privacyStatementUri: Output?
get() = javaResource.privacyStatementUri().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A `purchase_plan` block as defined below.
*/
public val purchasePlan: Output?
get() = javaResource.purchasePlan().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
sharedImagePurchasePlanToKotlin(args0)
})
}).orElse(null)
})
/**
* The URI containing the Release Notes associated with this Shared Image.
*/
public val releaseNoteUri: Output?
get() = javaResource.releaseNoteUri().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the resource group in which the Shared Image Gallery exists. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* Specifies that the Operating System used inside this Image has not been Generalized (for example, `sysprep` on Windows has not been run). Changing this forces a new resource to be created.
* !> **Note:** It's recommended to Generalize images where possible - Specialized Images reuse the same UUID internally within each Virtual Machine, which can have unintended side-effects.
*/
public val specialized: Output?
get() = javaResource.specialized().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A mapping of tags to assign to the Shared Image.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy