We recommend using Azure Native.
azure.apimanagement.RedisCache
Explore with Pulumi AI
Manages a API Management Redis Cache.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleService = new azure.apimanagement.Service("example", {
name: "example-apim",
location: example.location,
resourceGroupName: example.name,
publisherName: "pub1",
publisherEmail: "pub1@email.com",
skuName: "Consumption_0",
});
const exampleCache = new azure.redis.Cache("example", {
name: "example-cache",
location: example.location,
resourceGroupName: example.name,
capacity: 1,
family: "C",
skuName: "Basic",
enableNonSslPort: false,
minimumTlsVersion: "1.2",
redisConfiguration: {},
});
const exampleRedisCache = new azure.apimanagement.RedisCache("example", {
name: "example-Redis-Cache",
apiManagementId: exampleService.id,
connectionString: exampleCache.primaryConnectionString,
description: "Redis cache instances",
redisCacheId: exampleCache.id,
cacheLocation: "East Us",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_service = azure.apimanagement.Service("example",
name="example-apim",
location=example.location,
resource_group_name=example.name,
publisher_name="pub1",
publisher_email="pub1@email.com",
sku_name="Consumption_0")
example_cache = azure.redis.Cache("example",
name="example-cache",
location=example.location,
resource_group_name=example.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("example",
name="example-Redis-Cache",
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")
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 {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
Name: pulumi.String("example-apim"),
Location: example.Location,
ResourceGroupName: example.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, "example", &redis.CacheArgs{
Name: pulumi.String("example-cache"),
Location: example.Location,
ResourceGroupName: example.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, "example", &apimanagement.RedisCacheArgs{
Name: pulumi.String("example-Redis-Cache"),
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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleService = new Azure.ApiManagement.Service("example", new()
{
Name = "example-apim",
Location = example.Location,
ResourceGroupName = example.Name,
PublisherName = "pub1",
PublisherEmail = "pub1@email.com",
SkuName = "Consumption_0",
});
var exampleCache = new Azure.Redis.Cache("example", new()
{
Name = "example-cache",
Location = example.Location,
ResourceGroupName = example.Name,
Capacity = 1,
Family = "C",
SkuName = "Basic",
EnableNonSslPort = false,
MinimumTlsVersion = "1.2",
RedisConfiguration = null,
});
var exampleRedisCache = new Azure.ApiManagement.RedisCache("example", new()
{
Name = "example-Redis-Cache",
ApiManagementId = exampleService.Id,
ConnectionString = exampleCache.PrimaryConnectionString,
Description = "Redis cache instances",
RedisCacheId = exampleCache.Id,
CacheLocation = "East Us",
});
});
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.name("example-apim")
.location(example.location())
.resourceGroupName(example.name())
.publisherName("pub1")
.publisherEmail("pub1@email.com")
.skuName("Consumption_0")
.build());
var exampleCache = new Cache("exampleCache", CacheArgs.builder()
.name("example-cache")
.location(example.location())
.resourceGroupName(example.name())
.capacity(1)
.family("C")
.skuName("Basic")
.enableNonSslPort(false)
.minimumTlsVersion("1.2")
.redisConfiguration()
.build());
var exampleRedisCache = new RedisCache("exampleRedisCache", RedisCacheArgs.builder()
.name("example-Redis-Cache")
.apiManagementId(exampleService.id())
.connectionString(exampleCache.primaryConnectionString())
.description("Redis cache instances")
.redisCacheId(exampleCache.id())
.cacheLocation("East Us")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleService:
type: azure:apimanagement:Service
name: example
properties:
name: example-apim
location: ${example.location}
resourceGroupName: ${example.name}
publisherName: pub1
publisherEmail: pub1@email.com
skuName: Consumption_0
exampleCache:
type: azure:redis:Cache
name: example
properties:
name: example-cache
location: ${example.location}
resourceGroupName: ${example.name}
capacity: 1
family: C
skuName: Basic
enableNonSslPort: false
minimumTlsVersion: '1.2'
redisConfiguration: {}
exampleRedisCache:
type: azure:apimanagement:RedisCache
name: example
properties:
name: example-Redis-Cache
apiManagementId: ${exampleService.id}
connectionString: ${exampleCache.primaryConnectionString}
description: Redis cache instances
redisCacheId: ${exampleCache.id}
cacheLocation: East Us
Create RedisCache Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RedisCache(name: string, args: RedisCacheArgs, opts?: CustomResourceOptions);
@overload
def RedisCache(resource_name: str,
args: RedisCacheArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RedisCache(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_management_id: Optional[str] = None,
connection_string: Optional[str] = None,
cache_location: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
redis_cache_id: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var redisCacheResource = new Azure.ApiManagement.RedisCache("redisCacheResource", new()
{
ApiManagementId = "string",
ConnectionString = "string",
CacheLocation = "string",
Description = "string",
Name = "string",
RedisCacheId = "string",
});
example, err := apimanagement.NewRedisCache(ctx, "redisCacheResource", &apimanagement.RedisCacheArgs{
ApiManagementId: pulumi.String("string"),
ConnectionString: pulumi.String("string"),
CacheLocation: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
RedisCacheId: pulumi.String("string"),
})
var redisCacheResource = new RedisCache("redisCacheResource", RedisCacheArgs.builder()
.apiManagementId("string")
.connectionString("string")
.cacheLocation("string")
.description("string")
.name("string")
.redisCacheId("string")
.build());
redis_cache_resource = azure.apimanagement.RedisCache("redisCacheResource",
api_management_id="string",
connection_string="string",
cache_location="string",
description="string",
name="string",
redis_cache_id="string")
const redisCacheResource = new azure.apimanagement.RedisCache("redisCacheResource", {
apiManagementId: "string",
connectionString: "string",
cacheLocation: "string",
description: "string",
name: "string",
redisCacheId: "string",
});
type: azure:apimanagement:RedisCache
properties:
apiManagementId: string
cacheLocation: string
connectionString: string
description: string
name: string
redisCacheId: string
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:
- Api
Management stringId - 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 string - The connection string to the Cache for Redis.
- Cache
Location string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - 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.
- Redis
Cache stringId - The resource ID of the Cache for Redis.
- Api
Management stringId - 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 string - The connection string to the Cache for Redis.
- Cache
Location string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - 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.
- Redis
Cache stringId - The resource ID of the Cache for Redis.
- api
Management StringId - 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 String - The connection string to the Cache for Redis.
- cache
Location String - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - 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.
- redis
Cache StringId - The resource ID of the Cache for Redis.
- api
Management stringId - 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 string - The connection string to the Cache for Redis.
- cache
Location string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - 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.
- redis
Cache stringId - The resource ID of the Cache for Redis.
- api_
management_ strid - 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 todefault
. - 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_ strid - The resource ID of the Cache for Redis.
- api
Management StringId - 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 String - The connection string to the Cache for Redis.
- cache
Location String - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - 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.
- redis
Cache StringId - 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.
- Api
Management stringId - 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 string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - Connection
String 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.
- Redis
Cache stringId - The resource ID of the Cache for Redis.
- Api
Management stringId - 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 string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - Connection
String 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.
- Redis
Cache stringId - The resource ID of the Cache for Redis.
- api
Management StringId - 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 String - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - connection
String 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.
- redis
Cache StringId - The resource ID of the Cache for Redis.
- api
Management stringId - 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 string - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - connection
String 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.
- redis
Cache stringId - The resource ID of the Cache for Redis.
- api_
management_ strid - 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 todefault
. - 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_ strid - The resource ID of the Cache for Redis.
- api
Management StringId - 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 String - The location where to use cache from. Possible values are
default
and valid Azure regions. Defaults todefault
. - connection
String 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.
- redis
Cache StringId - 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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.