<filename>sdk/dotnet/Clb/Instance.cs// *** 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;

namespace Pulumi.Tctest.Clb
{
    [TctestResourceType("tctest:Clb/instance:Instance")]
    public partial class Instance : Pulumi.CustomResource
    {
        /// <summary>
        /// IP version, only applicable to open CLB. Valid values are `ipv4`, `ipv6` and `IPv6FullChain`.
        /// </summary>
        [Output("addressIpVersion")]
        public Output<string> AddressIpVersion { get; private set; } = null!;

        /// <summary>
        /// Bandwidth package id. If set, the `internet_charge_type` must be `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Output("bandwidthPackageId")]
        public Output<string?> BandwidthPackageId { get; private set; } = null!;

        /// <summary>
        /// Name of the CLB. The name can only contain Chinese characters, English letters, numbers, underscore and hyphen '-'.
        /// </summary>
        [Output("clbName")]
        public Output<string> ClbName { get; private set; } = null!;

        /// <summary>
        /// The virtual service address table of the CLB.
        /// </summary>
        [Output("clbVips")]
        public Output<ImmutableArray<string>> ClbVips { get; private set; } = null!;

        /// <summary>
        /// Max bandwidth out, only applicable to open CLB. Valid value ranges is [1, 2048]. Unit is MB.
        /// </summary>
        [Output("internetBandwidthMaxOut")]
        public Output<int> InternetBandwidthMaxOut { get; private set; } = null!;

        /// <summary>
        /// Internet charge type, only applicable to open CLB. Valid values are `TRAFFIC_POSTPAID_BY_HOUR`,
        /// `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Output("internetChargeType")]
        public Output<string> InternetChargeType { get; private set; } = null!;

        /// <summary>
        /// Whether the target allow flow come from clb. If value is true, only check security group of clb, or check both clb and
        /// backend instance security group.
        /// </summary>
        [Output("loadBalancerPassToTarget")]
        public Output<bool?> LoadBalancerPassToTarget { get; private set; } = null!;

        /// <summary>
        /// The id of log set.
        /// </summary>
        [Output("logSetId")]
        public Output<string?> LogSetId { get; private set; } = null!;

        /// <summary>
        /// The id of log topic.
        /// </summary>
        [Output("logTopicId")]
        public Output<string?> LogTopicId { get; private set; } = null!;

        /// <summary>
        /// Setting master zone id of cross available zone disaster recovery, only applicable to open CLB.
        /// </summary>
        [Output("masterZoneId")]
        public Output<string?> MasterZoneId { get; private set; } = null!;

        /// <summary>
        /// Type of CLB instance. Valid values: `OPEN` and `INTERNAL`.
        /// </summary>
        [Output("networkType")]
        public Output<string> NetworkType { get; private set; } = null!;

        /// <summary>
        /// ID of the project within the CLB instance, `0` - Default Project.
        /// </summary>
        [Output("projectId")]
        public Output<int?> ProjectId { get; private set; } = null!;

        /// <summary>
        /// Security groups of the CLB instance. Supports both `OPEN` and `INTERNAL` CLBs.
        /// </summary>
        [Output("securityGroups")]
        public Output<ImmutableArray<string>> SecurityGroups { get; private set; } = null!;

        /// <summary>
        /// Setting slave zone id of cross available zone disaster recovery, only applicable to open CLB. this zone will undertake
        /// traffic when the master is down.
        /// </summary>
        [Output("slaveZoneId")]
        public Output<string?> SlaveZoneId { get; private set; } = null!;

        /// <summary>
        /// Subnet ID of the CLB. Effective only for CLB within the VPC. Only supports `INTERNAL` CLBs. Default is `ipv4`.
        /// </summary>
        [Output("subnetId")]
        public Output<string?> SubnetId { get; private set; } = null!;

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

        /// <summary>
        /// Region information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Output("targetRegionInfoRegion")]
        public Output<string> TargetRegionInfoRegion { get; private set; } = null!;

        /// <summary>
        /// Vpc information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Output("targetRegionInfoVpcId")]
        public Output<string> TargetRegionInfoVpcId { get; private set; } = null!;

        /// <summary>
        /// Network operator, only applicable to open CLB. Valid values are `CMCC`(China Mobile), `CTCC`(Telecom), `CUCC`(China
        /// Unicom) and `BGP`. If this ISP is specified, network billing method can only use the bandwidth package billing
        /// (BANDWIDTH_PACKAGE).
        /// </summary>
        [Output("vipIsp")]
        public Output<string> VipIsp { get; private set; } = null!;

        /// <summary>
        /// VPC ID of the CLB.
        /// </summary>
        [Output("vpcId")]
        public Output<string> VpcId { get; private set; } = null!;

        /// <summary>
        /// Available zone id, only applicable to open CLB.
        /// </summary>
        [Output("zoneId")]
        public Output<string?> ZoneId { 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("tctest:Clb/instance:Instance", name, args ?? new InstanceArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Instance(string name, Input<string> id, InstanceState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Clb/instance:Instance", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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>
        /// IP version, only applicable to open CLB. Valid values are `ipv4`, `ipv6` and `IPv6FullChain`.
        /// </summary>
        [Input("addressIpVersion")]
        public Input<string>? AddressIpVersion { get; set; }

        /// <summary>
        /// Bandwidth package id. If set, the `internet_charge_type` must be `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Input("bandwidthPackageId")]
        public Input<string>? BandwidthPackageId { get; set; }

        /// <summary>
        /// Name of the CLB. The name can only contain Chinese characters, English letters, numbers, underscore and hyphen '-'.
        /// </summary>
        [Input("clbName", required: true)]
        public Input<string> ClbName { get; set; } = null!;

        /// <summary>
        /// Max bandwidth out, only applicable to open CLB. Valid value ranges is [1, 2048]. Unit is MB.
        /// </summary>
        [Input("internetBandwidthMaxOut")]
        public Input<int>? InternetBandwidthMaxOut { get; set; }

        /// <summary>
        /// Internet charge type, only applicable to open CLB. Valid values are `TRAFFIC_POSTPAID_BY_HOUR`,
        /// `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Input("internetChargeType")]
        public Input<string>? InternetChargeType { get; set; }

        /// <summary>
        /// Whether the target allow flow come from clb. If value is true, only check security group of clb, or check both clb and
        /// backend instance security group.
        /// </summary>
        [Input("loadBalancerPassToTarget")]
        public Input<bool>? LoadBalancerPassToTarget { get; set; }

        /// <summary>
        /// The id of log set.
        /// </summary>
        [Input("logSetId")]
        public Input<string>? LogSetId { get; set; }

        /// <summary>
        /// The id of log topic.
        /// </summary>
        [Input("logTopicId")]
        public Input<string>? LogTopicId { get; set; }

        /// <summary>
        /// Setting master zone id of cross available zone disaster recovery, only applicable to open CLB.
        /// </summary>
        [Input("masterZoneId")]
        public Input<string>? MasterZoneId { get; set; }

        /// <summary>
        /// Type of CLB instance. Valid values: `OPEN` and `INTERNAL`.
        /// </summary>
        [Input("networkType", required: true)]
        public Input<string> NetworkType { get; set; } = null!;

        /// <summary>
        /// ID of the project within the CLB instance, `0` - Default Project.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        [Input("securityGroups")]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// Security groups of the CLB instance. Supports both `OPEN` and `INTERNAL` CLBs.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Setting slave zone id of cross available zone disaster recovery, only applicable to open CLB. this zone will undertake
        /// traffic when the master is down.
        /// </summary>
        [Input("slaveZoneId")]
        public Input<string>? SlaveZoneId { get; set; }

        /// <summary>
        /// Subnet ID of the CLB. Effective only for CLB within the VPC. Only supports `INTERNAL` CLBs. Default is `ipv4`.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

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

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

        /// <summary>
        /// Region information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Input("targetRegionInfoRegion")]
        public Input<string>? TargetRegionInfoRegion { get; set; }

        /// <summary>
        /// Vpc information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Input("targetRegionInfoVpcId")]
        public Input<string>? TargetRegionInfoVpcId { get; set; }

        /// <summary>
        /// VPC ID of the CLB.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// Available zone id, only applicable to open CLB.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        public InstanceArgs()
        {
        }
    }

    public sealed class InstanceState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// IP version, only applicable to open CLB. Valid values are `ipv4`, `ipv6` and `IPv6FullChain`.
        /// </summary>
        [Input("addressIpVersion")]
        public Input<string>? AddressIpVersion { get; set; }

        /// <summary>
        /// Bandwidth package id. If set, the `internet_charge_type` must be `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Input("bandwidthPackageId")]
        public Input<string>? BandwidthPackageId { get; set; }

        /// <summary>
        /// Name of the CLB. The name can only contain Chinese characters, English letters, numbers, underscore and hyphen '-'.
        /// </summary>
        [Input("clbName")]
        public Input<string>? ClbName { get; set; }

        [Input("clbVips")]
        private InputList<string>? _clbVips;

        /// <summary>
        /// The virtual service address table of the CLB.
        /// </summary>
        public InputList<string> ClbVips
        {
            get => _clbVips ?? (_clbVips = new InputList<string>());
            set => _clbVips = value;
        }

        /// <summary>
        /// Max bandwidth out, only applicable to open CLB. Valid value ranges is [1, 2048]. Unit is MB.
        /// </summary>
        [Input("internetBandwidthMaxOut")]
        public Input<int>? InternetBandwidthMaxOut { get; set; }

        /// <summary>
        /// Internet charge type, only applicable to open CLB. Valid values are `TRAFFIC_POSTPAID_BY_HOUR`,
        /// `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`.
        /// </summary>
        [Input("internetChargeType")]
        public Input<string>? InternetChargeType { get; set; }

        /// <summary>
        /// Whether the target allow flow come from clb. If value is true, only check security group of clb, or check both clb and
        /// backend instance security group.
        /// </summary>
        [Input("loadBalancerPassToTarget")]
        public Input<bool>? LoadBalancerPassToTarget { get; set; }

        /// <summary>
        /// The id of log set.
        /// </summary>
        [Input("logSetId")]
        public Input<string>? LogSetId { get; set; }

        /// <summary>
        /// The id of log topic.
        /// </summary>
        [Input("logTopicId")]
        public Input<string>? LogTopicId { get; set; }

        /// <summary>
        /// Setting master zone id of cross available zone disaster recovery, only applicable to open CLB.
        /// </summary>
        [Input("masterZoneId")]
        public Input<string>? MasterZoneId { get; set; }

        /// <summary>
        /// Type of CLB instance. Valid values: `OPEN` and `INTERNAL`.
        /// </summary>
        [Input("networkType")]
        public Input<string>? NetworkType { get; set; }

        /// <summary>
        /// ID of the project within the CLB instance, `0` - Default Project.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

        [Input("securityGroups")]
        private InputList<string>? _securityGroups;

        /// <summary>
        /// Security groups of the CLB instance. Supports both `OPEN` and `INTERNAL` CLBs.
        /// </summary>
        public InputList<string> SecurityGroups
        {
            get => _securityGroups ?? (_securityGroups = new InputList<string>());
            set => _securityGroups = value;
        }

        /// <summary>
        /// Setting slave zone id of cross available zone disaster recovery, only applicable to open CLB. this zone will undertake
        /// traffic when the master is down.
        /// </summary>
        [Input("slaveZoneId")]
        public Input<string>? SlaveZoneId { get; set; }

        /// <summary>
        /// Subnet ID of the CLB. Effective only for CLB within the VPC. Only supports `INTERNAL` CLBs. Default is `ipv4`.
        /// </summary>
        [Input("subnetId")]
        public Input<string>? SubnetId { get; set; }

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

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

        /// <summary>
        /// Region information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Input("targetRegionInfoRegion")]
        public Input<string>? TargetRegionInfoRegion { get; set; }

        /// <summary>
        /// Vpc information of backend services are attached the CLB instance. Only supports `OPEN` CLBs.
        /// </summary>
        [Input("targetRegionInfoVpcId")]
        public Input<string>? TargetRegionInfoVpcId { get; set; }

        /// <summary>
        /// Network operator, only applicable to open CLB. Valid values are `CMCC`(China Mobile), `CTCC`(Telecom), `CUCC`(China
        /// Unicom) and `BGP`. If this ISP is specified, network billing method can only use the bandwidth package billing
        /// (BANDWIDTH_PACKAGE).
        /// </summary>
        [Input("vipIsp")]
        public Input<string>? VipIsp { get; set; }

        /// <summary>
        /// VPC ID of the CLB.
        /// </summary>
        [Input("vpcId")]
        public Input<string>? VpcId { get; set; }

        /// <summary>
        /// Available zone id, only applicable to open CLB.
        /// </summary>
        [Input("zoneId")]
        public Input<string>? ZoneId { get; set; }

        public InstanceState()
        {
        }
    }
}
