Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.hpc.kotlin.CacheNfsTargetArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.hpc.kotlin
import com.pulumi.azure.hpc.CacheNfsTargetArgs.builder
import com.pulumi.azure.hpc.kotlin.inputs.CacheNfsTargetNamespaceJunctionArgs
import com.pulumi.azure.hpc.kotlin.inputs.CacheNfsTargetNamespaceJunctionArgsBuilder
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Manages a NFS Target within a HPC Cache.
* > **NOTE:**: By request of the service team the provider no longer automatically registering the `Microsoft.StorageCache` Resource Provider for this resource. To register it you can run `az provider register --namespace 'Microsoft.StorageCache'`.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* import * as std from "@pulumi/std";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
* name: "examplevn",
* addressSpaces: ["10.0.0.0/16"],
* location: example.location,
* resourceGroupName: example.name,
* });
* const exampleHpc = new azure.network.Subnet("example_hpc", {
* name: "examplesubnethpc",
* resourceGroupName: example.name,
* virtualNetworkName: exampleVirtualNetwork.name,
* addressPrefixes: ["10.0.1.0/24"],
* });
* const exampleCache = new azure.hpc.Cache("example", {
* name: "examplehpccache",
* resourceGroupName: example.name,
* location: example.location,
* cacheSizeInGb: 3072,
* subnetId: exampleHpc.id,
* skuName: "Standard_2G",
* });
* const exampleVm = new azure.network.Subnet("example_vm", {
* name: "examplesubnetvm",
* resourceGroupName: example.name,
* virtualNetworkName: exampleVirtualNetwork.name,
* addressPrefixes: ["10.0.2.0/24"],
* });
* const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
* name: "examplenic",
* location: example.location,
* resourceGroupName: example.name,
* ipConfigurations: [{
* name: "internal",
* subnetId: exampleVm.id,
* privateIpAddressAllocation: "Dynamic",
* }],
* });
* const customData = `#!/bin/bash
* sudo -i
* apt-get install -y nfs-kernel-server
* mkdir -p /export/a/1
* mkdir -p /export/a/2
* mkdir -p /export/b
* cat << EOF > /etc/exports
* /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
* /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
* EOF
* systemctl start nfs-server
* exportfs -arv
* `;
* const exampleLinuxVirtualMachine = new azure.compute.LinuxVirtualMachine("example", {
* name: "examplevm",
* resourceGroupName: example.name,
* location: example.location,
* size: "Standard_F2",
* adminUsername: "adminuser",
* networkInterfaceIds: [exampleNetworkInterface.id],
* adminSshKeys: [{
* username: "adminuser",
* publicKey: std.file({
* input: "~/.ssh/id_rsa.pub",
* }).then(invoke => invoke.result),
* }],
* osDisk: {
* caching: "ReadWrite",
* storageAccountType: "Standard_LRS",
* },
* sourceImageReference: {
* publisher: "Canonical",
* offer: "0001-com-ubuntu-server-jammy",
* sku: "22_04-lts",
* version: "latest",
* },
* customData: std.base64encode({
* input: customData,
* }).then(invoke => invoke.result),
* });
* const exampleCacheNfsTarget = new azure.hpc.CacheNfsTarget("example", {
* name: "examplehpcnfstarget",
* resourceGroupName: example.name,
* cacheName: exampleCache.name,
* targetHostName: exampleLinuxVirtualMachine.privateIpAddress,
* usageModel: "READ_HEAVY_INFREQ",
* namespaceJunctions: [
* {
* namespacePath: "/nfs/a1",
* nfsExport: "/export/a",
* targetPath: "1",
* },
* {
* namespacePath: "/nfs/b",
* nfsExport: "/export/b",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* import pulumi_std as std
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_virtual_network = azure.network.VirtualNetwork("example",
* name="examplevn",
* address_spaces=["10.0.0.0/16"],
* location=example.location,
* resource_group_name=example.name)
* example_hpc = azure.network.Subnet("example_hpc",
* name="examplesubnethpc",
* resource_group_name=example.name,
* virtual_network_name=example_virtual_network.name,
* address_prefixes=["10.0.1.0/24"])
* example_cache = azure.hpc.Cache("example",
* name="examplehpccache",
* resource_group_name=example.name,
* location=example.location,
* cache_size_in_gb=3072,
* subnet_id=example_hpc.id,
* sku_name="Standard_2G")
* example_vm = azure.network.Subnet("example_vm",
* name="examplesubnetvm",
* resource_group_name=example.name,
* virtual_network_name=example_virtual_network.name,
* address_prefixes=["10.0.2.0/24"])
* example_network_interface = azure.network.NetworkInterface("example",
* name="examplenic",
* location=example.location,
* resource_group_name=example.name,
* ip_configurations=[{
* "name": "internal",
* "subnet_id": example_vm.id,
* "private_ip_address_allocation": "Dynamic",
* }])
* custom_data = """#!/bin/bash
* sudo -i
* apt-get install -y nfs-kernel-server
* mkdir -p /export/a/1
* mkdir -p /export/a/2
* mkdir -p /export/b
* cat << EOF > /etc/exports
* /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
* /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
* EOF
* systemctl start nfs-server
* exportfs -arv
* """
* example_linux_virtual_machine = azure.compute.LinuxVirtualMachine("example",
* name="examplevm",
* resource_group_name=example.name,
* location=example.location,
* size="Standard_F2",
* admin_username="adminuser",
* network_interface_ids=[example_network_interface.id],
* admin_ssh_keys=[{
* "username": "adminuser",
* "public_key": std.file(input="~/.ssh/id_rsa.pub").result,
* }],
* os_disk={
* "caching": "ReadWrite",
* "storage_account_type": "Standard_LRS",
* },
* source_image_reference={
* "publisher": "Canonical",
* "offer": "0001-com-ubuntu-server-jammy",
* "sku": "22_04-lts",
* "version": "latest",
* },
* custom_data=std.base64encode(input=custom_data).result)
* example_cache_nfs_target = azure.hpc.CacheNfsTarget("example",
* name="examplehpcnfstarget",
* resource_group_name=example.name,
* cache_name=example_cache.name,
* target_host_name=example_linux_virtual_machine.private_ip_address,
* usage_model="READ_HEAVY_INFREQ",
* namespace_junctions=[
* {
* "namespace_path": "/nfs/a1",
* "nfs_export": "/export/a",
* "target_path": "1",
* },
* {
* "namespace_path": "/nfs/b",
* "nfs_export": "/export/b",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* using Std = Pulumi.Std;
* 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 = "examplevn",
* AddressSpaces = new[]
* {
* "10.0.0.0/16",
* },
* Location = example.Location,
* ResourceGroupName = example.Name,
* });
* var exampleHpc = new Azure.Network.Subnet("example_hpc", new()
* {
* Name = "examplesubnethpc",
* ResourceGroupName = example.Name,
* VirtualNetworkName = exampleVirtualNetwork.Name,
* AddressPrefixes = new[]
* {
* "10.0.1.0/24",
* },
* });
* var exampleCache = new Azure.Hpc.Cache("example", new()
* {
* Name = "examplehpccache",
* ResourceGroupName = example.Name,
* Location = example.Location,
* CacheSizeInGb = 3072,
* SubnetId = exampleHpc.Id,
* SkuName = "Standard_2G",
* });
* var exampleVm = new Azure.Network.Subnet("example_vm", new()
* {
* Name = "examplesubnetvm",
* ResourceGroupName = example.Name,
* VirtualNetworkName = exampleVirtualNetwork.Name,
* AddressPrefixes = new[]
* {
* "10.0.2.0/24",
* },
* });
* var exampleNetworkInterface = new Azure.Network.NetworkInterface("example", new()
* {
* Name = "examplenic",
* Location = example.Location,
* ResourceGroupName = example.Name,
* IpConfigurations = new[]
* {
* new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
* {
* Name = "internal",
* SubnetId = exampleVm.Id,
* PrivateIpAddressAllocation = "Dynamic",
* },
* },
* });
* var customData = @"#!/bin/bash
* sudo -i
* apt-get install -y nfs-kernel-server
* mkdir -p /export/a/1
* mkdir -p /export/a/2
* mkdir -p /export/b
* cat << EOF > /etc/exports
* /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
* /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
* EOF
* systemctl start nfs-server
* exportfs -arv
* ";
* var exampleLinuxVirtualMachine = new Azure.Compute.LinuxVirtualMachine("example", new()
* {
* Name = "examplevm",
* ResourceGroupName = example.Name,
* Location = example.Location,
* Size = "Standard_F2",
* AdminUsername = "adminuser",
* NetworkInterfaceIds = new[]
* {
* exampleNetworkInterface.Id,
* },
* AdminSshKeys = new[]
* {
* new Azure.Compute.Inputs.LinuxVirtualMachineAdminSshKeyArgs
* {
* Username = "adminuser",
* PublicKey = Std.File.Invoke(new()
* {
* Input = "~/.ssh/id_rsa.pub",
* }).Apply(invoke => invoke.Result),
* },
* },
* OsDisk = new Azure.Compute.Inputs.LinuxVirtualMachineOsDiskArgs
* {
* Caching = "ReadWrite",
* StorageAccountType = "Standard_LRS",
* },
* SourceImageReference = new Azure.Compute.Inputs.LinuxVirtualMachineSourceImageReferenceArgs
* {
* Publisher = "Canonical",
* Offer = "0001-com-ubuntu-server-jammy",
* Sku = "22_04-lts",
* Version = "latest",
* },
* CustomData = Std.Base64encode.Invoke(new()
* {
* Input = customData,
* }).Apply(invoke => invoke.Result),
* });
* var exampleCacheNfsTarget = new Azure.Hpc.CacheNfsTarget("example", new()
* {
* Name = "examplehpcnfstarget",
* ResourceGroupName = example.Name,
* CacheName = exampleCache.Name,
* TargetHostName = exampleLinuxVirtualMachine.PrivateIpAddress,
* UsageModel = "READ_HEAVY_INFREQ",
* NamespaceJunctions = new[]
* {
* new Azure.Hpc.Inputs.CacheNfsTargetNamespaceJunctionArgs
* {
* NamespacePath = "/nfs/a1",
* NfsExport = "/export/a",
* TargetPath = "1",
* },
* new Azure.Hpc.Inputs.CacheNfsTargetNamespaceJunctionArgs
* {
* NamespacePath = "/nfs/b",
* NfsExport = "/export/b",
* },
* },
* });
* });
* ```
* ```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-azure/sdk/v5/go/azure/hpc"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "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("examplevn"),
* AddressSpaces: pulumi.StringArray{
* pulumi.String("10.0.0.0/16"),
* },
* Location: example.Location,
* ResourceGroupName: example.Name,
* })
* if err != nil {
* return err
* }
* exampleHpc, err := network.NewSubnet(ctx, "example_hpc", &network.SubnetArgs{
* Name: pulumi.String("examplesubnethpc"),
* ResourceGroupName: example.Name,
* VirtualNetworkName: exampleVirtualNetwork.Name,
* AddressPrefixes: pulumi.StringArray{
* pulumi.String("10.0.1.0/24"),
* },
* })
* if err != nil {
* return err
* }
* exampleCache, err := hpc.NewCache(ctx, "example", &hpc.CacheArgs{
* Name: pulumi.String("examplehpccache"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* CacheSizeInGb: pulumi.Int(3072),
* SubnetId: exampleHpc.ID(),
* SkuName: pulumi.String("Standard_2G"),
* })
* if err != nil {
* return err
* }
* exampleVm, err := network.NewSubnet(ctx, "example_vm", &network.SubnetArgs{
* Name: pulumi.String("examplesubnetvm"),
* ResourceGroupName: example.Name,
* VirtualNetworkName: exampleVirtualNetwork.Name,
* AddressPrefixes: pulumi.StringArray{
* pulumi.String("10.0.2.0/24"),
* },
* })
* if err != nil {
* return err
* }
* exampleNetworkInterface, err := network.NewNetworkInterface(ctx, "example", &network.NetworkInterfaceArgs{
* Name: pulumi.String("examplenic"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
* &network.NetworkInterfaceIpConfigurationArgs{
* Name: pulumi.String("internal"),
* SubnetId: exampleVm.ID(),
* PrivateIpAddressAllocation: pulumi.String("Dynamic"),
* },
* },
* })
* if err != nil {
* return err
* }
* customData := `#!/bin/bash
* sudo -i
* apt-get install -y nfs-kernel-server
* mkdir -p /export/a/1
* mkdir -p /export/a/2
* mkdir -p /export/b
* cat << EOF > /etc/exports
* /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
* /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
* EOF
* systemctl start nfs-server
* exportfs -arv
* `
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: "~/.ssh/id_rsa.pub",
* }, nil)
* if err != nil {
* return err
* }
* invokeBase64encode1, err := std.Base64encode(ctx, &std.Base64encodeArgs{
* Input: customData,
* }, nil)
* if err != nil {
* return err
* }
* exampleLinuxVirtualMachine, err := compute.NewLinuxVirtualMachine(ctx, "example", &compute.LinuxVirtualMachineArgs{
* Name: pulumi.String("examplevm"),
* ResourceGroupName: example.Name,
* Location: example.Location,
* Size: pulumi.String("Standard_F2"),
* AdminUsername: pulumi.String("adminuser"),
* NetworkInterfaceIds: pulumi.StringArray{
* exampleNetworkInterface.ID(),
* },
* AdminSshKeys: compute.LinuxVirtualMachineAdminSshKeyArray{
* &compute.LinuxVirtualMachineAdminSshKeyArgs{
* Username: pulumi.String("adminuser"),
* PublicKey: pulumi.String(invokeFile.Result),
* },
* },
* OsDisk: &compute.LinuxVirtualMachineOsDiskArgs{
* Caching: pulumi.String("ReadWrite"),
* StorageAccountType: pulumi.String("Standard_LRS"),
* },
* SourceImageReference: &compute.LinuxVirtualMachineSourceImageReferenceArgs{
* Publisher: pulumi.String("Canonical"),
* Offer: pulumi.String("0001-com-ubuntu-server-jammy"),
* Sku: pulumi.String("22_04-lts"),
* Version: pulumi.String("latest"),
* },
* CustomData: pulumi.String(invokeBase64encode1.Result),
* })
* if err != nil {
* return err
* }
* _, err = hpc.NewCacheNfsTarget(ctx, "example", &hpc.CacheNfsTargetArgs{
* Name: pulumi.String("examplehpcnfstarget"),
* ResourceGroupName: example.Name,
* CacheName: exampleCache.Name,
* TargetHostName: exampleLinuxVirtualMachine.PrivateIpAddress,
* UsageModel: pulumi.String("READ_HEAVY_INFREQ"),
* NamespaceJunctions: hpc.CacheNfsTargetNamespaceJunctionArray{
* &hpc.CacheNfsTargetNamespaceJunctionArgs{
* NamespacePath: pulumi.String("/nfs/a1"),
* NfsExport: pulumi.String("/export/a"),
* TargetPath: pulumi.String("1"),
* },
* &hpc.CacheNfsTargetNamespaceJunctionArgs{
* NamespacePath: pulumi.String("/nfs/b"),
* NfsExport: pulumi.String("/export/b"),
* },
* },
* })
* 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.hpc.Cache;
* import com.pulumi.azure.hpc.CacheArgs;
* import com.pulumi.azure.network.NetworkInterface;
* import com.pulumi.azure.network.NetworkInterfaceArgs;
* import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
* import com.pulumi.azure.compute.LinuxVirtualMachine;
* import com.pulumi.azure.compute.LinuxVirtualMachineArgs;
* import com.pulumi.azure.compute.inputs.LinuxVirtualMachineAdminSshKeyArgs;
* import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs;
* import com.pulumi.azure.compute.inputs.LinuxVirtualMachineSourceImageReferenceArgs;
* import com.pulumi.azure.hpc.CacheNfsTarget;
* import com.pulumi.azure.hpc.CacheNfsTargetArgs;
* import com.pulumi.azure.hpc.inputs.CacheNfsTargetNamespaceJunctionArgs;
* 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("examplevn")
* .addressSpaces("10.0.0.0/16")
* .location(example.location())
* .resourceGroupName(example.name())
* .build());
* var exampleHpc = new Subnet("exampleHpc", SubnetArgs.builder()
* .name("examplesubnethpc")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("10.0.1.0/24")
* .build());
* var exampleCache = new Cache("exampleCache", CacheArgs.builder()
* .name("examplehpccache")
* .resourceGroupName(example.name())
* .location(example.location())
* .cacheSizeInGb(3072)
* .subnetId(exampleHpc.id())
* .skuName("Standard_2G")
* .build());
* var exampleVm = new Subnet("exampleVm", SubnetArgs.builder()
* .name("examplesubnetvm")
* .resourceGroupName(example.name())
* .virtualNetworkName(exampleVirtualNetwork.name())
* .addressPrefixes("10.0.2.0/24")
* .build());
* var exampleNetworkInterface = new NetworkInterface("exampleNetworkInterface", NetworkInterfaceArgs.builder()
* .name("examplenic")
* .location(example.location())
* .resourceGroupName(example.name())
* .ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
* .name("internal")
* .subnetId(exampleVm.id())
* .privateIpAddressAllocation("Dynamic")
* .build())
* .build());
* final var customData = """
* #!/bin/bash
* sudo -i
* apt-get install -y nfs-kernel-server
* mkdir -p /export/a/1
* mkdir -p /export/a/2
* mkdir -p /export/b
* cat << EOF > /etc/exports
* /export/a *(rw,fsid=0,insecure,no_subtree_check,async)
* /export/b *(rw,fsid=0,insecure,no_subtree_check,async)
* EOF
* systemctl start nfs-server
* exportfs -arv
* """;
* var exampleLinuxVirtualMachine = new LinuxVirtualMachine("exampleLinuxVirtualMachine", LinuxVirtualMachineArgs.builder()
* .name("examplevm")
* .resourceGroupName(example.name())
* .location(example.location())
* .size("Standard_F2")
* .adminUsername("adminuser")
* .networkInterfaceIds(exampleNetworkInterface.id())
* .adminSshKeys(LinuxVirtualMachineAdminSshKeyArgs.builder()
* .username("adminuser")
* .publicKey(StdFunctions.file(FileArgs.builder()
* .input("~/.ssh/id_rsa.pub")
* .build()).result())
* .build())
* .osDisk(LinuxVirtualMachineOsDiskArgs.builder()
* .caching("ReadWrite")
* .storageAccountType("Standard_LRS")
* .build())
* .sourceImageReference(LinuxVirtualMachineSourceImageReferenceArgs.builder()
* .publisher("Canonical")
* .offer("0001-com-ubuntu-server-jammy")
* .sku("22_04-lts")
* .version("latest")
* .build())
* .customData(StdFunctions.base64encode(Base64encodeArgs.builder()
* .input(customData)
* .build()).result())
* .build());
* var exampleCacheNfsTarget = new CacheNfsTarget("exampleCacheNfsTarget", CacheNfsTargetArgs.builder()
* .name("examplehpcnfstarget")
* .resourceGroupName(example.name())
* .cacheName(exampleCache.name())
* .targetHostName(exampleLinuxVirtualMachine.privateIpAddress())
* .usageModel("READ_HEAVY_INFREQ")
* .namespaceJunctions(
* CacheNfsTargetNamespaceJunctionArgs.builder()
* .namespacePath("/nfs/a1")
* .nfsExport("/export/a")
* .targetPath("1")
* .build(),
* CacheNfsTargetNamespaceJunctionArgs.builder()
* .namespacePath("/nfs/b")
* .nfsExport("/export/b")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleVirtualNetwork:
* type: azure:network:VirtualNetwork
* name: example
* properties:
* name: examplevn
* addressSpaces:
* - 10.0.0.0/16
* location: ${example.location}
* resourceGroupName: ${example.name}
* exampleHpc:
* type: azure:network:Subnet
* name: example_hpc
* properties:
* name: examplesubnethpc
* resourceGroupName: ${example.name}
* virtualNetworkName: ${exampleVirtualNetwork.name}
* addressPrefixes:
* - 10.0.1.0/24
* exampleCache:
* type: azure:hpc:Cache
* name: example
* properties:
* name: examplehpccache
* resourceGroupName: ${example.name}
* location: ${example.location}
* cacheSizeInGb: 3072
* subnetId: ${exampleHpc.id}
* skuName: Standard_2G
* exampleVm:
* type: azure:network:Subnet
* name: example_vm
* properties:
* name: examplesubnetvm
* resourceGroupName: ${example.name}
* virtualNetworkName: ${exampleVirtualNetwork.name}
* addressPrefixes:
* - 10.0.2.0/24
* exampleNetworkInterface:
* type: azure:network:NetworkInterface
* name: example
* properties:
* name: examplenic
* location: ${example.location}
* resourceGroupName: ${example.name}
* ipConfigurations:
* - name: internal
* subnetId: ${exampleVm.id}
* privateIpAddressAllocation: Dynamic
* exampleLinuxVirtualMachine:
* type: azure:compute:LinuxVirtualMachine
* name: example
* properties:
* name: examplevm
* resourceGroupName: ${example.name}
* location: ${example.location}
* size: Standard_F2
* adminUsername: adminuser
* networkInterfaceIds:
* - ${exampleNetworkInterface.id}
* adminSshKeys:
* - username: adminuser
* publicKey:
* fn::invoke:
* Function: std:file
* Arguments:
* input: ~/.ssh/id_rsa.pub
* Return: result
* osDisk:
* caching: ReadWrite
* storageAccountType: Standard_LRS
* sourceImageReference:
* publisher: Canonical
* offer: 0001-com-ubuntu-server-jammy
* sku: 22_04-lts
* version: latest
* customData:
* fn::invoke:
* Function: std:base64encode
* Arguments:
* input: ${customData}
* Return: result
* exampleCacheNfsTarget:
* type: azure:hpc:CacheNfsTarget
* name: example
* properties:
* name: examplehpcnfstarget
* resourceGroupName: ${example.name}
* cacheName: ${exampleCache.name}
* targetHostName: ${exampleLinuxVirtualMachine.privateIpAddress}
* usageModel: READ_HEAVY_INFREQ
* namespaceJunctions:
* - namespacePath: /nfs/a1
* nfsExport: /export/a
* targetPath: '1'
* - namespacePath: /nfs/b
* nfsExport: /export/b
* variables:
* customData: "#!/bin/bash\nsudo -i \napt-get install -y nfs-kernel-server\nmkdir -p /export/a/1\nmkdir -p /export/a/2\nmkdir -p /export/b\ncat << EOF > /etc/exports\n/export/a *(rw,fsid=0,insecure,no_subtree_check,async)\n/export/b *(rw,fsid=0,insecure,no_subtree_check,async)\nEOF\nsystemctl start nfs-server\nexportfs -arv\n"
* ```
*
* ## Import
* NFS Target within a HPC Cache can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:hpc/cacheNfsTarget:CacheNfsTarget example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.StorageCache/caches/cache1/storageTargets/target1
* ```
* @property cacheName The name HPC Cache, which the HPC Cache NFS Target will be added to. Changing this forces a new resource to be created.
* @property name The name of the HPC Cache NFS Target. Changing this forces a new resource to be created.
* @property namespaceJunctions Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
* @property resourceGroupName The name of the Resource Group in which to create the HPC Cache NFS Target. Changing this forces a new resource to be created.
* @property targetHostName The IP address or fully qualified domain name (FQDN) of the HPC Cache NFS target. Changing this forces a new resource to be created.
* @property usageModel The type of usage of the HPC Cache NFS Target. Possible values are: `READ_HEAVY_INFREQ`, `READ_HEAVY_CHECK_180`, `READ_ONLY`, `READ_WRITE`, `WRITE_WORKLOAD_15`, `WRITE_AROUND`, `WRITE_WORKLOAD_CHECK_30`, `WRITE_WORKLOAD_CHECK_60` and `WRITE_WORKLOAD_CLOUDWS`.
* @property verificationTimerInSeconds The amount of time the cache waits before it checks the back-end storage for file updates. Possible values are between `1` and `31536000`.
* @property writeBackTimerInSeconds The amount of time the cache waits after the last file change before it copies the changed file to back-end storage. Possible values are between `1` and `31536000`.
*/
public data class CacheNfsTargetArgs(
public val cacheName: Output? = null,
public val name: Output? = null,
public val namespaceJunctions: Output>? = null,
public val resourceGroupName: Output? = null,
public val targetHostName: Output? = null,
public val usageModel: Output? = null,
public val verificationTimerInSeconds: Output? = null,
public val writeBackTimerInSeconds: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.hpc.CacheNfsTargetArgs =
com.pulumi.azure.hpc.CacheNfsTargetArgs.builder()
.cacheName(cacheName?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.namespaceJunctions(
namespaceJunctions?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.targetHostName(targetHostName?.applyValue({ args0 -> args0 }))
.usageModel(usageModel?.applyValue({ args0 -> args0 }))
.verificationTimerInSeconds(verificationTimerInSeconds?.applyValue({ args0 -> args0 }))
.writeBackTimerInSeconds(writeBackTimerInSeconds?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [CacheNfsTargetArgs].
*/
@PulumiTagMarker
public class CacheNfsTargetArgsBuilder internal constructor() {
private var cacheName: Output? = null
private var name: Output? = null
private var namespaceJunctions: Output>? = null
private var resourceGroupName: Output? = null
private var targetHostName: Output? = null
private var usageModel: Output? = null
private var verificationTimerInSeconds: Output? = null
private var writeBackTimerInSeconds: Output? = null
/**
* @param value The name HPC Cache, which the HPC Cache NFS Target will be added to. Changing this forces a new resource to be created.
*/
@JvmName("alrkesbxjthyordp")
public suspend fun cacheName(`value`: Output) {
this.cacheName = value
}
/**
* @param value The name of the HPC Cache NFS Target. Changing this forces a new resource to be created.
*/
@JvmName("nrywibshdjuysudp")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("uoufewwkpgqaajqy")
public suspend fun namespaceJunctions(`value`: Output>) {
this.namespaceJunctions = value
}
@JvmName("tccyvnfurkofjeoq")
public suspend fun namespaceJunctions(vararg values: Output) {
this.namespaceJunctions = Output.all(values.asList())
}
/**
* @param values Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("jinffuqbiswppuva")
public suspend fun namespaceJunctions(values: List>) {
this.namespaceJunctions = Output.all(values)
}
/**
* @param value The name of the Resource Group in which to create the HPC Cache NFS Target. Changing this forces a new resource to be created.
*/
@JvmName("cjqmeaxlmhrrlyuj")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The IP address or fully qualified domain name (FQDN) of the HPC Cache NFS target. Changing this forces a new resource to be created.
*/
@JvmName("hfjauuhudtpxktyj")
public suspend fun targetHostName(`value`: Output) {
this.targetHostName = value
}
/**
* @param value The type of usage of the HPC Cache NFS Target. Possible values are: `READ_HEAVY_INFREQ`, `READ_HEAVY_CHECK_180`, `READ_ONLY`, `READ_WRITE`, `WRITE_WORKLOAD_15`, `WRITE_AROUND`, `WRITE_WORKLOAD_CHECK_30`, `WRITE_WORKLOAD_CHECK_60` and `WRITE_WORKLOAD_CLOUDWS`.
*/
@JvmName("dvhtcwyurqdyfanp")
public suspend fun usageModel(`value`: Output) {
this.usageModel = value
}
/**
* @param value The amount of time the cache waits before it checks the back-end storage for file updates. Possible values are between `1` and `31536000`.
*/
@JvmName("wdkprbqknfsrbmop")
public suspend fun verificationTimerInSeconds(`value`: Output) {
this.verificationTimerInSeconds = value
}
/**
* @param value The amount of time the cache waits after the last file change before it copies the changed file to back-end storage. Possible values are between `1` and `31536000`.
*/
@JvmName("qcbkywtipywppjmw")
public suspend fun writeBackTimerInSeconds(`value`: Output) {
this.writeBackTimerInSeconds = value
}
/**
* @param value The name HPC Cache, which the HPC Cache NFS Target will be added to. Changing this forces a new resource to be created.
*/
@JvmName("jjdhuouxwdfrggle")
public suspend fun cacheName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.cacheName = mapped
}
/**
* @param value The name of the HPC Cache NFS Target. Changing this forces a new resource to be created.
*/
@JvmName("pxpvyhaijohlgxgo")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("cdywrsefbtbyysey")
public suspend fun namespaceJunctions(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.namespaceJunctions = mapped
}
/**
* @param argument Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("elgjvvtxwifqjnel")
public suspend fun namespaceJunctions(argument: List Unit>) {
val toBeMapped = argument.toList().map {
CacheNfsTargetNamespaceJunctionArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.namespaceJunctions = mapped
}
/**
* @param argument Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("sntofmgjwrcofyla")
public suspend fun namespaceJunctions(vararg argument: suspend CacheNfsTargetNamespaceJunctionArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
CacheNfsTargetNamespaceJunctionArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.namespaceJunctions = mapped
}
/**
* @param argument Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("brlexkqnrhrpcnlr")
public suspend fun namespaceJunctions(argument: suspend CacheNfsTargetNamespaceJunctionArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
CacheNfsTargetNamespaceJunctionArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.namespaceJunctions = mapped
}
/**
* @param values Can be specified multiple times to define multiple `namespace_junction`. Each `namespace_junction` block supports fields documented below.
*/
@JvmName("jhbdegsfmqowjhwr")
public suspend fun namespaceJunctions(vararg values: CacheNfsTargetNamespaceJunctionArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.namespaceJunctions = mapped
}
/**
* @param value The name of the Resource Group in which to create the HPC Cache NFS Target. Changing this forces a new resource to be created.
*/
@JvmName("kdmdklljdrmmitvl")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The IP address or fully qualified domain name (FQDN) of the HPC Cache NFS target. Changing this forces a new resource to be created.
*/
@JvmName("vuxitgmpuwcnwdyt")
public suspend fun targetHostName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.targetHostName = mapped
}
/**
* @param value The type of usage of the HPC Cache NFS Target. Possible values are: `READ_HEAVY_INFREQ`, `READ_HEAVY_CHECK_180`, `READ_ONLY`, `READ_WRITE`, `WRITE_WORKLOAD_15`, `WRITE_AROUND`, `WRITE_WORKLOAD_CHECK_30`, `WRITE_WORKLOAD_CHECK_60` and `WRITE_WORKLOAD_CLOUDWS`.
*/
@JvmName("fquqjgrajkodnaje")
public suspend fun usageModel(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.usageModel = mapped
}
/**
* @param value The amount of time the cache waits before it checks the back-end storage for file updates. Possible values are between `1` and `31536000`.
*/
@JvmName("gvriwkyqnagwctby")
public suspend fun verificationTimerInSeconds(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.verificationTimerInSeconds = mapped
}
/**
* @param value The amount of time the cache waits after the last file change before it copies the changed file to back-end storage. Possible values are between `1` and `31536000`.
*/
@JvmName("nwsujigmpeddgonl")
public suspend fun writeBackTimerInSeconds(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.writeBackTimerInSeconds = mapped
}
internal fun build(): CacheNfsTargetArgs = CacheNfsTargetArgs(
cacheName = cacheName,
name = name,
namespaceJunctions = namespaceJunctions,
resourceGroupName = resourceGroupName,
targetHostName = targetHostName,
usageModel = usageModel,
verificationTimerInSeconds = verificationTimerInSeconds,
writeBackTimerInSeconds = writeBackTimerInSeconds,
)
}