azure logo
Azure Classic v5.38.0, Mar 21 23

azure.hpc.CacheAccessPolicy

Manages a HPC Cache Access Policy.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
    {
        AddressSpaces = new[]
        {
            "10.0.0.0/16",
        },
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
    });

    var exampleSubnet = new Azure.Network.Subnet("exampleSubnet", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        VirtualNetworkName = exampleVirtualNetwork.Name,
        AddressPrefixes = new[]
        {
            "10.0.1.0/24",
        },
    });

    var exampleCache = new Azure.Hpc.Cache("exampleCache", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Location = exampleResourceGroup.Location,
        CacheSizeInGb = 3072,
        SubnetId = exampleSubnet.Id,
        SkuName = "Standard_2G",
    });

    var exampleCacheAccessPolicy = new Azure.Hpc.CacheAccessPolicy("exampleCacheAccessPolicy", new()
    {
        HpcCacheId = exampleCache.Id,
        AccessRules = new[]
        {
            new Azure.Hpc.Inputs.CacheAccessPolicyAccessRuleArgs
            {
                Scope = "default",
                Access = "rw",
            },
        },
    });

});
package main

import (
	"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/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
			AddressSpaces: pulumi.StringArray{
				pulumi.String("10.0.0.0/16"),
			},
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
		})
		if err != nil {
			return err
		}
		exampleSubnet, err := network.NewSubnet(ctx, "exampleSubnet", &network.SubnetArgs{
			ResourceGroupName:  exampleResourceGroup.Name,
			VirtualNetworkName: exampleVirtualNetwork.Name,
			AddressPrefixes: pulumi.StringArray{
				pulumi.String("10.0.1.0/24"),
			},
		})
		if err != nil {
			return err
		}
		exampleCache, err := hpc.NewCache(ctx, "exampleCache", &hpc.CacheArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Location:          exampleResourceGroup.Location,
			CacheSizeInGb:     pulumi.Int(3072),
			SubnetId:          exampleSubnet.ID(),
			SkuName:           pulumi.String("Standard_2G"),
		})
		if err != nil {
			return err
		}
		_, err = hpc.NewCacheAccessPolicy(ctx, "exampleCacheAccessPolicy", &hpc.CacheAccessPolicyArgs{
			HpcCacheId: exampleCache.ID(),
			AccessRules: hpc.CacheAccessPolicyAccessRuleArray{
				&hpc.CacheAccessPolicyAccessRuleArgs{
					Scope:  pulumi.String("default"),
					Access: pulumi.String("rw"),
				},
			},
		})
		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.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.hpc.CacheAccessPolicy;
import com.pulumi.azure.hpc.CacheAccessPolicyArgs;
import com.pulumi.azure.hpc.inputs.CacheAccessPolicyAccessRuleArgs;
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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
            .addressSpaces("10.0.0.0/16")
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .build());

        var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .virtualNetworkName(exampleVirtualNetwork.name())
            .addressPrefixes("10.0.1.0/24")
            .build());

        var exampleCache = new Cache("exampleCache", CacheArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .location(exampleResourceGroup.location())
            .cacheSizeInGb(3072)
            .subnetId(exampleSubnet.id())
            .skuName("Standard_2G")
            .build());

        var exampleCacheAccessPolicy = new CacheAccessPolicy("exampleCacheAccessPolicy", CacheAccessPolicyArgs.builder()        
            .hpcCacheId(exampleCache.id())
            .accessRules(CacheAccessPolicyAccessRuleArgs.builder()
                .scope("default")
                .access("rw")
                .build())
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
    address_spaces=["10.0.0.0/16"],
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name)
example_subnet = azure.network.Subnet("exampleSubnet",
    resource_group_name=example_resource_group.name,
    virtual_network_name=example_virtual_network.name,
    address_prefixes=["10.0.1.0/24"])
example_cache = azure.hpc.Cache("exampleCache",
    resource_group_name=example_resource_group.name,
    location=example_resource_group.location,
    cache_size_in_gb=3072,
    subnet_id=example_subnet.id,
    sku_name="Standard_2G")
example_cache_access_policy = azure.hpc.CacheAccessPolicy("exampleCacheAccessPolicy",
    hpc_cache_id=example_cache.id,
    access_rules=[azure.hpc.CacheAccessPolicyAccessRuleArgs(
        scope="default",
        access="rw",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
    addressSpaces: ["10.0.0.0/16"],
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
});
const exampleSubnet = new azure.network.Subnet("exampleSubnet", {
    resourceGroupName: exampleResourceGroup.name,
    virtualNetworkName: exampleVirtualNetwork.name,
    addressPrefixes: ["10.0.1.0/24"],
});
const exampleCache = new azure.hpc.Cache("exampleCache", {
    resourceGroupName: exampleResourceGroup.name,
    location: exampleResourceGroup.location,
    cacheSizeInGb: 3072,
    subnetId: exampleSubnet.id,
    skuName: "Standard_2G",
});
const exampleCacheAccessPolicy = new azure.hpc.CacheAccessPolicy("exampleCacheAccessPolicy", {
    hpcCacheId: exampleCache.id,
    accessRules: [{
        scope: "default",
        access: "rw",
    }],
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleVirtualNetwork:
    type: azure:network:VirtualNetwork
    properties:
      addressSpaces:
        - 10.0.0.0/16
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
  exampleSubnet:
    type: azure:network:Subnet
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      virtualNetworkName: ${exampleVirtualNetwork.name}
      addressPrefixes:
        - 10.0.1.0/24
  exampleCache:
    type: azure:hpc:Cache
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      location: ${exampleResourceGroup.location}
      cacheSizeInGb: 3072
      subnetId: ${exampleSubnet.id}
      skuName: Standard_2G
  exampleCacheAccessPolicy:
    type: azure:hpc:CacheAccessPolicy
    properties:
      hpcCacheId: ${exampleCache.id}
      accessRules:
        - scope: default
          access: rw

Create CacheAccessPolicy Resource

new CacheAccessPolicy(name: string, args: CacheAccessPolicyArgs, opts?: CustomResourceOptions);
@overload
def CacheAccessPolicy(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      access_rules: Optional[Sequence[CacheAccessPolicyAccessRuleArgs]] = None,
                      hpc_cache_id: Optional[str] = None,
                      name: Optional[str] = None)
@overload
def CacheAccessPolicy(resource_name: str,
                      args: CacheAccessPolicyArgs,
                      opts: Optional[ResourceOptions] = None)
func NewCacheAccessPolicy(ctx *Context, name string, args CacheAccessPolicyArgs, opts ...ResourceOption) (*CacheAccessPolicy, error)
public CacheAccessPolicy(string name, CacheAccessPolicyArgs args, CustomResourceOptions? opts = null)
public CacheAccessPolicy(String name, CacheAccessPolicyArgs args)
public CacheAccessPolicy(String name, CacheAccessPolicyArgs args, CustomResourceOptions options)
type: azure:hpc:CacheAccessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CacheAccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CacheAccessPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CacheAccessPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CacheAccessPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CacheAccessPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CacheAccessPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CacheAccessPolicy resource accepts the following input properties:

AccessRules List<CacheAccessPolicyAccessRuleArgs>

Up to three access_rule blocks as defined below.

HpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

Name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

AccessRules []CacheAccessPolicyAccessRuleArgs

Up to three access_rule blocks as defined below.

HpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

Name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules List<CacheAccessPolicyAccessRuleArgs>

Up to three access_rule blocks as defined below.

hpcCacheId String

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name String

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules CacheAccessPolicyAccessRuleArgs[]

Up to three access_rule blocks as defined below.

hpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

access_rules Sequence[CacheAccessPolicyAccessRuleArgs]

Up to three access_rule blocks as defined below.

hpc_cache_id str

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name str

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules List<Property Map>

Up to three access_rule blocks as defined below.

hpcCacheId String

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name String

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the CacheAccessPolicy resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing CacheAccessPolicy Resource

Get an existing CacheAccessPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CacheAccessPolicyState, opts?: CustomResourceOptions): CacheAccessPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_rules: Optional[Sequence[CacheAccessPolicyAccessRuleArgs]] = None,
        hpc_cache_id: Optional[str] = None,
        name: Optional[str] = None) -> CacheAccessPolicy
func GetCacheAccessPolicy(ctx *Context, name string, id IDInput, state *CacheAccessPolicyState, opts ...ResourceOption) (*CacheAccessPolicy, error)
public static CacheAccessPolicy Get(string name, Input<string> id, CacheAccessPolicyState? state, CustomResourceOptions? opts = null)
public static CacheAccessPolicy get(String name, Output<String> id, CacheAccessPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessRules List<CacheAccessPolicyAccessRuleArgs>

Up to three access_rule blocks as defined below.

HpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

Name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

AccessRules []CacheAccessPolicyAccessRuleArgs

Up to three access_rule blocks as defined below.

HpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

Name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules List<CacheAccessPolicyAccessRuleArgs>

Up to three access_rule blocks as defined below.

hpcCacheId String

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name String

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules CacheAccessPolicyAccessRuleArgs[]

Up to three access_rule blocks as defined below.

hpcCacheId string

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name string

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

access_rules Sequence[CacheAccessPolicyAccessRuleArgs]

Up to three access_rule blocks as defined below.

hpc_cache_id str

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name str

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

accessRules List<Property Map>

Up to three access_rule blocks as defined below.

hpcCacheId String

The ID of the HPC Cache that this HPC Cache Access Policy resides in. Changing this forces a new HPC Cache Access Policy to be created.

name String

The name which should be used for this HPC Cache Access Policy. Changing this forces a new HPC Cache Access Policy to be created.

Supporting Types

CacheAccessPolicyAccessRule

Access string

The access level for this rule. Possible values are: rw, ro, no.

Scope string

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

AnonymousGid int

The anonymous GID used when root_squash_enabled is true.

AnonymousUid int

The anonymous UID used when root_squash_enabled is true.

Filter string

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

RootSquashEnabled bool

Whether to enable root squash?

SubmountAccessEnabled bool

Whether allow access to subdirectories under the root export?

SuidEnabled bool

Whether SUID is allowed?

Access string

The access level for this rule. Possible values are: rw, ro, no.

Scope string

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

AnonymousGid int

The anonymous GID used when root_squash_enabled is true.

AnonymousUid int

The anonymous UID used when root_squash_enabled is true.

Filter string

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

RootSquashEnabled bool

Whether to enable root squash?

SubmountAccessEnabled bool

Whether allow access to subdirectories under the root export?

SuidEnabled bool

Whether SUID is allowed?

access String

The access level for this rule. Possible values are: rw, ro, no.

scope String

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

anonymousGid Integer

The anonymous GID used when root_squash_enabled is true.

anonymousUid Integer

The anonymous UID used when root_squash_enabled is true.

filter String

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

rootSquashEnabled Boolean

Whether to enable root squash?

submountAccessEnabled Boolean

Whether allow access to subdirectories under the root export?

suidEnabled Boolean

Whether SUID is allowed?

access string

The access level for this rule. Possible values are: rw, ro, no.

scope string

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

anonymousGid number

The anonymous GID used when root_squash_enabled is true.

anonymousUid number

The anonymous UID used when root_squash_enabled is true.

filter string

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

rootSquashEnabled boolean

Whether to enable root squash?

submountAccessEnabled boolean

Whether allow access to subdirectories under the root export?

suidEnabled boolean

Whether SUID is allowed?

access str

The access level for this rule. Possible values are: rw, ro, no.

scope str

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

anonymous_gid int

The anonymous GID used when root_squash_enabled is true.

anonymous_uid int

The anonymous UID used when root_squash_enabled is true.

filter str

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

root_squash_enabled bool

Whether to enable root squash?

submount_access_enabled bool

Whether allow access to subdirectories under the root export?

suid_enabled bool

Whether SUID is allowed?

access String

The access level for this rule. Possible values are: rw, ro, no.

scope String

The scope of this rule. The scope and (potentially) the filter determine which clients match the rule. Possible values are: default, network, host.

anonymousGid Number

The anonymous GID used when root_squash_enabled is true.

anonymousUid Number

The anonymous UID used when root_squash_enabled is true.

filter String

The filter applied to the scope for this rule. The filter's format depends on its scope: default scope matches all clients and has no filter value; network scope takes a CIDR format; host takes an IP address or fully qualified domain name. If a client does not match any filter rule and there is no default rule, access is denied.

rootSquashEnabled Boolean

Whether to enable root squash?

submountAccessEnabled Boolean

Whether allow access to subdirectories under the root export?

suidEnabled Boolean

Whether SUID is allowed?

Import

HPC Cache Access Policies can be imported using the resource id, e.g.

 $ pulumi import azure:hpc/cacheAccessPolicy:CacheAccessPolicy example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.StorageCache/caches/cache1/cacheAccessPolicies/policy1

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.