1. Packages
  2. Azure Classic
  3. API Docs
  4. apimanagement
  5. RedisCache

We recommend using Azure Native.

Azure Classic v5.57.0 published on Tuesday, Nov 28, 2023 by Pulumi

azure.apimanagement.RedisCache

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.57.0 published on Tuesday, Nov 28, 2023 by Pulumi

    Manages a API Management Redis Cache.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
        {
            Location = "West Europe",
        });
    
        var exampleService = new Azure.ApiManagement.Service("exampleService", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            PublisherName = "pub1",
            PublisherEmail = "pub1@email.com",
            SkuName = "Consumption_0",
        });
    
        var exampleCache = new Azure.Redis.Cache("exampleCache", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Capacity = 1,
            Family = "C",
            SkuName = "Basic",
            EnableNonSslPort = false,
            MinimumTlsVersion = "1.2",
            RedisConfiguration = null,
        });
    
        var exampleRedisCache = new Azure.ApiManagement.RedisCache("exampleRedisCache", new()
        {
            ApiManagementId = exampleService.Id,
            ConnectionString = exampleCache.PrimaryConnectionString,
            Description = "Redis cache instances",
            RedisCacheId = exampleCache.Id,
            CacheLocation = "East Us",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/redis"
    	"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
    		}
    		exampleService, err := apimanagement.NewService(ctx, "exampleService", &apimanagement.ServiceArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			PublisherName:     pulumi.String("pub1"),
    			PublisherEmail:    pulumi.String("pub1@email.com"),
    			SkuName:           pulumi.String("Consumption_0"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleCache, err := redis.NewCache(ctx, "exampleCache", &redis.CacheArgs{
    			Location:           exampleResourceGroup.Location,
    			ResourceGroupName:  exampleResourceGroup.Name,
    			Capacity:           pulumi.Int(1),
    			Family:             pulumi.String("C"),
    			SkuName:            pulumi.String("Basic"),
    			EnableNonSslPort:   pulumi.Bool(false),
    			MinimumTlsVersion:  pulumi.String("1.2"),
    			RedisConfiguration: nil,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = apimanagement.NewRedisCache(ctx, "exampleRedisCache", &apimanagement.RedisCacheArgs{
    			ApiManagementId:  exampleService.ID(),
    			ConnectionString: exampleCache.PrimaryConnectionString,
    			Description:      pulumi.String("Redis cache instances"),
    			RedisCacheId:     exampleCache.ID(),
    			CacheLocation:    pulumi.String("East Us"),
    		})
    		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.apimanagement.Service;
    import com.pulumi.azure.apimanagement.ServiceArgs;
    import com.pulumi.azure.redis.Cache;
    import com.pulumi.azure.redis.CacheArgs;
    import com.pulumi.azure.redis.inputs.CacheRedisConfigurationArgs;
    import com.pulumi.azure.apimanagement.RedisCache;
    import com.pulumi.azure.apimanagement.RedisCacheArgs;
    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 exampleService = new Service("exampleService", ServiceArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .publisherName("pub1")
                .publisherEmail("pub1@email.com")
                .skuName("Consumption_0")
                .build());
    
            var exampleCache = new Cache("exampleCache", CacheArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .capacity(1)
                .family("C")
                .skuName("Basic")
                .enableNonSslPort(false)
                .minimumTlsVersion("1.2")
                .redisConfiguration()
                .build());
    
            var exampleRedisCache = new RedisCache("exampleRedisCache", RedisCacheArgs.builder()        
                .apiManagementId(exampleService.id())
                .connectionString(exampleCache.primaryConnectionString())
                .description("Redis cache instances")
                .redisCacheId(exampleCache.id())
                .cacheLocation("East Us")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_service = azure.apimanagement.Service("exampleService",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        publisher_name="pub1",
        publisher_email="pub1@email.com",
        sku_name="Consumption_0")
    example_cache = azure.redis.Cache("exampleCache",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        capacity=1,
        family="C",
        sku_name="Basic",
        enable_non_ssl_port=False,
        minimum_tls_version="1.2",
        redis_configuration=azure.redis.CacheRedisConfigurationArgs())
    example_redis_cache = azure.apimanagement.RedisCache("exampleRedisCache",
        api_management_id=example_service.id,
        connection_string=example_cache.primary_connection_string,
        description="Redis cache instances",
        redis_cache_id=example_cache.id,
        cache_location="East Us")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleService = new azure.apimanagement.Service("exampleService", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        publisherName: "pub1",
        publisherEmail: "pub1@email.com",
        skuName: "Consumption_0",
    });
    const exampleCache = new azure.redis.Cache("exampleCache", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        capacity: 1,
        family: "C",
        skuName: "Basic",
        enableNonSslPort: false,
        minimumTlsVersion: "1.2",
        redisConfiguration: {},
    });
    const exampleRedisCache = new azure.apimanagement.RedisCache("exampleRedisCache", {
        apiManagementId: exampleService.id,
        connectionString: exampleCache.primaryConnectionString,
        description: "Redis cache instances",
        redisCacheId: exampleCache.id,
        cacheLocation: "East Us",
    });
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: West Europe
      exampleService:
        type: azure:apimanagement:Service
        properties:
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          publisherName: pub1
          publisherEmail: pub1@email.com
          skuName: Consumption_0
      exampleCache:
        type: azure:redis:Cache
        properties:
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          capacity: 1
          family: C
          skuName: Basic
          enableNonSslPort: false
          minimumTlsVersion: '1.2'
          redisConfiguration: {}
      exampleRedisCache:
        type: azure:apimanagement:RedisCache
        properties:
          apiManagementId: ${exampleService.id}
          connectionString: ${exampleCache.primaryConnectionString}
          description: Redis cache instances
          redisCacheId: ${exampleCache.id}
          cacheLocation: East Us
    

    Create RedisCache Resource

    new RedisCache(name: string, args: RedisCacheArgs, opts?: CustomResourceOptions);
    @overload
    def RedisCache(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   api_management_id: Optional[str] = None,
                   cache_location: Optional[str] = None,
                   connection_string: Optional[str] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   redis_cache_id: Optional[str] = None)
    @overload
    def RedisCache(resource_name: str,
                   args: RedisCacheArgs,
                   opts: Optional[ResourceOptions] = None)
    func NewRedisCache(ctx *Context, name string, args RedisCacheArgs, opts ...ResourceOption) (*RedisCache, error)
    public RedisCache(string name, RedisCacheArgs args, CustomResourceOptions? opts = null)
    public RedisCache(String name, RedisCacheArgs args)
    public RedisCache(String name, RedisCacheArgs args, CustomResourceOptions options)
    
    type: azure:apimanagement:RedisCache
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args RedisCacheArgs
    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 RedisCacheArgs
    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 RedisCacheArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RedisCacheArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RedisCacheArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    RedisCache 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 RedisCache resource accepts the following input properties:

    ApiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    ConnectionString string

    The connection string to the Cache for Redis.

    CacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    Description string

    The description of the API Management Redis Cache.

    Name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    RedisCacheId string

    The resource ID of the Cache for Redis.

    ApiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    ConnectionString string

    The connection string to the Cache for Redis.

    CacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    Description string

    The description of the API Management Redis Cache.

    Name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    RedisCacheId string

    The resource ID of the Cache for Redis.

    apiManagementId String

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    connectionString String

    The connection string to the Cache for Redis.

    cacheLocation String

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    description String

    The description of the API Management Redis Cache.

    name String

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId String

    The resource ID of the Cache for Redis.

    apiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    connectionString string

    The connection string to the Cache for Redis.

    cacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    description string

    The description of the API Management Redis Cache.

    name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId string

    The resource ID of the Cache for Redis.

    api_management_id str

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    connection_string str

    The connection string to the Cache for Redis.

    cache_location str

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    description str

    The description of the API Management Redis Cache.

    name str

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redis_cache_id str

    The resource ID of the Cache for Redis.

    apiManagementId String

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    connectionString String

    The connection string to the Cache for Redis.

    cacheLocation String

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    description String

    The description of the API Management Redis Cache.

    name String

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId String

    The resource ID of the Cache for Redis.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RedisCache 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 RedisCache Resource

    Get an existing RedisCache 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?: RedisCacheState, opts?: CustomResourceOptions): RedisCache
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            api_management_id: Optional[str] = None,
            cache_location: Optional[str] = None,
            connection_string: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            redis_cache_id: Optional[str] = None) -> RedisCache
    func GetRedisCache(ctx *Context, name string, id IDInput, state *RedisCacheState, opts ...ResourceOption) (*RedisCache, error)
    public static RedisCache Get(string name, Input<string> id, RedisCacheState? state, CustomResourceOptions? opts = null)
    public static RedisCache get(String name, Output<String> id, RedisCacheState 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:
    ApiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    CacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    ConnectionString string

    The connection string to the Cache for Redis.

    Description string

    The description of the API Management Redis Cache.

    Name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    RedisCacheId string

    The resource ID of the Cache for Redis.

    ApiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    CacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    ConnectionString string

    The connection string to the Cache for Redis.

    Description string

    The description of the API Management Redis Cache.

    Name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    RedisCacheId string

    The resource ID of the Cache for Redis.

    apiManagementId String

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    cacheLocation String

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    connectionString String

    The connection string to the Cache for Redis.

    description String

    The description of the API Management Redis Cache.

    name String

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId String

    The resource ID of the Cache for Redis.

    apiManagementId string

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    cacheLocation string

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    connectionString string

    The connection string to the Cache for Redis.

    description string

    The description of the API Management Redis Cache.

    name string

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId string

    The resource ID of the Cache for Redis.

    api_management_id str

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    cache_location str

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    connection_string str

    The connection string to the Cache for Redis.

    description str

    The description of the API Management Redis Cache.

    name str

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redis_cache_id str

    The resource ID of the Cache for Redis.

    apiManagementId String

    The resource ID of the API Management Service from which to create this external cache. Changing this forces a new API Management Redis Cache to be created.

    cacheLocation String

    The location where to use cache from. Possible values are default and valid Azure regions. Defaults to default.

    connectionString String

    The connection string to the Cache for Redis.

    description String

    The description of the API Management Redis Cache.

    name String

    The name which should be used for this API Management Redis Cache. Changing this forces a new API Management Redis Cache to be created.

    redisCacheId String

    The resource ID of the Cache for Redis.

    Import

    API Management Redis Caches can be imported using the resource id, e.g.

     $ pulumi import azure:apimanagement/redisCache:RedisCache example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/caches/cache1
    

    Package Details

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

    This Pulumi package is based on the azurerm Terraform Provider.

    azure logo

    We recommend using Azure Native.

    Azure Classic v5.57.0 published on Tuesday, Nov 28, 2023 by Pulumi