// *** 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.Tcr
{
    /// <summary>
    /// Use this resource to create tcr instance.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var foo = new Tencentcloud.Tcr.Instance("foo", new Tencentcloud.Tcr.InstanceArgs
    ///         {
    ///             InstanceType = "basic",
    ///             Tags = 
    ///             {
    ///                 { "test", "tf" },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Using public network access whitelist
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var foo = new Tencentcloud.Tcr.Instance("foo", new Tencentcloud.Tcr.InstanceArgs
    ///         {
    ///             InstanceType = "basic",
    ///             OpenPublicOperation = true,
    ///             SecurityPolicies = 
    ///             {
    ///                 new Tencentcloud.Tcr.Inputs.InstanceSecurityPolicyArgs
    ///                 {
    ///                     CidrBlock = "10.0.0.1/24",
    ///                 },
    ///                 new Tencentcloud.Tcr.Inputs.InstanceSecurityPolicyArgs
    ///                 {
    ///                     CidrBlock = "192.168.1.1",
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Create with Replications
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Config();
    ///         var tcrRegionMap = config.GetObject&lt;dynamic&gt;("tcrRegionMap") ?? 
    ///         {
    ///             { "ap-guangzhou", 1 },
    ///             { "ap-shanghai", 4 },
    ///             { "ap-hongkong", 5 },
    ///             { "ap-beijing", 8 },
    ///             { "ap-singapore", 9 },
    ///             { "na-siliconvalley", 15 },
    ///             { "ap-chengdu", 16 },
    ///             { "eu-frankfurt", 17 },
    ///             { "ap-seoul", 18 },
    ///             { "ap-chongqing", 19 },
    ///             { "ap-mumbai", 21 },
    ///             { "na-ashburn", 22 },
    ///             { "ap-bangkok", 23 },
    ///             { "eu-moscow", 24 },
    ///             { "ap-tokyo", 25 },
    ///             { "ap-nanjing", 33 },
    ///             { "ap-taipei", 39 },
    ///             { "ap-jakarta", 72 },
    ///         };
    ///         var foo = new Tencentcloud.Tcr.Instance("foo", new Tencentcloud.Tcr.InstanceArgs
    ///         {
    ///             InstanceType = "premium",
    ///             Replications = 
    ///             {
    ///                 new Tencentcloud.Tcr.Inputs.InstanceReplicationArgs
    ///                 {
    ///                     RegionId = tcrRegionMap.Ap_guangzhou,
    ///                 },
    ///                 new Tencentcloud.Tcr.Inputs.InstanceReplicationArgs
    ///                 {
    ///                     RegionId = tcrRegionMap.Ap_singapore,
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tcr instance can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tcr/instance:Instance foo cls-cda1iex1
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tcr/instance:Instance")]
    public partial class Instance : Pulumi.CustomResource
    {
        /// <summary>
        /// Indicate to delete the COS bucket which is auto-created with the instance or not.
        /// </summary>
        [Output("deleteBucket")]
        public Output<bool?> DeleteBucket { get; private set; } = null!;

        /// <summary>
        /// Instance expiration time (prepaid).
        /// </summary>
        [Output("expiredAt")]
        public Output<string> ExpiredAt { get; private set; } = null!;

        /// <summary>
        /// Length of time to purchase an instance (in month). Must set when registry_charge_type is prepaid.
        /// </summary>
        [Output("instanceChargeTypePrepaidPeriod")]
        public Output<int?> InstanceChargeTypePrepaidPeriod { get; private set; } = null!;

        /// <summary>
        /// Auto renewal flag. 1: manual renewal, 2: automatic renewal, 3: no renewal and no notification. Must set when registry_charge_type is prepaid.
        /// </summary>
        [Output("instanceChargeTypePrepaidRenewFlag")]
        public Output<int?> InstanceChargeTypePrepaidRenewFlag { get; private set; } = null!;

        /// <summary>
        /// TCR types. Valid values are: `standard`, `basic`, `premium`.
        /// </summary>
        [Output("instanceType")]
        public Output<string> InstanceType { get; private set; } = null!;

        /// <summary>
        /// Internal address for access of the TCR instance.
        /// </summary>
        [Output("internalEndPoint")]
        public Output<string> InternalEndPoint { get; private set; } = null!;

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

        /// <summary>
        /// Control public network access.
        /// </summary>
        [Output("openPublicOperation")]
        public Output<bool?> OpenPublicOperation { get; private set; } = null!;

        /// <summary>
        /// Public address for access of the TCR instance.
        /// </summary>
        [Output("publicDomain")]
        public Output<string> PublicDomain { get; private set; } = null!;

        /// <summary>
        /// Status of the TCR instance public network access.
        /// </summary>
        [Output("publicStatus")]
        public Output<string> PublicStatus { get; private set; } = null!;

        /// <summary>
        /// Charge type of instance. 1: postpaid; 2: prepaid. Default is postpaid.
        /// </summary>
        [Output("registryChargeType")]
        public Output<int?> RegistryChargeType { get; private set; } = null!;

        /// <summary>
        /// Specify List of instance Replications, premium only. The available [source region list](https://www.tencentcloud.com/document/api/1051/41101) is here.
        /// </summary>
        [Output("replications")]
        public Output<ImmutableArray<Outputs.InstanceReplication>> Replications { get; private set; } = null!;

        /// <summary>
        /// Public network access allowlist policies of the TCR instance. Only available when `open_public_operation` is `true`.
        /// </summary>
        [Output("securityPolicies")]
        public Output<ImmutableArray<Outputs.InstanceSecurityPolicy>> SecurityPolicies { get; private set; } = null!;

        /// <summary>
        /// Status of the TCR instance.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// The available tags within this TCR instance.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;


        /// <summary>
        /// Create a Instance 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 Instance(string name, InstanceArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcr/instance:Instance", name, args ?? new InstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Instance(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tcr/instance:Instance", 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 Instance 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 Instance Get(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
        {
            return new Instance(name, id, state, options);
        }
    }

    public sealed class InstanceArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Indicate to delete the COS bucket which is auto-created with the instance or not.
        /// </summary>
        [Input("deleteBucket")]
        public Input<bool>? DeleteBucket { get; set; }

        /// <summary>
        /// Length of time to purchase an instance (in month). Must set when registry_charge_type is prepaid.
        /// </summary>
        [Input("instanceChargeTypePrepaidPeriod")]
        public Input<int>? InstanceChargeTypePrepaidPeriod { get; set; }

        /// <summary>
        /// Auto renewal flag. 1: manual renewal, 2: automatic renewal, 3: no renewal and no notification. Must set when registry_charge_type is prepaid.
        /// </summary>
        [Input("instanceChargeTypePrepaidRenewFlag")]
        public Input<int>? InstanceChargeTypePrepaidRenewFlag { get; set; }

        /// <summary>
        /// TCR types. Valid values are: `standard`, `basic`, `premium`.
        /// </summary>
        [Input("instanceType", required: true)]
        public Input<string> InstanceType { get; set; } = null!;

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

        /// <summary>
        /// Control public network access.
        /// </summary>
        [Input("openPublicOperation")]
        public Input<bool>? OpenPublicOperation { get; set; }

        /// <summary>
        /// Charge type of instance. 1: postpaid; 2: prepaid. Default is postpaid.
        /// </summary>
        [Input("registryChargeType")]
        public Input<int>? RegistryChargeType { get; set; }

        [Input("replications")]
        private InputList<Inputs.InstanceReplicationArgs>? _replications;

        /// <summary>
        /// Specify List of instance Replications, premium only. The available [source region list](https://www.tencentcloud.com/document/api/1051/41101) is here.
        /// </summary>
        public InputList<Inputs.InstanceReplicationArgs> Replications
        {
            get => _replications ?? (_replications = new InputList<Inputs.InstanceReplicationArgs>());
            set => _replications = value;
        }

        [Input("securityPolicies")]
        private InputList<Inputs.InstanceSecurityPolicyArgs>? _securityPolicies;

        /// <summary>
        /// Public network access allowlist policies of the TCR instance. Only available when `open_public_operation` is `true`.
        /// </summary>
        public InputList<Inputs.InstanceSecurityPolicyArgs> SecurityPolicies
        {
            get => _securityPolicies ?? (_securityPolicies = new InputList<Inputs.InstanceSecurityPolicyArgs>());
            set => _securityPolicies = value;
        }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// The available tags within this TCR instance.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public InstanceArgs()
        {
        }
    }

    public sealed class InstanceState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Indicate to delete the COS bucket which is auto-created with the instance or not.
        /// </summary>
        [Input("deleteBucket")]
        public Input<bool>? DeleteBucket { get; set; }

        /// <summary>
        /// Instance expiration time (prepaid).
        /// </summary>
        [Input("expiredAt")]
        public Input<string>? ExpiredAt { get; set; }

        /// <summary>
        /// Length of time to purchase an instance (in month). Must set when registry_charge_type is prepaid.
        /// </summary>
        [Input("instanceChargeTypePrepaidPeriod")]
        public Input<int>? InstanceChargeTypePrepaidPeriod { get; set; }

        /// <summary>
        /// Auto renewal flag. 1: manual renewal, 2: automatic renewal, 3: no renewal and no notification. Must set when registry_charge_type is prepaid.
        /// </summary>
        [Input("instanceChargeTypePrepaidRenewFlag")]
        public Input<int>? InstanceChargeTypePrepaidRenewFlag { get; set; }

        /// <summary>
        /// TCR types. Valid values are: `standard`, `basic`, `premium`.
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// Internal address for access of the TCR instance.
        /// </summary>
        [Input("internalEndPoint")]
        public Input<string>? InternalEndPoint { get; set; }

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

        /// <summary>
        /// Control public network access.
        /// </summary>
        [Input("openPublicOperation")]
        public Input<bool>? OpenPublicOperation { get; set; }

        /// <summary>
        /// Public address for access of the TCR instance.
        /// </summary>
        [Input("publicDomain")]
        public Input<string>? PublicDomain { get; set; }

        /// <summary>
        /// Status of the TCR instance public network access.
        /// </summary>
        [Input("publicStatus")]
        public Input<string>? PublicStatus { get; set; }

        /// <summary>
        /// Charge type of instance. 1: postpaid; 2: prepaid. Default is postpaid.
        /// </summary>
        [Input("registryChargeType")]
        public Input<int>? RegistryChargeType { get; set; }

        [Input("replications")]
        private InputList<Inputs.InstanceReplicationGetArgs>? _replications;

        /// <summary>
        /// Specify List of instance Replications, premium only. The available [source region list](https://www.tencentcloud.com/document/api/1051/41101) is here.
        /// </summary>
        public InputList<Inputs.InstanceReplicationGetArgs> Replications
        {
            get => _replications ?? (_replications = new InputList<Inputs.InstanceReplicationGetArgs>());
            set => _replications = value;
        }

        [Input("securityPolicies")]
        private InputList<Inputs.InstanceSecurityPolicyGetArgs>? _securityPolicies;

        /// <summary>
        /// Public network access allowlist policies of the TCR instance. Only available when `open_public_operation` is `true`.
        /// </summary>
        public InputList<Inputs.InstanceSecurityPolicyGetArgs> SecurityPolicies
        {
            get => _securityPolicies ?? (_securityPolicies = new InputList<Inputs.InstanceSecurityPolicyGetArgs>());
            set => _securityPolicies = value;
        }

        /// <summary>
        /// Status of the TCR instance.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// The available tags within this TCR instance.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public InstanceState()
        {
        }
    }
}
