<filename>sdk/dotnet/RedisCluster.cs<gh_stars>0// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace luxifer.Scaleway
{
    /// <summary>
    /// Creates and manages Scaleway Redis Clusters.
    /// For more information, see [the documentation](https://developers.scaleway.com/en/products/redis/api/v1alpha1/).
    /// 
    /// ## Examples
    /// 
    /// ### Basic
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var main = new Scaleway.RedisCluster("main", new()
    ///     {
    ///         Acls = new[]
    ///         {
    ///             new Scaleway.Inputs.RedisClusterAclArgs
    ///             {
    ///                 Description = "Allow all",
    ///                 Ip = "0.0.0.0/0",
    ///             },
    ///         },
    ///         ClusterSize = 1,
    ///         NodeType = "RED1-MICRO",
    ///         Password = "thiZ_is_v&amp;ry_s3cret",
    ///         Tags = new[]
    ///         {
    ///             "test",
    ///             "redis",
    ///         },
    ///         TlsEnabled = true,
    ///         UserName = "my_initial_user",
    ///         Version = "6.2.6",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ### With settings
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var main = new Scaleway.RedisCluster("main", new()
    ///     {
    ///         NodeType = "RED1-MICRO",
    ///         Password = "thiZ_is_v&amp;ry_s3cret",
    ///         Settings = 
    ///         {
    ///             { "maxclients", "1000" },
    ///             { "tcp-keepalive", "120" },
    ///         },
    ///         UserName = "my_initial_user",
    ///         Version = "6.2.6",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ### With a private network
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Scaleway = luxifer.Scaleway;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var pn = new Scaleway.VpcPrivateNetwork("pn");
    /// 
    ///     var main = new Scaleway.RedisCluster("main", new()
    ///     {
    ///         Version = "6.2.6",
    ///         NodeType = "RED1-MICRO",
    ///         UserName = "my_initial_user",
    ///         Password = "thiZ_is_v&amp;ry_s3cret",
    ///         ClusterSize = 1,
    ///         PrivateNetworks = new[]
    ///         {
    ///             new Scaleway.Inputs.RedisClusterPrivateNetworkArgs
    ///             {
    ///                 Id = pn.Id,
    ///                 ServiceIps = new[]
    ///                 {
    ///                     "10.12.1.1/20",
    ///                 },
    ///             },
    ///         },
    ///     }, new CustomResourceOptions
    ///     {
    ///         DependsOn = new[]
    ///         {
    ///             pn,
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Redis Cluster can be imported using the `{zone}/{id}`, e.g. bash
    /// 
    /// ```sh
    ///  $ pulumi import scaleway:index/redisCluster:RedisCluster main fr-par-1/11111111-1111-1111-1111-111111111111
    /// ```
    /// </summary>
    [ScalewayResourceType("scaleway:index/redisCluster:RedisCluster")]
    public partial class RedisCluster : global::Pulumi.CustomResource
    {
        /// <summary>
        /// List of acl rules, this is cluster's authorized IPs. More details on the ACL section.
        /// </summary>
        [Output("acls")]
        public Output<ImmutableArray<Outputs.RedisClusterAcl>> Acls { get; private set; } = null!;

        /// <summary>
        /// The PEM of the certificate used by redis, only when `tls_enabled` is true
        /// </summary>
        [Output("certificate")]
        public Output<string> Certificate { get; private set; } = null!;

        /// <summary>
        /// The number of nodes in the Redis Cluster.
        /// </summary>
        [Output("clusterSize")]
        public Output<int> ClusterSize { get; private set; } = null!;

        /// <summary>
        /// The date and time of creation of the Redis Cluster.
        /// </summary>
        [Output("createdAt")]
        public Output<string> CreatedAt { get; private set; } = null!;

        /// <summary>
        /// The name of the Redis Cluster.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The type of Redis Cluster you want to create (e.g. `RED1-M`).
        /// </summary>
        [Output("nodeType")]
        public Output<string> NodeType { get; private set; } = null!;

        /// <summary>
        /// Password for the first user of the Redis Cluster.
        /// </summary>
        [Output("password")]
        public Output<string> Password { get; private set; } = null!;

        /// <summary>
        /// Describes the private network you want to connect to your cluster. If not set, a public
        /// network will be provided. More details on the Private Network section
        /// </summary>
        [Output("privateNetworks")]
        public Output<ImmutableArray<Outputs.RedisClusterPrivateNetwork>> PrivateNetworks { get; private set; } = null!;

        /// <summary>
        /// `project_id`) The ID of the project the Redis Cluster is
        /// associated with.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// (Optional) Public network details. Only one of `private_network` and `public_network` may be set.
        /// &gt; The `public_network` block exports:
        /// </summary>
        [Output("publicNetwork")]
        public Output<Outputs.RedisClusterPublicNetwork> PublicNetwork { get; private set; } = null!;

        /// <summary>
        /// Map of settings for redis cluster. Available settings can be found by listing redis versions
        /// with scaleway API or CLI
        /// </summary>
        [Output("settings")]
        public Output<ImmutableDictionary<string, string>?> Settings { get; private set; } = null!;

        /// <summary>
        /// The tags associated with the Redis Cluster.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableArray<string>> Tags { get; private set; } = null!;

        /// <summary>
        /// Whether TLS is enabled or not.
        /// </summary>
        [Output("tlsEnabled")]
        public Output<bool?> TlsEnabled { get; private set; } = null!;

        /// <summary>
        /// The date and time of the last update of the Redis Cluster.
        /// </summary>
        [Output("updatedAt")]
        public Output<string> UpdatedAt { get; private set; } = null!;

        /// <summary>
        /// Identifier for the first user of the Redis Cluster.
        /// </summary>
        [Output("userName")]
        public Output<string> UserName { get; private set; } = null!;

        /// <summary>
        /// Redis's Cluster version (e.g. `6.2.6`).
        /// </summary>
        [Output("version")]
        public Output<string> Version { get; private set; } = null!;

        /// <summary>
        /// `zone`) The zone in which the
        /// Redis Cluster should be created.
        /// </summary>
        [Output("zone")]
        public Output<string> Zone { get; private set; } = null!;


        /// <summary>
        /// Create a RedisCluster resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public RedisCluster(string name, RedisClusterArgs args, CustomResourceOptions? options = null)
            : base("scaleway:index/redisCluster:RedisCluster", name, args ?? new RedisClusterArgs(), MakeResourceOptions(options, ""))
        {
        }

        private RedisCluster(string name, Input<string> id, RedisClusterState? state = null, CustomResourceOptions? options = null)
            : base("scaleway:index/redisCluster:RedisCluster", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/luxifer/pulumi-scaleway",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing RedisCluster resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static RedisCluster Get(string name, Input<string> id, RedisClusterState? state = null, CustomResourceOptions? options = null)
        {
            return new RedisCluster(name, id, state, options);
        }
    }

    public sealed class RedisClusterArgs : global::Pulumi.ResourceArgs
    {
        [Input("acls")]
        private InputList<Inputs.RedisClusterAclArgs>? _acls;

        /// <summary>
        /// List of acl rules, this is cluster's authorized IPs. More details on the ACL section.
        /// </summary>
        public InputList<Inputs.RedisClusterAclArgs> Acls
        {
            get => _acls ?? (_acls = new InputList<Inputs.RedisClusterAclArgs>());
            set => _acls = value;
        }

        /// <summary>
        /// The number of nodes in the Redis Cluster.
        /// </summary>
        [Input("clusterSize")]
        public Input<int>? ClusterSize { get; set; }

        /// <summary>
        /// The name of the Redis Cluster.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The type of Redis Cluster you want to create (e.g. `RED1-M`).
        /// </summary>
        [Input("nodeType", required: true)]
        public Input<string> NodeType { get; set; } = null!;

        /// <summary>
        /// Password for the first user of the Redis Cluster.
        /// </summary>
        [Input("password", required: true)]
        public Input<string> Password { get; set; } = null!;

        [Input("privateNetworks")]
        private InputList<Inputs.RedisClusterPrivateNetworkArgs>? _privateNetworks;

        /// <summary>
        /// Describes the private network you want to connect to your cluster. If not set, a public
        /// network will be provided. More details on the Private Network section
        /// </summary>
        public InputList<Inputs.RedisClusterPrivateNetworkArgs> PrivateNetworks
        {
            get => _privateNetworks ?? (_privateNetworks = new InputList<Inputs.RedisClusterPrivateNetworkArgs>());
            set => _privateNetworks = value;
        }

        /// <summary>
        /// `project_id`) The ID of the project the Redis Cluster is
        /// associated with.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// (Optional) Public network details. Only one of `private_network` and `public_network` may be set.
        /// &gt; The `public_network` block exports:
        /// </summary>
        [Input("publicNetwork")]
        public Input<Inputs.RedisClusterPublicNetworkArgs>? PublicNetwork { get; set; }

        [Input("settings")]
        private InputMap<string>? _settings;

        /// <summary>
        /// Map of settings for redis cluster. Available settings can be found by listing redis versions
        /// with scaleway API or CLI
        /// </summary>
        public InputMap<string> Settings
        {
            get => _settings ?? (_settings = new InputMap<string>());
            set => _settings = value;
        }

        [Input("tags")]
        private InputList<string>? _tags;

        /// <summary>
        /// The tags associated with the Redis Cluster.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

        /// <summary>
        /// Whether TLS is enabled or not.
        /// </summary>
        [Input("tlsEnabled")]
        public Input<bool>? TlsEnabled { get; set; }

        /// <summary>
        /// Identifier for the first user of the Redis Cluster.
        /// </summary>
        [Input("userName", required: true)]
        public Input<string> UserName { get; set; } = null!;

        /// <summary>
        /// Redis's Cluster version (e.g. `6.2.6`).
        /// </summary>
        [Input("version", required: true)]
        public Input<string> Version { get; set; } = null!;

        /// <summary>
        /// `zone`) The zone in which the
        /// Redis Cluster should be created.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public RedisClusterArgs()
        {
        }
        public static new RedisClusterArgs Empty => new RedisClusterArgs();
    }

    public sealed class RedisClusterState : global::Pulumi.ResourceArgs
    {
        [Input("acls")]
        private InputList<Inputs.RedisClusterAclGetArgs>? _acls;

        /// <summary>
        /// List of acl rules, this is cluster's authorized IPs. More details on the ACL section.
        /// </summary>
        public InputList<Inputs.RedisClusterAclGetArgs> Acls
        {
            get => _acls ?? (_acls = new InputList<Inputs.RedisClusterAclGetArgs>());
            set => _acls = value;
        }

        /// <summary>
        /// The PEM of the certificate used by redis, only when `tls_enabled` is true
        /// </summary>
        [Input("certificate")]
        public Input<string>? Certificate { get; set; }

        /// <summary>
        /// The number of nodes in the Redis Cluster.
        /// </summary>
        [Input("clusterSize")]
        public Input<int>? ClusterSize { get; set; }

        /// <summary>
        /// The date and time of creation of the Redis Cluster.
        /// </summary>
        [Input("createdAt")]
        public Input<string>? CreatedAt { get; set; }

        /// <summary>
        /// The name of the Redis Cluster.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The type of Redis Cluster you want to create (e.g. `RED1-M`).
        /// </summary>
        [Input("nodeType")]
        public Input<string>? NodeType { get; set; }

        /// <summary>
        /// Password for the first user of the Redis Cluster.
        /// </summary>
        [Input("password")]
        public Input<string>? Password { get; set; }

        [Input("privateNetworks")]
        private InputList<Inputs.RedisClusterPrivateNetworkGetArgs>? _privateNetworks;

        /// <summary>
        /// Describes the private network you want to connect to your cluster. If not set, a public
        /// network will be provided. More details on the Private Network section
        /// </summary>
        public InputList<Inputs.RedisClusterPrivateNetworkGetArgs> PrivateNetworks
        {
            get => _privateNetworks ?? (_privateNetworks = new InputList<Inputs.RedisClusterPrivateNetworkGetArgs>());
            set => _privateNetworks = value;
        }

        /// <summary>
        /// `project_id`) The ID of the project the Redis Cluster is
        /// associated with.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// (Optional) Public network details. Only one of `private_network` and `public_network` may be set.
        /// &gt; The `public_network` block exports:
        /// </summary>
        [Input("publicNetwork")]
        public Input<Inputs.RedisClusterPublicNetworkGetArgs>? PublicNetwork { get; set; }

        [Input("settings")]
        private InputMap<string>? _settings;

        /// <summary>
        /// Map of settings for redis cluster. Available settings can be found by listing redis versions
        /// with scaleway API or CLI
        /// </summary>
        public InputMap<string> Settings
        {
            get => _settings ?? (_settings = new InputMap<string>());
            set => _settings = value;
        }

        [Input("tags")]
        private InputList<string>? _tags;

        /// <summary>
        /// The tags associated with the Redis Cluster.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

        /// <summary>
        /// Whether TLS is enabled or not.
        /// </summary>
        [Input("tlsEnabled")]
        public Input<bool>? TlsEnabled { get; set; }

        /// <summary>
        /// The date and time of the last update of the Redis Cluster.
        /// </summary>
        [Input("updatedAt")]
        public Input<string>? UpdatedAt { get; set; }

        /// <summary>
        /// Identifier for the first user of the Redis Cluster.
        /// </summary>
        [Input("userName")]
        public Input<string>? UserName { get; set; }

        /// <summary>
        /// Redis's Cluster version (e.g. `6.2.6`).
        /// </summary>
        [Input("version")]
        public Input<string>? Version { get; set; }

        /// <summary>
        /// `zone`) The zone in which the
        /// Redis Cluster should be created.
        /// </summary>
        [Input("zone")]
        public Input<string>? Zone { get; set; }

        public RedisClusterState()
        {
        }
        public static new RedisClusterState Empty => new RedisClusterState();
    }
}
