<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;

namespace Pulumi.Tctest.Clb
{
    [TctestResourceType("tctest:Clb/serverAttachment:ServerAttachment")]
    public partial class ServerAttachment : Pulumi.CustomResource
    {
        /// <summary>
        /// ID of the CLB.
        /// </summary>
        [Output("clbId")]
        public Output<string> ClbId { get; private set; } = null!;

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

        /// <summary>
        /// Type of protocol within the listener.
        /// </summary>
        [Output("protocolType")]
        public Output<string> ProtocolType { get; private set; } = null!;

        /// <summary>
        /// ID of the CLB listener rule. Only supports listeners of `HTTPS` and `HTTP` protocol.
        /// </summary>
        [Output("ruleId")]
        public Output<string?> RuleId { get; private set; } = null!;

        /// <summary>
        /// Information of the backends to be attached.
        /// </summary>
        [Output("targets")]
        public Output<ImmutableArray<Outputs.ServerAttachmentTarget>> Targets { get; private set; } = null!;


        /// <summary>
        /// Create a ServerAttachment 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 ServerAttachment(string name, ServerAttachmentArgs args, CustomResourceOptions? options = null)
            : base("tctest:Clb/serverAttachment:ServerAttachment", name, args ?? new ServerAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

        private ServerAttachment(string name, Input<string> id, ServerAttachmentState? state = null, CustomResourceOptions? options = null)
            : base("tctest:Clb/serverAttachment:ServerAttachment", 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 ServerAttachment 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 ServerAttachment Get(string name, Input<string> id, ServerAttachmentState? state = null, CustomResourceOptions? options = null)
        {
            return new ServerAttachment(name, id, state, options);
        }
    }

    public sealed class ServerAttachmentArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the CLB.
        /// </summary>
        [Input("clbId", required: true)]
        public Input<string> ClbId { get; set; } = null!;

        /// <summary>
        /// ID of the CLB listener.
        /// </summary>
        [Input("listenerId", required: true)]
        public Input<string> ListenerId { get; set; } = null!;

        /// <summary>
        /// ID of the CLB listener rule. Only supports listeners of `HTTPS` and `HTTP` protocol.
        /// </summary>
        [Input("ruleId")]
        public Input<string>? RuleId { get; set; }

        [Input("targets", required: true)]
        private InputList<Inputs.ServerAttachmentTargetArgs>? _targets;

        /// <summary>
        /// Information of the backends to be attached.
        /// </summary>
        public InputList<Inputs.ServerAttachmentTargetArgs> Targets
        {
            get => _targets ?? (_targets = new InputList<Inputs.ServerAttachmentTargetArgs>());
            set => _targets = value;
        }

        public ServerAttachmentArgs()
        {
        }
    }

    public sealed class ServerAttachmentState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of the CLB.
        /// </summary>
        [Input("clbId")]
        public Input<string>? ClbId { get; set; }

        /// <summary>
        /// ID of the CLB listener.
        /// </summary>
        [Input("listenerId")]
        public Input<string>? ListenerId { get; set; }

        /// <summary>
        /// Type of protocol within the listener.
        /// </summary>
        [Input("protocolType")]
        public Input<string>? ProtocolType { get; set; }

        /// <summary>
        /// ID of the CLB listener rule. Only supports listeners of `HTTPS` and `HTTP` protocol.
        /// </summary>
        [Input("ruleId")]
        public Input<string>? RuleId { get; set; }

        [Input("targets")]
        private InputList<Inputs.ServerAttachmentTargetGetArgs>? _targets;

        /// <summary>
        /// Information of the backends to be attached.
        /// </summary>
        public InputList<Inputs.ServerAttachmentTargetGetArgs> Targets
        {
            get => _targets ?? (_targets = new InputList<Inputs.ServerAttachmentTargetGetArgs>());
            set => _targets = value;
        }

        public ServerAttachmentState()
        {
        }
    }
}
