We recommend using Azure Native.
azure.redis.LinkedServer
Explore with Pulumi AI
Manages a Redis Linked Server (ie Geo Location)
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example_primaryResourceGroup = new Azure.Core.ResourceGroup("example-primaryResourceGroup", new()
{
Location = "East US",
});
var example_primaryCache = new Azure.Redis.Cache("example-primaryCache", new()
{
Location = example_primaryResourceGroup.Location,
ResourceGroupName = example_primaryResourceGroup.Name,
Capacity = 1,
Family = "P",
SkuName = "Premium",
EnableNonSslPort = false,
RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs
{
MaxmemoryReserved = 2,
MaxmemoryDelta = 2,
MaxmemoryPolicy = "allkeys-lru",
},
});
var example_secondaryResourceGroup = new Azure.Core.ResourceGroup("example-secondaryResourceGroup", new()
{
Location = "West US",
});
var example_secondaryCache = new Azure.Redis.Cache("example-secondaryCache", new()
{
Location = example_secondaryResourceGroup.Location,
ResourceGroupName = example_secondaryResourceGroup.Name,
Capacity = 1,
Family = "P",
SkuName = "Premium",
EnableNonSslPort = false,
RedisConfiguration = new Azure.Redis.Inputs.CacheRedisConfigurationArgs
{
MaxmemoryReserved = 2,
MaxmemoryDelta = 2,
MaxmemoryPolicy = "allkeys-lru",
},
});
var example_link = new Azure.Redis.LinkedServer("example-link", new()
{
TargetRedisCacheName = example_primaryCache.Name,
ResourceGroupName = example_primaryCache.ResourceGroupName,
LinkedRedisCacheId = example_secondaryCache.Id,
LinkedRedisCacheLocation = example_secondaryCache.Location,
ServerRole = "Secondary",
});
});
package main
import (
"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 {
_, err := core.NewResourceGroup(ctx, "example-primaryResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("East US"),
})
if err != nil {
return err
}
_, err = redis.NewCache(ctx, "example-primaryCache", &redis.CacheArgs{
Location: example_primaryResourceGroup.Location,
ResourceGroupName: example_primaryResourceGroup.Name,
Capacity: pulumi.Int(1),
Family: pulumi.String("P"),
SkuName: pulumi.String("Premium"),
EnableNonSslPort: pulumi.Bool(false),
RedisConfiguration: &redis.CacheRedisConfigurationArgs{
MaxmemoryReserved: pulumi.Int(2),
MaxmemoryDelta: pulumi.Int(2),
MaxmemoryPolicy: pulumi.String("allkeys-lru"),
},
})
if err != nil {
return err
}
_, err = core.NewResourceGroup(ctx, "example-secondaryResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West US"),
})
if err != nil {
return err
}
_, err = redis.NewCache(ctx, "example-secondaryCache", &redis.CacheArgs{
Location: example_secondaryResourceGroup.Location,
ResourceGroupName: example_secondaryResourceGroup.Name,
Capacity: pulumi.Int(1),
Family: pulumi.String("P"),
SkuName: pulumi.String("Premium"),
EnableNonSslPort: pulumi.Bool(false),
RedisConfiguration: &redis.CacheRedisConfigurationArgs{
MaxmemoryReserved: pulumi.Int(2),
MaxmemoryDelta: pulumi.Int(2),
MaxmemoryPolicy: pulumi.String("allkeys-lru"),
},
})
if err != nil {
return err
}
_, err = redis.NewLinkedServer(ctx, "example-link", &redis.LinkedServerArgs{
TargetRedisCacheName: example_primaryCache.Name,
ResourceGroupName: example_primaryCache.ResourceGroupName,
LinkedRedisCacheId: example_secondaryCache.ID(),
LinkedRedisCacheLocation: example_secondaryCache.Location,
ServerRole: pulumi.String("Secondary"),
})
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.redis.Cache;
import com.pulumi.azure.redis.CacheArgs;
import com.pulumi.azure.redis.inputs.CacheRedisConfigurationArgs;
import com.pulumi.azure.redis.LinkedServer;
import com.pulumi.azure.redis.LinkedServerArgs;
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_primaryResourceGroup = new ResourceGroup("example-primaryResourceGroup", ResourceGroupArgs.builder()
.location("East US")
.build());
var example_primaryCache = new Cache("example-primaryCache", CacheArgs.builder()
.location(example_primaryResourceGroup.location())
.resourceGroupName(example_primaryResourceGroup.name())
.capacity(1)
.family("P")
.skuName("Premium")
.enableNonSslPort(false)
.redisConfiguration(CacheRedisConfigurationArgs.builder()
.maxmemoryReserved(2)
.maxmemoryDelta(2)
.maxmemoryPolicy("allkeys-lru")
.build())
.build());
var example_secondaryResourceGroup = new ResourceGroup("example-secondaryResourceGroup", ResourceGroupArgs.builder()
.location("West US")
.build());
var example_secondaryCache = new Cache("example-secondaryCache", CacheArgs.builder()
.location(example_secondaryResourceGroup.location())
.resourceGroupName(example_secondaryResourceGroup.name())
.capacity(1)
.family("P")
.skuName("Premium")
.enableNonSslPort(false)
.redisConfiguration(CacheRedisConfigurationArgs.builder()
.maxmemoryReserved(2)
.maxmemoryDelta(2)
.maxmemoryPolicy("allkeys-lru")
.build())
.build());
var example_link = new LinkedServer("example-link", LinkedServerArgs.builder()
.targetRedisCacheName(example_primaryCache.name())
.resourceGroupName(example_primaryCache.resourceGroupName())
.linkedRedisCacheId(example_secondaryCache.id())
.linkedRedisCacheLocation(example_secondaryCache.location())
.serverRole("Secondary")
.build());
}
}
import pulumi
import pulumi_azure as azure
example_primary_resource_group = azure.core.ResourceGroup("example-primaryResourceGroup", location="East US")
example_primary_cache = azure.redis.Cache("example-primaryCache",
location=example_primary_resource_group.location,
resource_group_name=example_primary_resource_group.name,
capacity=1,
family="P",
sku_name="Premium",
enable_non_ssl_port=False,
redis_configuration=azure.redis.CacheRedisConfigurationArgs(
maxmemory_reserved=2,
maxmemory_delta=2,
maxmemory_policy="allkeys-lru",
))
example_secondary_resource_group = azure.core.ResourceGroup("example-secondaryResourceGroup", location="West US")
example_secondary_cache = azure.redis.Cache("example-secondaryCache",
location=example_secondary_resource_group.location,
resource_group_name=example_secondary_resource_group.name,
capacity=1,
family="P",
sku_name="Premium",
enable_non_ssl_port=False,
redis_configuration=azure.redis.CacheRedisConfigurationArgs(
maxmemory_reserved=2,
maxmemory_delta=2,
maxmemory_policy="allkeys-lru",
))
example_link = azure.redis.LinkedServer("example-link",
target_redis_cache_name=example_primary_cache.name,
resource_group_name=example_primary_cache.resource_group_name,
linked_redis_cache_id=example_secondary_cache.id,
linked_redis_cache_location=example_secondary_cache.location,
server_role="Secondary")
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example_primaryResourceGroup = new azure.core.ResourceGroup("example-primaryResourceGroup", {location: "East US"});
const example_primaryCache = new azure.redis.Cache("example-primaryCache", {
location: example_primaryResourceGroup.location,
resourceGroupName: example_primaryResourceGroup.name,
capacity: 1,
family: "P",
skuName: "Premium",
enableNonSslPort: false,
redisConfiguration: {
maxmemoryReserved: 2,
maxmemoryDelta: 2,
maxmemoryPolicy: "allkeys-lru",
},
});
const example_secondaryResourceGroup = new azure.core.ResourceGroup("example-secondaryResourceGroup", {location: "West US"});
const example_secondaryCache = new azure.redis.Cache("example-secondaryCache", {
location: example_secondaryResourceGroup.location,
resourceGroupName: example_secondaryResourceGroup.name,
capacity: 1,
family: "P",
skuName: "Premium",
enableNonSslPort: false,
redisConfiguration: {
maxmemoryReserved: 2,
maxmemoryDelta: 2,
maxmemoryPolicy: "allkeys-lru",
},
});
const example_link = new azure.redis.LinkedServer("example-link", {
targetRedisCacheName: example_primaryCache.name,
resourceGroupName: example_primaryCache.resourceGroupName,
linkedRedisCacheId: example_secondaryCache.id,
linkedRedisCacheLocation: example_secondaryCache.location,
serverRole: "Secondary",
});
resources:
example-primaryResourceGroup:
type: azure:core:ResourceGroup
properties:
location: East US
example-primaryCache:
type: azure:redis:Cache
properties:
location: ${["example-primaryResourceGroup"].location}
resourceGroupName: ${["example-primaryResourceGroup"].name}
capacity: 1
family: P
skuName: Premium
enableNonSslPort: false
redisConfiguration:
maxmemoryReserved: 2
maxmemoryDelta: 2
maxmemoryPolicy: allkeys-lru
example-secondaryResourceGroup:
type: azure:core:ResourceGroup
properties:
location: West US
example-secondaryCache:
type: azure:redis:Cache
properties:
location: ${["example-secondaryResourceGroup"].location}
resourceGroupName: ${["example-secondaryResourceGroup"].name}
capacity: 1
family: P
skuName: Premium
enableNonSslPort: false
redisConfiguration:
maxmemoryReserved: 2
maxmemoryDelta: 2
maxmemoryPolicy: allkeys-lru
example-link:
type: azure:redis:LinkedServer
properties:
targetRedisCacheName: ${["example-primaryCache"].name}
resourceGroupName: ${["example-primaryCache"].resourceGroupName}
linkedRedisCacheId: ${["example-secondaryCache"].id}
linkedRedisCacheLocation: ${["example-secondaryCache"].location}
serverRole: Secondary
Create LinkedServer Resource
new LinkedServer(name: string, args: LinkedServerArgs, opts?: CustomResourceOptions);
@overload
def LinkedServer(resource_name: str,
opts: Optional[ResourceOptions] = None,
linked_redis_cache_id: Optional[str] = None,
linked_redis_cache_location: Optional[str] = None,
resource_group_name: Optional[str] = None,
server_role: Optional[str] = None,
target_redis_cache_name: Optional[str] = None)
@overload
def LinkedServer(resource_name: str,
args: LinkedServerArgs,
opts: Optional[ResourceOptions] = None)
func NewLinkedServer(ctx *Context, name string, args LinkedServerArgs, opts ...ResourceOption) (*LinkedServer, error)
public LinkedServer(string name, LinkedServerArgs args, CustomResourceOptions? opts = null)
public LinkedServer(String name, LinkedServerArgs args)
public LinkedServer(String name, LinkedServerArgs args, CustomResourceOptions options)
type: azure:redis:LinkedServer
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LinkedServerArgs
- 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 LinkedServerArgs
- 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 LinkedServerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LinkedServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LinkedServerArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
LinkedServer 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 LinkedServer resource accepts the following input properties:
- Linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- Linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- Resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- Server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- Target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- Linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- Linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- Resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- Server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- Target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis StringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis StringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- resource
Group StringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role String The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis StringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked_
redis_ strcache_ id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked_
redis_ strcache_ location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- resource_
group_ strname The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server_
role str The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target_
redis_ strcache_ name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis StringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis StringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- resource
Group StringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role String The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis StringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
Outputs
All input properties are implicitly available as output properties. Additionally, the LinkedServer resource produces the following output properties:
Look up Existing LinkedServer Resource
Get an existing LinkedServer 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?: LinkedServerState, opts?: CustomResourceOptions): LinkedServer
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
linked_redis_cache_id: Optional[str] = None,
linked_redis_cache_location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
server_role: Optional[str] = None,
target_redis_cache_name: Optional[str] = None) -> LinkedServer
func GetLinkedServer(ctx *Context, name string, id IDInput, state *LinkedServerState, opts ...ResourceOption) (*LinkedServer, error)
public static LinkedServer Get(string name, Input<string> id, LinkedServerState? state, CustomResourceOptions? opts = null)
public static LinkedServer get(String name, Output<String> id, LinkedServerState 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.
- Linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- Linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- Name string
The name of the linked server.
- Resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- Server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- Target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- Linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- Linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- Name string
The name of the linked server.
- Resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- Server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- Target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis StringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis StringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- name String
The name of the linked server.
- resource
Group StringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role String The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis StringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis stringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis stringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- name string
The name of the linked server.
- resource
Group stringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role string The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis stringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked_
redis_ strcache_ id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked_
redis_ strcache_ location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- name str
The name of the linked server.
- resource_
group_ strname The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server_
role str The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target_
redis_ strcache_ name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
- linked
Redis StringCache Id The ID of the linked Redis cache. Changing this forces a new Redis to be created.
- linked
Redis StringCache Location The location of the linked Redis cache. Changing this forces a new Redis to be created.
- name String
The name of the linked server.
- resource
Group StringName The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
- server
Role String The role of the linked Redis cache (eg "Secondary"). Changing this forces a new Redis to be created. Possible values are
Primary
andSecondary
.- target
Redis StringCache Name The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
Import
Redis can be imported using the resource id
, e.g.
$ pulumi import azure:redis/linkedServer:LinkedServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1/linkedServers/cache2
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azurerm
Terraform Provider.