azure-native.cache.AccessPolicy
Explore with Pulumi AI
Response to get/put access policy. Azure REST API version: 2023-05-01-preview.
Other available API versions: 2023-08-01, 2024-03-01, 2024-04-01-preview, 2024-11-01.
Example Usage
RedisCacheAccessPolicyCreateUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var accessPolicy = new AzureNative.Cache.AccessPolicy("accessPolicy", new()
{
AccessPolicyName = "accessPolicy1",
CacheName = "cache1",
Permissions = "+get +hget",
ResourceGroupName = "rg1",
});
});
package main
import (
cache "github.com/pulumi/pulumi-azure-native-sdk/cache/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cache.NewAccessPolicy(ctx, "accessPolicy", &cache.AccessPolicyArgs{
AccessPolicyName: pulumi.String("accessPolicy1"),
CacheName: pulumi.String("cache1"),
Permissions: pulumi.String("+get +hget"),
ResourceGroupName: pulumi.String("rg1"),
})
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.cache.AccessPolicy;
import com.pulumi.azurenative.cache.AccessPolicyArgs;
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 accessPolicy = new AccessPolicy("accessPolicy", AccessPolicyArgs.builder()
.accessPolicyName("accessPolicy1")
.cacheName("cache1")
.permissions("+get +hget")
.resourceGroupName("rg1")
.build());
}
}
import pulumi
import pulumi_azure_native as azure_native
access_policy = azure_native.cache.AccessPolicy("accessPolicy",
access_policy_name="accessPolicy1",
cache_name="cache1",
permissions="+get +hget",
resource_group_name="rg1")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const accessPolicy = new azure_native.cache.AccessPolicy("accessPolicy", {
accessPolicyName: "accessPolicy1",
cacheName: "cache1",
permissions: "+get +hget",
resourceGroupName: "rg1",
});
resources:
accessPolicy:
type: azure-native:cache:AccessPolicy
properties:
accessPolicyName: accessPolicy1
cacheName: cache1
permissions: +get +hget
resourceGroupName: rg1
Create AccessPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccessPolicy(name: string, args: AccessPolicyArgs, opts?: CustomResourceOptions);
@overload
def AccessPolicy(resource_name: str,
args: AccessPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccessPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
cache_name: Optional[str] = None,
permissions: Optional[str] = None,
resource_group_name: Optional[str] = None,
access_policy_name: Optional[str] = None)
func NewAccessPolicy(ctx *Context, name string, args AccessPolicyArgs, opts ...ResourceOption) (*AccessPolicy, error)
public AccessPolicy(string name, AccessPolicyArgs args, CustomResourceOptions? opts = null)
public AccessPolicy(String name, AccessPolicyArgs args)
public AccessPolicy(String name, AccessPolicyArgs args, CustomResourceOptions options)
type: azure-native:cache:AccessPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args AccessPolicyArgs
- 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 AccessPolicyArgs
- 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 AccessPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccessPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccessPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var accessPolicyResource = new AzureNative.Cache.AccessPolicy("accessPolicyResource", new()
{
CacheName = "string",
Permissions = "string",
ResourceGroupName = "string",
AccessPolicyName = "string",
});
example, err := cache.NewAccessPolicy(ctx, "accessPolicyResource", &cache.AccessPolicyArgs{
CacheName: pulumi.String("string"),
Permissions: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
AccessPolicyName: pulumi.String("string"),
})
var accessPolicyResource = new AccessPolicy("accessPolicyResource", AccessPolicyArgs.builder()
.cacheName("string")
.permissions("string")
.resourceGroupName("string")
.accessPolicyName("string")
.build());
access_policy_resource = azure_native.cache.AccessPolicy("accessPolicyResource",
cache_name="string",
permissions="string",
resource_group_name="string",
access_policy_name="string")
const accessPolicyResource = new azure_native.cache.AccessPolicy("accessPolicyResource", {
cacheName: "string",
permissions: "string",
resourceGroupName: "string",
accessPolicyName: "string",
});
type: azure-native:cache:AccessPolicy
properties:
accessPolicyName: string
cacheName: string
permissions: string
resourceGroupName: string
AccessPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The AccessPolicy resource accepts the following input properties:
- Cache
Name string - The name of the Redis cache.
- Permissions string
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Access
Policy stringName - The name of the access policy that is being added to the Redis cache.
- Cache
Name string - The name of the Redis cache.
- Permissions string
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Access
Policy stringName - The name of the access policy that is being added to the Redis cache.
- cache
Name String - The name of the Redis cache.
- permissions String
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- access
Policy StringName - The name of the access policy that is being added to the Redis cache.
- cache
Name string - The name of the Redis cache.
- permissions string
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- access
Policy stringName - The name of the access policy that is being added to the Redis cache.
- cache_
name str - The name of the Redis cache.
- permissions str
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- access_
policy_ strname - The name of the access policy that is being added to the Redis cache.
- cache
Name String - The name of the Redis cache.
- permissions String
- Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- access
Policy StringName - The name of the access policy that is being added to the Redis cache.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccessPolicy resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- Provisioning
State string - Provisioning state of access policy
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- Provisioning
State string - Provisioning state of access policy
- Type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- provisioning
State String - Provisioning state of access policy
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource
- provisioning
State string - Provisioning state of access policy
- type string
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource
- provisioning_
state str - Provisioning state of access policy
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- provisioning
State String - Provisioning state of access policy
- type String
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:cache:AccessPolicy accessPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0