Cache

class Cache : KotlinCustomResource

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/v2"
"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}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

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

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

Health of the cache.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The identity of the cache, if configured.

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

Region name string.

Link copied to clipboard
val mountAddresses: Output<List<String>>

Array of IPv4 addresses that can be used by clients mounting this cache.

Link copied to clipboard
val name: Output<String>

Name of cache.

Link copied to clipboard

Specifies network settings of the cache.

Link copied to clipboard

Specifies the priming jobs defined in the cache.

Link copied to clipboard

ARM provisioning state, see https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#provisioningstate-property

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies security settings of the cache.

Link copied to clipboard
val sku: Output<CacheResponseSku>?

SKU for the cache.

Link copied to clipboard

Specifies the space allocation percentage for each storage target in the cache.

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

Subnet used for the cache.

Link copied to clipboard

The system meta data relating to this resource.

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

Resource tags.

Link copied to clipboard
val type: Output<String>

Type of the cache; Microsoft.StorageCache/Cache

Link copied to clipboard

Upgrade settings of the cache.

Link copied to clipboard

Upgrade status of the cache.

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

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