// *** 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 TencentCloudIAC.PulumiPackage.Tencentcloud.Tcm
{
    /// <summary>
    /// Provides a resource to create a tcm mesh
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var basic = new Tencentcloud.Tcm.Mesh("basic", new Tencentcloud.Tcm.MeshArgs
    ///         {
    ///             Config = new Tencentcloud.Tcm.Inputs.MeshConfigArgs
    ///             {
    ///                 Istio = new Tencentcloud.Tcm.Inputs.MeshConfigIstioArgs
    ///                 {
    ///                     DisableHttpRetry = true,
    ///                     DisablePolicyChecks = true,
    ///                     EnablePilotHttp = true,
    ///                     OutboundTrafficPolicy = "ALLOW_ANY",
    ///                     SmartDns = new Tencentcloud.Tcm.Inputs.MeshConfigIstioSmartDnsArgs
    ///                     {
    ///                         IstioMetaDnsAutoAllocate = true,
    ///                         IstioMetaDnsCapture = true,
    ///                     },
    ///                 },
    ///             },
    ///             DisplayName = "test_mesh",
    ///             MeshVersion = "1.12.5",
    ///             TagLists = 
    ///             {
    ///                 new Tencentcloud.Tcm.Inputs.MeshTagListArgs
    ///                 {
    ///                     Key = "key",
    ///                     Passthrough = true,
    ///                     Value = "value",
    ///                 },
    ///             },
    ///             Type = "HOSTED",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tcm mesh can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tcm/mesh:Mesh mesh mesh_id
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tcm/mesh:Mesh")]
    public partial class Mesh : Pulumi.CustomResource
    {
        /// <summary>
        /// Mesh configuration.
        /// </summary>
        [Output("config")]
        public Output<Outputs.MeshConfig> Config { get; private set; } = null!;

        /// <summary>
        /// Mesh name.
        /// </summary>
        [Output("displayName")]
        public Output<string> DisplayName { get; private set; } = null!;

        /// <summary>
        /// Mesh ID.
        /// </summary>
        [Output("meshId")]
        public Output<string> MeshId { get; private set; } = null!;

        /// <summary>
        /// Mesh version.
        /// </summary>
        [Output("meshVersion")]
        public Output<string> MeshVersion { get; private set; } = null!;

        /// <summary>
        /// A list of associated tags.
        /// </summary>
        [Output("tagLists")]
        public Output<ImmutableArray<Outputs.MeshTagList>> TagLists { get; private set; } = null!;

        /// <summary>
        /// Mesh type.
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;


        /// <summary>
        /// Create a Mesh 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 Mesh(string name, MeshArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcm/mesh:Mesh", name, args ?? new MeshArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Mesh(string name, Input<string> id, MeshState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcm/mesh:Mesh", 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/tencentcloudstack",
            };
            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 Mesh 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 Mesh Get(string name, Input<string> id, MeshState? state = null, CustomResourceOptions? options = null)
        {
            return new Mesh(name, id, state, options);
        }
    }

    public sealed class MeshArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Mesh configuration.
        /// </summary>
        [Input("config", required: true)]
        public Input<Inputs.MeshConfigArgs> Config { get; set; } = null!;

        /// <summary>
        /// Mesh name.
        /// </summary>
        [Input("displayName", required: true)]
        public Input<string> DisplayName { get; set; } = null!;

        /// <summary>
        /// Mesh ID.
        /// </summary>
        [Input("meshId")]
        public Input<string>? MeshId { get; set; }

        /// <summary>
        /// Mesh version.
        /// </summary>
        [Input("meshVersion", required: true)]
        public Input<string> MeshVersion { get; set; } = null!;

        [Input("tagLists")]
        private InputList<Inputs.MeshTagListArgs>? _tagLists;

        /// <summary>
        /// A list of associated tags.
        /// </summary>
        public InputList<Inputs.MeshTagListArgs> TagLists
        {
            get => _tagLists ?? (_tagLists = new InputList<Inputs.MeshTagListArgs>());
            set => _tagLists = value;
        }

        /// <summary>
        /// Mesh type.
        /// </summary>
        [Input("type", required: true)]
        public Input<string> Type { get; set; } = null!;

        public MeshArgs()
        {
        }
    }

    public sealed class MeshState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Mesh configuration.
        /// </summary>
        [Input("config")]
        public Input<Inputs.MeshConfigGetArgs>? Config { get; set; }

        /// <summary>
        /// Mesh name.
        /// </summary>
        [Input("displayName")]
        public Input<string>? DisplayName { get; set; }

        /// <summary>
        /// Mesh ID.
        /// </summary>
        [Input("meshId")]
        public Input<string>? MeshId { get; set; }

        /// <summary>
        /// Mesh version.
        /// </summary>
        [Input("meshVersion")]
        public Input<string>? MeshVersion { get; set; }

        [Input("tagLists")]
        private InputList<Inputs.MeshTagListGetArgs>? _tagLists;

        /// <summary>
        /// A list of associated tags.
        /// </summary>
        public InputList<Inputs.MeshTagListGetArgs> TagLists
        {
            get => _tagLists ?? (_tagLists = new InputList<Inputs.MeshTagListGetArgs>());
            set => _tagLists = value;
        }

        /// <summary>
        /// Mesh type.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        public MeshState()
        {
        }
    }
}
