CacheArgs

data class CacheArgs(val cacheName: Output<String>? = null, val cacheSizeGB: Output<Int>? = null, val directoryServicesSettings: Output<CacheDirectorySettingsArgs>? = null, val encryptionSettings: Output<CacheEncryptionSettingsArgs>? = null, val identity: Output<CacheIdentityArgs>? = null, val location: Output<String>? = null, val networkSettings: Output<CacheNetworkSettingsArgs>? = null, val resourceGroupName: Output<String>? = null, val securitySettings: Output<CacheSecuritySettingsArgs>? = null, val sku: Output<CacheSkuArgs>? = null, val subnet: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val upgradeSettings: Output<CacheUpgradeSettingsArgs>? = null, val zones: Output<List<String>>? = null) : ConvertibleToJava<CacheArgs>

A cache instance. Follows Azure Resource Manager standards: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md Uses Azure REST API version 2024-03-01. In version 2.x of the Azure Native provider, it used API version 2023-05-01. Other available API versions: 2023-05-01, 2023-11-01-preview, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native storagecache [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Caches_CreateOrUpdate_ldap_only

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var cache = new AzureNative.StorageCache.Cache("cache", new()
{
CacheName = "sc1",
CacheSizeGB = 3072,
DirectoryServicesSettings = new AzureNative.StorageCache.Inputs.CacheDirectorySettingsArgs
{
UsernameDownload = new AzureNative.StorageCache.Inputs.CacheUsernameDownloadSettingsArgs
{
Credentials = new AzureNative.StorageCache.Inputs.CacheUsernameDownloadSettingsCredentialsArgs
{
BindDn = "cn=ldapadmin,dc=contosoad,dc=contoso,dc=local",
BindPassword = "<bindPassword>",
},
ExtendedGroups = true,
LdapBaseDN = "dc=contosoad,dc=contoso,dc=local",
LdapServer = "192.0.2.12",
UsernameSource = AzureNative.StorageCache.UsernameSource.LDAP,
},
},
EncryptionSettings = new AzureNative.StorageCache.Inputs.CacheEncryptionSettingsArgs
{
KeyEncryptionKey = new AzureNative.StorageCache.Inputs.KeyVaultKeyReferenceArgs
{
KeyUrl = "https://keyvault-cmk.vault.azure.net/keys/key2048/test",
SourceVault = new AzureNative.StorageCache.Inputs.KeyVaultKeyReferenceSourceVaultArgs
{
Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk",
},
},
},
Location = "westus",
ResourceGroupName = "scgroup",
SecuritySettings = new AzureNative.StorageCache.Inputs.CacheSecuritySettingsArgs
{
AccessPolicies = new[]
{
new AzureNative.StorageCache.Inputs.NfsAccessPolicyArgs
{
AccessRules = new[]
{
new AzureNative.StorageCache.Inputs.NfsAccessRuleArgs
{
Access = AzureNative.StorageCache.NfsAccessRuleAccess.Rw,
RootSquash = false,
Scope = AzureNative.StorageCache.NfsAccessRuleScope.@Default,
SubmountAccess = true,
Suid = false,
},
},
Name = "default",
},
},
},
Sku = new AzureNative.StorageCache.Inputs.CacheSkuArgs
{
Name = "Standard_2G",
},
Subnet = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1",
Tags =
{
{ "Dept", "Contoso" },
},
UpgradeSettings = new AzureNative.StorageCache.Inputs.CacheUpgradeSettingsArgs
{
ScheduledTime = "2022-04-26T18:25:43.511Z",
UpgradeScheduleEnabled = true,
},
});
});
package main
import (
storagecache "github.com/pulumi/pulumi-azure-native-sdk/storagecache/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storagecache.NewCache(ctx, "cache", &storagecache.CacheArgs{
CacheName: pulumi.String("sc1"),
CacheSizeGB: pulumi.Int(3072),
DirectoryServicesSettings: &storagecache.CacheDirectorySettingsArgs{
UsernameDownload: &storagecache.CacheUsernameDownloadSettingsArgs{
Credentials: &storagecache.CacheUsernameDownloadSettingsCredentialsArgs{
BindDn: pulumi.String("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local"),
BindPassword: pulumi.String("<bindPassword>"),
},
ExtendedGroups: pulumi.Bool(true),
LdapBaseDN: pulumi.String("dc=contosoad,dc=contoso,dc=local"),
LdapServer: pulumi.String("192.0.2.12"),
UsernameSource: pulumi.String(storagecache.UsernameSourceLDAP),
},
},
EncryptionSettings: &storagecache.CacheEncryptionSettingsArgs{
KeyEncryptionKey: &storagecache.KeyVaultKeyReferenceArgs{
KeyUrl: pulumi.String("https://keyvault-cmk.vault.azure.net/keys/key2048/test"),
SourceVault: &storagecache.KeyVaultKeyReferenceSourceVaultArgs{
Id: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk"),
},
},
},
Location: pulumi.String("westus"),
ResourceGroupName: pulumi.String("scgroup"),
SecuritySettings: &storagecache.CacheSecuritySettingsArgs{
AccessPolicies: storagecache.NfsAccessPolicyArray{
&storagecache.NfsAccessPolicyArgs{
AccessRules: storagecache.NfsAccessRuleArray{
&storagecache.NfsAccessRuleArgs{
Access: pulumi.String(storagecache.NfsAccessRuleAccessRw),
RootSquash: pulumi.Bool(false),
Scope: pulumi.String(storagecache.NfsAccessRuleScopeDefault),
SubmountAccess: pulumi.Bool(true),
Suid: pulumi.Bool(false),
},
},
Name: pulumi.String("default"),
},
},
},
Sku: &storagecache.CacheSkuArgs{
Name: pulumi.String("Standard_2G"),
},
Subnet: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1"),
Tags: pulumi.StringMap{
"Dept": pulumi.String("Contoso"),
},
UpgradeSettings: &storagecache.CacheUpgradeSettingsArgs{
ScheduledTime: pulumi.String("2022-04-26T18:25:43.511Z"),
UpgradeScheduleEnabled: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storagecache.Cache;
import com.pulumi.azurenative.storagecache.CacheArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheDirectorySettingsArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheUsernameDownloadSettingsArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheUsernameDownloadSettingsCredentialsArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheEncryptionSettingsArgs;
import com.pulumi.azurenative.storagecache.inputs.KeyVaultKeyReferenceArgs;
import com.pulumi.azurenative.storagecache.inputs.KeyVaultKeyReferenceSourceVaultArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheSecuritySettingsArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheSkuArgs;
import com.pulumi.azurenative.storagecache.inputs.CacheUpgradeSettingsArgs;
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 cache = new Cache("cache", CacheArgs.builder()
.cacheName("sc1")
.cacheSizeGB(3072)
.directoryServicesSettings(CacheDirectorySettingsArgs.builder()
.usernameDownload(CacheUsernameDownloadSettingsArgs.builder()
.credentials(CacheUsernameDownloadSettingsCredentialsArgs.builder()
.bindDn("cn=ldapadmin,dc=contosoad,dc=contoso,dc=local")
.bindPassword("<bindPassword>")
.build())
.extendedGroups(true)
.ldapBaseDN("dc=contosoad,dc=contoso,dc=local")
.ldapServer("192.0.2.12")
.usernameSource("LDAP")
.build())
.build())
.encryptionSettings(CacheEncryptionSettingsArgs.builder()
.keyEncryptionKey(KeyVaultKeyReferenceArgs.builder()
.keyUrl("https://keyvault-cmk.vault.azure.net/keys/key2048/test")
.sourceVault(KeyVaultKeyReferenceSourceVaultArgs.builder()
.id("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.KeyVault/vaults/keyvault-cmk")
.build())
.build())
.build())
.location("westus")
.resourceGroupName("scgroup")
.securitySettings(CacheSecuritySettingsArgs.builder()
.accessPolicies(NfsAccessPolicyArgs.builder()
.accessRules(NfsAccessRuleArgs.builder()
.access("rw")
.rootSquash(false)
.scope("default")
.submountAccess(true)
.suid(false)
.build())
.name("default")
.build())
.build())
.sku(CacheSkuArgs.builder()
.name("Standard_2G")
.build())
.subnet("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/scgroup/providers/Microsoft.Network/virtualNetworks/scvnet/subnets/sub1")
.tags(Map.of("Dept", "Contoso"))
.upgradeSettings(CacheUpgradeSettingsArgs.builder()
.scheduledTime("2022-04-26T18:25:43.511Z")
.upgradeScheduleEnabled(true)
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:storagecache:Cache sc1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StorageCache/caches/{cacheName}

Constructors

Link copied to clipboard
constructor(cacheName: Output<String>? = null, cacheSizeGB: Output<Int>? = null, directoryServicesSettings: Output<CacheDirectorySettingsArgs>? = null, encryptionSettings: Output<CacheEncryptionSettingsArgs>? = null, identity: Output<CacheIdentityArgs>? = null, location: Output<String>? = null, networkSettings: Output<CacheNetworkSettingsArgs>? = null, resourceGroupName: Output<String>? = null, securitySettings: Output<CacheSecuritySettingsArgs>? = null, sku: Output<CacheSkuArgs>? = null, subnet: Output<String>? = null, tags: Output<Map<String, String>>? = null, upgradeSettings: Output<CacheUpgradeSettingsArgs>? = null, zones: Output<List<String>>? = null)

Properties

Link copied to clipboard
val cacheName: Output<String>? = null

Name of cache. Length of name must not be greater than 80 and chars must be from the -0-9a-zA-Z_ char class.

Link copied to clipboard
val cacheSizeGB: Output<Int>? = null

The size of this Cache, in GB.

Link copied to clipboard

Specifies Directory Services settings of the cache.

Link copied to clipboard

Specifies encryption settings of the cache.

Link copied to clipboard
val identity: Output<CacheIdentityArgs>? = null

The identity of the cache, if configured.

Link copied to clipboard
val location: Output<String>? = null

Region name string.

Link copied to clipboard

Specifies network settings of the cache.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard

Specifies security settings of the cache.

Link copied to clipboard
val sku: Output<CacheSkuArgs>? = null

SKU for the cache.

Link copied to clipboard
val subnet: Output<String>? = null

Subnet used for the cache.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Resource tags.

Link copied to clipboard

Upgrade settings of the cache.

Link copied to clipboard
val zones: Output<List<String>>? = null

Availability zones for resources. This field should only contain a single element in the array.

Functions

Link copied to clipboard
open override fun toJava(): CacheArgs