// *** 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.appplatform;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.appplatform.SpringCloudAppRedisAssociationArgs;
import com.pulumi.azure.appplatform.inputs.SpringCloudAppRedisAssociationState;
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.Boolean;
import java.lang.String;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Associates a Spring Cloud Application with a Redis Cache.
 * 
 * ## 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.appplatform.SpringCloudService;
 * import com.pulumi.azure.appplatform.SpringCloudServiceArgs;
 * import com.pulumi.azure.appplatform.SpringCloudApp;
 * import com.pulumi.azure.appplatform.SpringCloudAppArgs;
 * import com.pulumi.azure.redis.Cache;
 * import com.pulumi.azure.redis.CacheArgs;
 * import com.pulumi.azure.appplatform.SpringCloudAppRedisAssociation;
 * import com.pulumi.azure.appplatform.SpringCloudAppRedisAssociationArgs;
 * 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(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleSpringCloudService = new SpringCloudService(&#34;exampleSpringCloudService&#34;, SpringCloudServiceArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .build());
 * 
 *         var exampleSpringCloudApp = new SpringCloudApp(&#34;exampleSpringCloudApp&#34;, SpringCloudAppArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .serviceName(exampleSpringCloudService.name())
 *             .build());
 * 
 *         var exampleCache = new Cache(&#34;exampleCache&#34;, CacheArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .capacity(0)
 *             .family(&#34;C&#34;)
 *             .skuName(&#34;Basic&#34;)
 *             .enableNonSslPort(true)
 *             .build());
 * 
 *         var exampleSpringCloudAppRedisAssociation = new SpringCloudAppRedisAssociation(&#34;exampleSpringCloudAppRedisAssociation&#34;, SpringCloudAppRedisAssociationArgs.builder()        
 *             .springCloudAppId(exampleSpringCloudApp.id())
 *             .redisCacheId(exampleCache.id())
 *             .redisAccessKey(exampleCache.primaryAccessKey())
 *             .sslEnabled(true)
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Spring Cloud Application Redis Association can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:appplatform/springCloudAppRedisAssociation:SpringCloudAppRedisAssociation example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.AppPlatform/spring/myservice/apps/myapp/bindings/bind1
 * ```
 * 
 */
@ResourceType(type="azure:appplatform/springCloudAppRedisAssociation:SpringCloudAppRedisAssociation")
public class SpringCloudAppRedisAssociation extends com.pulumi.resources.CustomResource {
    /**
     * Specifies the name of the Spring Cloud Application Association. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return Specifies the name of the Spring Cloud Application Association. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * Specifies the Redis Cache access key.
     * 
     */
    @Export(name="redisAccessKey", refs={String.class}, tree="[0]")
    private Output<String> redisAccessKey;

    /**
     * @return Specifies the Redis Cache access key.
     * 
     */
    public Output<String> redisAccessKey() {
        return this.redisAccessKey;
    }
    /**
     * Specifies the Redis Cache resource ID. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="redisCacheId", refs={String.class}, tree="[0]")
    private Output<String> redisCacheId;

    /**
     * @return Specifies the Redis Cache resource ID. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> redisCacheId() {
        return this.redisCacheId;
    }
    /**
     * Specifies the Spring Cloud Application resource ID in which the Association is created. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="springCloudAppId", refs={String.class}, tree="[0]")
    private Output<String> springCloudAppId;

    /**
     * @return Specifies the Spring Cloud Application resource ID in which the Association is created. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> springCloudAppId() {
        return this.springCloudAppId;
    }
    /**
     * Should SSL be used when connecting to Redis? Defaults to `true`.
     * 
     */
    @Export(name="sslEnabled", refs={Boolean.class}, tree="[0]")
    private Output</* @Nullable */ Boolean> sslEnabled;

    /**
     * @return Should SSL be used when connecting to Redis? Defaults to `true`.
     * 
     */
    public Output<Optional<Boolean>> sslEnabled() {
        return Codegen.optional(this.sslEnabled);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public SpringCloudAppRedisAssociation(String name) {
        this(name, SpringCloudAppRedisAssociationArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public SpringCloudAppRedisAssociation(String name, SpringCloudAppRedisAssociationArgs 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 SpringCloudAppRedisAssociation(String name, SpringCloudAppRedisAssociationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appplatform/springCloudAppRedisAssociation:SpringCloudAppRedisAssociation", name, args == null ? SpringCloudAppRedisAssociationArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private SpringCloudAppRedisAssociation(String name, Output<String> id, @Nullable SpringCloudAppRedisAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:appplatform/springCloudAppRedisAssociation:SpringCloudAppRedisAssociation", 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 SpringCloudAppRedisAssociation get(String name, Output<String> id, @Nullable SpringCloudAppRedisAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new SpringCloudAppRedisAssociation(name, id, state, options);
    }
}
