![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.compute.kotlin.SnapshotArgs.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.SnapshotArgs.builder
import com.pulumi.azure.compute.kotlin.inputs.SnapshotEncryptionSettingsArgs
import com.pulumi.azure.compute.kotlin.inputs.SnapshotEncryptionSettingsArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Manages a Disk Snapshot.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "snapshot-rg",
* location: "West Europe",
* });
* const exampleManagedDisk = new azure.compute.ManagedDisk("example", {
* name: "managed-disk",
* location: example.location,
* resourceGroupName: example.name,
* storageAccountType: "Standard_LRS",
* createOption: "Empty",
* diskSizeGb: 10,
* });
* const exampleSnapshot = new azure.compute.Snapshot("example", {
* name: "snapshot",
* location: example.location,
* resourceGroupName: example.name,
* createOption: "Copy",
* sourceUri: exampleManagedDisk.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="snapshot-rg",
* location="West Europe")
* example_managed_disk = azure.compute.ManagedDisk("example",
* name="managed-disk",
* location=example.location,
* resource_group_name=example.name,
* storage_account_type="Standard_LRS",
* create_option="Empty",
* disk_size_gb=10)
* example_snapshot = azure.compute.Snapshot("example",
* name="snapshot",
* location=example.location,
* resource_group_name=example.name,
* create_option="Copy",
* source_uri=example_managed_disk.id)
* ```
* ```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 = "snapshot-rg",
* Location = "West Europe",
* });
* var exampleManagedDisk = new Azure.Compute.ManagedDisk("example", new()
* {
* Name = "managed-disk",
* Location = example.Location,
* ResourceGroupName = example.Name,
* StorageAccountType = "Standard_LRS",
* CreateOption = "Empty",
* DiskSizeGb = 10,
* });
* var exampleSnapshot = new Azure.Compute.Snapshot("example", new()
* {
* Name = "snapshot",
* Location = example.Location,
* ResourceGroupName = example.Name,
* CreateOption = "Copy",
* SourceUri = exampleManagedDisk.Id,
* });
* });
* ```
* ```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("snapshot-rg"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleManagedDisk, err := compute.NewManagedDisk(ctx, "example", &compute.ManagedDiskArgs{
* Name: pulumi.String("managed-disk"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* StorageAccountType: pulumi.String("Standard_LRS"),
* CreateOption: pulumi.String("Empty"),
* DiskSizeGb: pulumi.Int(10),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewSnapshot(ctx, "example", &compute.SnapshotArgs{
* Name: pulumi.String("snapshot"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* CreateOption: pulumi.String("Copy"),
* SourceUri: exampleManagedDisk.ID(),
* })
* 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.ManagedDisk;
* import com.pulumi.azure.compute.ManagedDiskArgs;
* import com.pulumi.azure.compute.Snapshot;
* import com.pulumi.azure.compute.SnapshotArgs;
* 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("snapshot-rg")
* .location("West Europe")
* .build());
* var exampleManagedDisk = new ManagedDisk("exampleManagedDisk", ManagedDiskArgs.builder()
* .name("managed-disk")
* .location(example.location())
* .resourceGroupName(example.name())
* .storageAccountType("Standard_LRS")
* .createOption("Empty")
* .diskSizeGb("10")
* .build());
* var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
* .name("snapshot")
* .location(example.location())
* .resourceGroupName(example.name())
* .createOption("Copy")
* .sourceUri(exampleManagedDisk.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: snapshot-rg
* location: West Europe
* exampleManagedDisk:
* type: azure:compute:ManagedDisk
* name: example
* properties:
* name: managed-disk
* location: ${example.location}
* resourceGroupName: ${example.name}
* storageAccountType: Standard_LRS
* createOption: Empty
* diskSizeGb: '10'
* exampleSnapshot:
* type: azure:compute:Snapshot
* name: example
* properties:
* name: snapshot
* location: ${example.location}
* resourceGroupName: ${example.name}
* createOption: Copy
* sourceUri: ${exampleManagedDisk.id}
* ```
*
* ## Import
* Snapshots can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:compute/snapshot:Snapshot example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/snapshots/snapshot1
* ```
* @property createOption Indicates how the snapshot is to be created. Possible values are `Copy` or `Import`.
* > **Note:** One of `source_uri`, `source_resource_id` or `storage_account_id` must be specified.
* @property diskAccessId Specifies the ID of the Disk Access which should be used for this Snapshot. This is used in conjunction with setting `network_access_policy` to `AllowPrivate`.
* @property diskSizeGb The size of the Snapshotted Disk in GB.
* @property encryptionSettings A `encryption_settings` block as defined below.
* > **NOTE:** Removing `encryption_settings` forces a new resource to be created.
* @property incrementalEnabled Specifies if the Snapshot is incremental. Changing this forces a new resource to be created.
* @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
* @property name Specifies the name of the Snapshot resource. Changing this forces a new resource to be created.
* @property networkAccessPolicy Policy for accessing the disk via network. Possible values are `AllowAll`, `AllowPrivate`, or `DenyAll`. Defaults to `AllowAll`.
* @property publicNetworkAccessEnabled Policy for controlling export on the disk. Possible values are `true` or `false`. Defaults to `true`.
* @property resourceGroupName The name of the resource group in which to create the Snapshot. Changing this forces a new resource to be created.
* @property sourceResourceId Specifies a reference to an existing snapshot, when `create_option` is `Copy`. Changing this forces a new resource to be created.
* @property sourceUri Specifies the URI to a Managed or Unmanaged Disk. Changing this forces a new resource to be created.
* @property storageAccountId Specifies the ID of an storage account. Used with `source_uri` to allow authorization during import of unmanaged blobs from a different subscription. Changing this forces a new resource to be created.
* @property tags A mapping of tags to assign to the resource.
*/
public data class SnapshotArgs(
public val createOption: Output? = null,
public val diskAccessId: Output? = null,
public val diskSizeGb: Output? = null,
public val encryptionSettings: Output? = null,
public val incrementalEnabled: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val networkAccessPolicy: Output? = null,
public val publicNetworkAccessEnabled: Output? = null,
public val resourceGroupName: Output? = null,
public val sourceResourceId: Output? = null,
public val sourceUri: Output? = null,
public val storageAccountId: Output? = null,
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy