// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.redis;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.redis.LinkedServerArgs;
import com.pulumi.azure.redis.inputs.LinkedServerState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;

/**
 * Manages a Redis Linked Server (ie Geo Location)
 * 
 * ## Example Usage
 * ```java
 * 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(&#34;example-primaryResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;East US&#34;)
 *             .build());
 * 
 *         var example_primaryCache = new Cache(&#34;example-primaryCache&#34;, CacheArgs.builder()        
 *             .location(example_primaryResourceGroup.location())
 *             .resourceGroupName(example_primaryResourceGroup.name())
 *             .capacity(1)
 *             .family(&#34;P&#34;)
 *             .skuName(&#34;Premium&#34;)
 *             .enableNonSslPort(false)
 *             .redisConfiguration(CacheRedisConfigurationArgs.builder()
 *                 .maxmemoryReserved(2)
 *                 .maxmemoryDelta(2)
 *                 .maxmemoryPolicy(&#34;allkeys-lru&#34;)
 *                 .build())
 *             .build());
 * 
 *         var example_secondaryResourceGroup = new ResourceGroup(&#34;example-secondaryResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West US&#34;)
 *             .build());
 * 
 *         var example_secondaryCache = new Cache(&#34;example-secondaryCache&#34;, CacheArgs.builder()        
 *             .location(example_secondaryResourceGroup.location())
 *             .resourceGroupName(example_secondaryResourceGroup.name())
 *             .capacity(1)
 *             .family(&#34;P&#34;)
 *             .skuName(&#34;Premium&#34;)
 *             .enableNonSslPort(false)
 *             .redisConfiguration(CacheRedisConfigurationArgs.builder()
 *                 .maxmemoryReserved(2)
 *                 .maxmemoryDelta(2)
 *                 .maxmemoryPolicy(&#34;allkeys-lru&#34;)
 *                 .build())
 *             .build());
 * 
 *         var example_link = new LinkedServer(&#34;example-link&#34;, LinkedServerArgs.builder()        
 *             .targetRedisCacheName(example_primaryCache.name())
 *             .resourceGroupName(example_primaryCache.resourceGroupName())
 *             .linkedRedisCacheId(example_secondaryCache.id())
 *             .linkedRedisCacheLocation(example_secondaryCache.location())
 *             .serverRole(&#34;Secondary&#34;)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Redis can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:redis/linkedServer:LinkedServer example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Cache/redis/cache1/linkedServers/cache2
 * ```
 * 
 */
@ResourceType(type="azure:redis/linkedServer:LinkedServer")
public class LinkedServer extends com.pulumi.resources.CustomResource {
    /**
     * The ID of the linked Redis cache. Changing this forces a new Redis to be created.
     * 
     */
    @Export(name="linkedRedisCacheId", refs={String.class}, tree="[0]")
    private Output<String> linkedRedisCacheId;

    /**
     * @return The ID of the linked Redis cache. Changing this forces a new Redis to be created.
     * 
     */
    public Output<String> linkedRedisCacheId() {
        return this.linkedRedisCacheId;
    }
    /**
     * The location of the linked Redis cache. Changing this forces a new Redis to be created.
     * 
     */
    @Export(name="linkedRedisCacheLocation", refs={String.class}, tree="[0]")
    private Output<String> linkedRedisCacheLocation;

    /**
     * @return The location of the linked Redis cache. Changing this forces a new Redis to be created.
     * 
     */
    public Output<String> linkedRedisCacheLocation() {
        return this.linkedRedisCacheLocation;
    }
    /**
     * The name of the linked server.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the linked server.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the Resource Group where the Redis caches exists. Changing this forces a new Redis to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * The role of the linked Redis cache (eg &#34;Secondary&#34;). Changing this forces a new Redis to be created. Possible values are `Primary` and `Secondary`.
     * 
     */
    @Export(name="serverRole", refs={String.class}, tree="[0]")
    private Output<String> serverRole;

    /**
     * @return The role of the linked Redis cache (eg &#34;Secondary&#34;). Changing this forces a new Redis to be created. Possible values are `Primary` and `Secondary`.
     * 
     */
    public Output<String> serverRole() {
        return this.serverRole;
    }
    /**
     * The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
     * 
     */
    @Export(name="targetRedisCacheName", refs={String.class}, tree="[0]")
    private Output<String> targetRedisCacheName;

    /**
     * @return The name of Redis cache to link with. Changing this forces a new Redis to be created. (eg The primary role)
     * 
     */
    public Output<String> targetRedisCacheName() {
        return this.targetRedisCacheName;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public LinkedServer(String name) {
        this(name, LinkedServerArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public LinkedServer(String name, LinkedServerArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public LinkedServer(String name, LinkedServerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:redis/linkedServer:LinkedServer", name, args == null ? LinkedServerArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private LinkedServer(String name, Output<String> id, @Nullable LinkedServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:redis/linkedServer:LinkedServer", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static LinkedServer get(String name, Output<String> id, @Nullable LinkedServerState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new LinkedServer(name, id, state, options);
    }
}
