All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.netapp.kotlin.Volume.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.netapp.kotlin

import com.pulumi.azure.netapp.kotlin.outputs.VolumeDataProtectionReplication
import com.pulumi.azure.netapp.kotlin.outputs.VolumeDataProtectionSnapshotPolicy
import com.pulumi.azure.netapp.kotlin.outputs.VolumeExportPolicyRule
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.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.netapp.kotlin.outputs.VolumeDataProtectionReplication.Companion.toKotlin as volumeDataProtectionReplicationToKotlin
import com.pulumi.azure.netapp.kotlin.outputs.VolumeDataProtectionSnapshotPolicy.Companion.toKotlin as volumeDataProtectionSnapshotPolicyToKotlin
import com.pulumi.azure.netapp.kotlin.outputs.VolumeExportPolicyRule.Companion.toKotlin as volumeExportPolicyRuleToKotlin

/**
 * Builder for [Volume].
 */
@PulumiTagMarker
public class VolumeResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: VolumeArgs = VolumeArgs()

    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 VolumeArgsBuilder.() -> Unit) {
        val builder = VolumeArgsBuilder()
        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(): Volume {
        val builtJavaResource = com.pulumi.azure.netapp.Volume(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Volume(builtJavaResource)
    }
}

/**
 *
 * ## Import
 * NetApp Volumes can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:netapp/volume:Volume example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/capacityPools/pool1/volumes/volume1
 * ```
 */
public class Volume internal constructor(
    override val javaResource: com.pulumi.azure.netapp.Volume,
) : KotlinCustomResource(javaResource, VolumeMapper) {
    /**
     * 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 })

    /**
     * Is the NetApp Volume enabled for Azure VMware Solution (AVS) datastore purpose. Defaults to `false`. Changing this forces a new resource to be created.
     */
    public val azureVmwareDataStoreEnabled: Output?
        get() = javaResource.azureVmwareDataStoreEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Creates volume from snapshot. Following properties must be the same as the original volume where the snapshot was taken from: `protocols`, `subnet_id`, `location`, `service_level`, `resource_group_name`, `account_name` and `pool_name`. Changing this forces a new resource to be created.
     */
    public val createFromSnapshotResourceId: Output?
        get() = javaResource.createFromSnapshotResourceId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * A `data_protection_replication` block as defined below. Changing this forces a new resource to be created.
     */
    public val dataProtectionReplication: Output?
        get() = javaResource.dataProtectionReplication().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> volumeDataProtectionReplicationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * A `data_protection_snapshot_policy` block as defined below.
     */
    public val dataProtectionSnapshotPolicy: Output?
        get() = javaResource.dataProtectionSnapshotPolicy().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> volumeDataProtectionSnapshotPolicyToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * The encryption key source, it can be `Microsoft.NetApp` for platform managed keys or `Microsoft.KeyVault` for customer-managed keys. This is required with `key_vault_private_endpoint_id`. Changing this forces a new resource to be created.
     */
    public val encryptionKeySource: Output
        get() = javaResource.encryptionKeySource().applyValue({ args0 -> args0 })

    /**
     * One or more `export_policy_rule` block defined below.
     */
    public val exportPolicyRules: Output>?
        get() = javaResource.exportPolicyRules().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        volumeExportPolicyRuleToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Enable to allow Kerberos secured volumes. Requires appropriate export rules as well as the parent `azure.netapp.Account`
     * having a defined AD connection.
     */
    public val kerberosEnabled: Output?
        get() = javaResource.kerberosEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The Private Endpoint ID for Key Vault, which is required when using customer-managed keys. This is required with `encryption_key_source`. Changing this forces a new resource to be created.
     */
    public val keyVaultPrivateEndpointId: Output
        get() = javaResource.keyVaultPrivateEndpointId().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 })

    /**
     * A list of IPv4 Addresses which should be used to mount the volume.
     */
    public val mountIpAddresses: Output>
        get() = javaResource.mountIpAddresses().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The name of the NetApp Volume. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Indicates which network feature to use, accepted values are `Basic` or `Standard`, it defaults to `Basic` if not defined. This is a feature in public preview and for more information about it and how to register, please refer to [Configure network features for an Azure NetApp Files volume](https://docs.microsoft.com/en-us/azure/azure-netapp-files/configure-network-features).
     */
    public val networkFeatures: Output
        get() = javaResource.networkFeatures().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 target volume protocol expressed as a list. Supported single value include `CIFS`, `NFSv3`, or `NFSv4.1`. If argument is not defined it will default to `NFSv3`. Changing this forces a new resource to be created and data will be lost. Dual protocol scenario is supported for CIFS and NFSv3, for more information, please refer to [Create a dual-protocol volume for Azure NetApp Files](https://docs.microsoft.com/azure/azure-netapp-files/create-volumes-dual-protocol) document.
     */
    public val protocols: Output>
        get() = javaResource.protocols().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * The name of the resource group where the NetApp Volume should be created. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * Volume security style, accepted values are `unix` or `ntfs`. If not provided, single-protocol volume is created defaulting to `unix` if it is `NFSv3` or `NFSv4.1` volume, if `CIFS`, it will default to `ntfs`. In a dual-protocol volume, if not provided, its value will be `ntfs`. Changing this forces a new resource to be created.
     */
    public val securityStyle: Output
        get() = javaResource.securityStyle().applyValue({ args0 -> args0 })

    /**
     * The target performance of the file system. Valid values include `Premium`, `Standard`, or `Ultra`. Changing this forces a new resource to be created.
     */
    public val serviceLevel: Output
        get() = javaResource.serviceLevel().applyValue({ args0 -> args0 })

    /**
     * Limits enumeration of files and folders (that is, listing the contents) in SMB only to users with allowed access on the share. For instance, if a user doesn't have access to read a file or folder in a share with access-based enumeration enabled, then the file or folder doesn't show up in directory listings. Defaults to `false`. For more information, please refer to [Understand NAS share permissions in Azure NetApp Files](https://learn.microsoft.com/en-us/azure/azure-netapp-files/network-attached-storage-permissions#:~:text=security%20for%20administrators.-,Access%2Dbased%20enumeration,in%20an%20Azure%20NetApp%20Files%20SMB%20volume.%20Only%20contosoadmin%20has%20access.,-In%20the%20below)
     */
    public val smbAccessBasedEnumerationEnabled: Output?
        get() = javaResource.smbAccessBasedEnumerationEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Enable SMB Continuous Availability.
     */
    public val smbContinuousAvailabilityEnabled: Output?
        get() = javaResource.smbContinuousAvailabilityEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Limits clients from browsing for an SMB share by hiding the share from view in Windows Explorer or when listing shares in "net view." Only end users that know the absolute paths to the share are able to find the share. Defaults to `false`. For more information, please refer to [Understand NAS share permissions in Azure NetApp Files](https://learn.microsoft.com/en-us/azure/azure-netapp-files/network-attached-storage-permissions#:~:text=Non%2Dbrowsable%20shares,find%20the%20share.)
     */
    public val smbNonBrowsableEnabled: Output?
        get() = javaResource.smbNonBrowsableEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies whether the .snapshot (NFS clients) or ~snapshot (SMB clients) path of a volume is visible, default value is true.
     */
    public val snapshotDirectoryVisible: Output
        get() = javaResource.snapshotDirectoryVisible().applyValue({ args0 -> args0 })

    /**
     * The maximum Storage Quota allowed for a file system in Gigabytes.
     */
    public val storageQuotaInGb: Output
        get() = javaResource.storageQuotaInGb().applyValue({ args0 -> args0 })

    /**
     * The ID of the Subnet the NetApp Volume resides in, which must have the `Microsoft.NetApp/volumes` delegation. Changing this forces a new resource to be created.
     */
    public val subnetId: Output
        get() = javaResource.subnetId().applyValue({ args0 -> args0 })

    /**
     * A mapping of tags to assign to the resource.
     * > **Note:** It is highly recommended to use the **lifecycle** property as noted in the example since it will prevent an accidental deletion of the volume if the `protocols` argument changes to a different protocol type.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * Throughput of this volume in Mibps.
     */
    public val throughputInMibps: Output
        get() = javaResource.throughputInMibps().applyValue({ args0 -> args0 })

    /**
     * A unique file path for the volume. Used when creating mount targets. Changing this forces a new resource to be created.
     */
    public val volumePath: Output
        get() = javaResource.volumePath().applyValue({ args0 -> args0 })

    /**
     * Specifies the Availability Zone in which the Volume should be located. Possible values are `1`, `2` and `3`. Changing this forces a new resource to be created. This feature is currently in preview, for more information on how to enable it, please refer to [Manage availability zone volume placement for Azure NetApp Files](https://learn.microsoft.com/en-us/azure/azure-netapp-files/manage-availability-zone-volume-placement#register-the-feature).
     */
    public val zone: Output?
        get() = javaResource.zone().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object VolumeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.netapp.Volume::class == javaResource::class

    override fun map(javaResource: Resource): Volume = Volume(
        javaResource as
            com.pulumi.azure.netapp.Volume,
    )
}

/**
 * @see [Volume].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Volume].
 */
public suspend fun volume(name: String, block: suspend VolumeResourceBuilder.() -> Unit): Volume {
    val builder = VolumeResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Volume].
 * @param name The _unique_ name of the resulting resource.
 */
public fun volume(name: String): Volume {
    val builder = VolumeResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy