com.pulumi.azure.netapp.kotlin.Snapshot.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.netapp.kotlin
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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [Snapshot].
*/
@PulumiTagMarker
public class SnapshotResourceBuilder internal constructor() {
public var name: String? = null
public var args: SnapshotArgs = SnapshotArgs()
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 SnapshotArgsBuilder.() -> Unit) {
val builder = SnapshotArgsBuilder()
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(): Snapshot {
val builtJavaResource = com.pulumi.azure.netapp.Snapshot(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Snapshot(builtJavaResource)
}
}
/**
* Manages a NetApp Snapshot.
* ## NetApp Snapshot 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 exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
* name: "example-virtualnetwork",
* addressSpaces: ["10.0.0.0/16"],
* location: example.location,
* resourceGroupName: example.name,
* });
* const exampleSubnet = new azure.network.Subnet("example", {
* name: "example-subnet",
* resourceGroupName: example.name,
* virtualNetworkName: exampleVirtualNetwork.name,
* addressPrefixes: ["10.0.2.0/24"],
* delegations: [{
* name: "netapp",
* serviceDelegation: {
* name: "Microsoft.Netapp/volumes",
* actions: [
* "Microsoft.Network/networkinterfaces/*",
* "Microsoft.Network/virtualNetworks/subnets/join/action",
* ],
* },
* }],
* });
* const exampleAccount = new azure.netapp.Account("example", {
* name: "example-netappaccount",
* location: example.location,
* resourceGroupName: example.name,
* });
* const examplePool = new azure.netapp.Pool("example", {
* name: "example-netapppool",
* accountName: exampleAccount.name,
* location: example.location,
* resourceGroupName: example.name,
* serviceLevel: "Premium",
* sizeInTb: 4,
* });
* const exampleVolume = new azure.netapp.Volume("example", {
* name: "example-netappvolume",
* location: example.location,
* resourceGroupName: example.name,
* accountName: exampleAccount.name,
* poolName: examplePool.name,
* volumePath: "my-unique-file-path",
* serviceLevel: "Premium",
* subnetId: exampleSubnet.id,
* storageQuotaInGb: 100,
* });
* const exampleSnapshot = new azure.netapp.Snapshot("example", {
* name: "example-netappsnapshot",
* accountName: exampleAccount.name,
* poolName: examplePool.name,
* volumeName: exampleVolume.name,
* location: example.location,
* resourceGroupName: example.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_virtual_network = azure.network.VirtualNetwork("example",
* name="example-virtualnetwork",
* address_spaces=["10.0.0.0/16"],
* location=example.location,
* resource_group_name=example.name)
* example_subnet = azure.network.Subnet("example",
* name="example-subnet",
* resource_group_name=example.name,
* virtual_network_name=example_virtual_network.name,
* address_prefixes=["10.0.2.0/24"],
* delegations=[azure.network.SubnetDelegationArgs(
* name="netapp",
* service_delegation=azure.network.SubnetDelegationServiceDelegationArgs(
* name="Microsoft.Netapp/volumes",
* actions=[
* "Microsoft.Network/networkinterfaces/*",
* "Microsoft.Network/virtualNetworks/subnets/join/action",
* ],
* ),
* )])
* example_account = azure.netapp.Account("example",
* name="example-netappaccount",
* location=example.location,
* resource_group_name=example.name)
* example_pool = azure.netapp.Pool("example",
* name="example-netapppool",
* account_name=example_account.name,
* location=example.location,
* resource_group_name=example.name,
* service_level="Premium",
* size_in_tb=4)
* example_volume = azure.netapp.Volume("example",
* name="example-netappvolume",
* location=example.location,
* resource_group_name=example.name,
* account_name=example_account.name,
* pool_name=example_pool.name,
* volume_path="my-unique-file-path",
* service_level="Premium",
* subnet_id=example_subnet.id,
* storage_quota_in_gb=100)
* example_snapshot = azure.netapp.Snapshot("example",
* name="example-netappsnapshot",
* account_name=example_account.name,
* pool_name=example_pool.name,
* volume_name=example_volume.name,
* location=example.location,
* resource_group_name=example.name)
* ```
* ```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 exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
* {
* Name = "example-virtualnetwork",
* AddressSpaces = new[]
* {
* "10.0.0.0/16",
* },
* Location = example.Location,
* ResourceGroupName = example.Name,
* });
* var exampleSubnet = new Azure.Network.Subnet("example", new()
* {
* Name = "example-subnet",
* ResourceGroupName = example.Name,
* VirtualNetworkName = exampleVirtualNetwork.Name,
* AddressPrefixes = new[]
* {
* "10.0.2.0/24",
* },
* Delegations = new[]
* {
* new Azure.Network.Inputs.SubnetDelegationArgs
* {
* Name = "netapp",
* ServiceDelegation = new Azure.Network.Inputs.SubnetDelegationServiceDelegationArgs
* {
* Name = "Microsoft.Netapp/volumes",
* Actions = new[]
* {
* "Microsoft.Network/networkinterfaces/*",
* "Microsoft.Network/virtualNetworks/subnets/join/action",
* },
* },
* },
* },
* });
* var exampleAccount = new Azure.NetApp.Account("example", new()
* {
* Name = "example-netappaccount",
* Location = example.Location,
* ResourceGroupName = example.Name,
* });
* var examplePool = new Azure.NetApp.Pool("example", new()
* {
* Name = "example-netapppool",
* AccountName = exampleAccount.Name,
* Location = example.Location,
* ResourceGroupName = example.Name,
* ServiceLevel = "Premium",
* SizeInTb = 4,
* });
* var exampleVolume = new Azure.NetApp.Volume("example", new()
* {
* Name = "example-netappvolume",
* Location = example.Location,
* ResourceGroupName = example.Name,
* AccountName = exampleAccount.Name,
* PoolName = examplePool.Name,
* VolumePath = "my-unique-file-path",
* ServiceLevel = "Premium",
* SubnetId = exampleSubnet.Id,
* StorageQuotaInGb = 100,
* });
* var exampleSnapshot = new Azure.NetApp.Snapshot("example", new()
* {
* Name = "example-netappsnapshot",
* AccountName = exampleAccount.Name,
* PoolName = examplePool.Name,
* VolumeName = exampleVolume.Name,
* Location = example.Location,
* ResourceGroupName = example.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/netapp"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
* "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
* }
* exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
* Name: pulumi.String("example-virtualnetwork"),
* AddressSpaces: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* Location: example.Location,
* ResourceGroupName: example.Name,
* })
* if err != nil {
* return err
* }
* exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
* Name: pulumi.String("example-subnet"),
* ResourceGroupName: example.Name,
* VirtualNetworkName: exampleVirtualNetwork.Name,
* AddressPrefixes: pulumi.StringArray{
* pulumi.String("10.0.2.0/24"),
* },
* Delegations: network.SubnetDelegationArray{
* &network.SubnetDelegationArgs{
* Name: pulumi.String("netapp"),
* ServiceDelegation: &network.SubnetDelegationServiceDelegationArgs{
* Name: pulumi.String("Microsoft.Netapp/volumes"),
* Actions: pulumi.StringArray{
* pulumi.String("Microsoft.Network/networkinterfaces/*"),
* pulumi.String("Microsoft.Network/virtualNetworks/subnets/join/action"),
* },
* },
* },
* },
* })
* if err != nil {
* return err
* }
* exampleAccount, err := netapp.NewAccount(ctx, "example", &netapp.AccountArgs{
* Name: pulumi.String("example-netappaccount"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* })
* if err != nil {
* return err
* }
* examplePool, err := netapp.NewPool(ctx, "example", &netapp.PoolArgs{
* Name: pulumi.String("example-netapppool"),
* AccountName: exampleAccount.Name,
* Location: example.Location,
* ResourceGroupName: example.Name,
* ServiceLevel: pulumi.String("Premium"),
* SizeInTb: pulumi.Int(4),
* })
* if err != nil {
* return err
* }
* exampleVolume, err := netapp.NewVolume(ctx, "example", &netapp.VolumeArgs{
* Name: pulumi.String("example-netappvolume"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* AccountName: exampleAccount.Name,
* PoolName: examplePool.Name,
* VolumePath: pulumi.String("my-unique-file-path"),
* ServiceLevel: pulumi.String("Premium"),
* SubnetId: exampleSubnet.ID(),
* StorageQuotaInGb: pulumi.Int(100),
* })
* if err != nil {
* return err
* }
* _, err = netapp.NewSnapshot(ctx, "example", &netapp.SnapshotArgs{
* Name: pulumi.String("example-netappsnapshot"),
* AccountName: exampleAccount.Name,
* PoolName: examplePool.Name,
* VolumeName: exampleVolume.Name,
* Location: example.Location,
* ResourceGroupName: example.Name,
* })
* 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.network.VirtualNetwork;
* import com.pulumi.azure.network.VirtualNetworkArgs;
* import com.pulumi.azure.network.Subnet;
* import com.pulumi.azure.network.SubnetArgs;
* import com.pulumi.azure.network.inputs.SubnetDelegationArgs;
* import com.pulumi.azure.network.inputs.SubnetDelegationServiceDelegationArgs;
* import com.pulumi.azure.netapp.Account;
* import com.pulumi.azure.netapp.AccountArgs;
* import com.pulumi.azure.netapp.Pool;
* import com.pulumi.azure.netapp.PoolArgs;
* import com.pulumi.azure.netapp.Volume;
* import com.pulumi.azure.netapp.VolumeArgs;
* import com.pulumi.azure.netapp.Snapshot;
* import com.pulumi.azure.netapp.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("example-resources")
* .location("West Europe")
* .build());
* var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
* .name("example-virtualnetwork")
* .addressSpaces("10.0.0.0/16")
* .location(example.location())
* .resourceGroupName(example.name())
* .build());
* var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
* .name("example-subnet")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("10.0.2.0/24")
* .delegations(SubnetDelegationArgs.builder()
* .name("netapp")
* .serviceDelegation(SubnetDelegationServiceDelegationArgs.builder()
* .name("Microsoft.Netapp/volumes")
* .actions(
* "Microsoft.Network/networkinterfaces/*",
* "Microsoft.Network/virtualNetworks/subnets/join/action")
* .build())
* .build())
* .build());
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example-netappaccount")
* .location(example.location())
* .resourceGroupName(example.name())
* .build());
* var examplePool = new Pool("examplePool", PoolArgs.builder()
* .name("example-netapppool")
* .accountName(exampleAccount.name())
* .location(example.location())
* .resourceGroupName(example.name())
* .serviceLevel("Premium")
* .sizeInTb("4")
* .build());
* var exampleVolume = new Volume("exampleVolume", VolumeArgs.builder()
* .name("example-netappvolume")
* .location(example.location())
* .resourceGroupName(example.name())
* .accountName(exampleAccount.name())
* .poolName(examplePool.name())
* .volumePath("my-unique-file-path")
* .serviceLevel("Premium")
* .subnetId(exampleSubnet.id())
* .storageQuotaInGb("100")
* .build());
* var exampleSnapshot = new Snapshot("exampleSnapshot", SnapshotArgs.builder()
* .name("example-netappsnapshot")
* .accountName(exampleAccount.name())
* .poolName(examplePool.name())
* .volumeName(exampleVolume.name())
* .location(example.location())
* .resourceGroupName(example.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleVirtualNetwork:
* type: azure:network:VirtualNetwork
* name: example
* properties:
* name: example-virtualnetwork
* addressSpaces:
* - 10.0.0.0/16
* location: ${example.location}
* resourceGroupName: ${example.name}
* exampleSubnet:
* type: azure:network:Subnet
* name: example
* properties:
* name: example-subnet
* resourceGroupName: ${example.name}
* virtualNetworkName: ${exampleVirtualNetwork.name}
* addressPrefixes:
* - 10.0.2.0/24
* delegations:
* - name: netapp
* serviceDelegation:
* name: Microsoft.Netapp/volumes
* actions:
* - Microsoft.Network/networkinterfaces/*
* - Microsoft.Network/virtualNetworks/subnets/join/action
* exampleAccount:
* type: azure:netapp:Account
* name: example
* properties:
* name: example-netappaccount
* location: ${example.location}
* resourceGroupName: ${example.name}
* examplePool:
* type: azure:netapp:Pool
* name: example
* properties:
* name: example-netapppool
* accountName: ${exampleAccount.name}
* location: ${example.location}
* resourceGroupName: ${example.name}
* serviceLevel: Premium
* sizeInTb: '4'
* exampleVolume:
* type: azure:netapp:Volume
* name: example
* properties:
* name: example-netappvolume
* location: ${example.location}
* resourceGroupName: ${example.name}
* accountName: ${exampleAccount.name}
* poolName: ${examplePool.name}
* volumePath: my-unique-file-path
* serviceLevel: Premium
* subnetId: ${exampleSubnet.id}
* storageQuotaInGb: '100'
* exampleSnapshot:
* type: azure:netapp:Snapshot
* name: example
* properties:
* name: example-netappsnapshot
* accountName: ${exampleAccount.name}
* poolName: ${examplePool.name}
* volumeName: ${exampleVolume.name}
* location: ${example.location}
* resourceGroupName: ${example.name}
* ```
*
* ## Import
* NetApp Snapshot can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:netapp/snapshot:Snapshot example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1/snapshots/snapshot1
* ```
* */*/*/*/*/*/
*/
public class Snapshot internal constructor(
override val javaResource: com.pulumi.azure.netapp.Snapshot,
) : KotlinCustomResource(javaResource, SnapshotMapper) {
/**
* The name of the NetApp account in which the NetApp Pool should be created. Changing this forces a new resource to be created.
*/
public val accountName: Output
get() = javaResource.accountName().applyValue({ args0 -> args0 })
/**
* Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The name of the NetApp Snapshot. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The name of the NetApp pool in which the NetApp Volume should be created. Changing this forces a new resource to be created.
*/
public val poolName: Output
get() = javaResource.poolName().applyValue({ args0 -> args0 })
/**
* The name of the resource group where the NetApp Snapshot should be created. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* The name of the NetApp volume in which the NetApp Snapshot should be created. Changing this forces a new resource to be created.
*/
public val volumeName: Output
get() = javaResource.volumeName().applyValue({ args0 -> args0 })
}
public object SnapshotMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.netapp.Snapshot::class == javaResource::class
override fun map(javaResource: Resource): Snapshot = Snapshot(
javaResource as
com.pulumi.azure.netapp.Snapshot,
)
}
/**
* @see [Snapshot].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Snapshot].
*/
public suspend fun snapshot(name: String, block: suspend SnapshotResourceBuilder.() -> Unit):
Snapshot {
val builder = SnapshotResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Snapshot].
* @param name The _unique_ name of the resulting resource.
*/
public fun snapshot(name: String): Snapshot {
val builder = SnapshotResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy