<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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.AliCloud.Ess
{
    /// <summary>
    /// Attaches/Detaches alb server group to a specified scaling group.
    /// 
    /// For information about alb server group attachment, see [AttachAlbServerGroups](https://www.alibabacloud.com/help/en/doc-detail/266800.html).
    /// 
    /// &gt; **NOTE:** If scaling group's network type is `VPC`, the alb server groups must be in the same `VPC`.
    /// 
    /// &gt; **NOTE:** Alb server group attachment is defined uniquely by `scaling_group_id`, `alb_server_group_id`, `port`.
    /// 
    /// &gt; **NOTE:** Resource `alicloud.ess.AlbServerGroupAttachment` don't support modification.
    /// 
    /// &gt; **NOTE:** Resource `alicloud.ess.AlbServerGroupAttachment` is available in 1.158.0+.
    /// 
    /// ## Import
    /// 
    /// ESS alb server groups can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:ess/albServerGroupAttachment:AlbServerGroupAttachment example asg-xxx:sgp-xxx:5000
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:ess/albServerGroupAttachment:AlbServerGroupAttachment")]
    public partial class AlbServerGroupAttachment : global::Pulumi.CustomResource
    {
        /// <summary>
        /// ID of Alb Server Group.
        /// </summary>
        [Output("albServerGroupId")]
        public Output<string> AlbServerGroupId { get; private set; } = null!;

        /// <summary>
        /// If instances of scaling group are attached/removed from slb backend server when attach/detach alb
        /// server group from scaling group. Default to false.
        /// </summary>
        [Output("forceAttach")]
        public Output<bool?> ForceAttach { get; private set; } = null!;

        /// <summary>
        /// - The port will be used for Alb Server Group backend server.
        /// </summary>
        [Output("port")]
        public Output<int> Port { get; private set; } = null!;

        /// <summary>
        /// ID of the scaling group.
        /// </summary>
        [Output("scalingGroupId")]
        public Output<string> ScalingGroupId { get; private set; } = null!;

        /// <summary>
        /// The weight of an ECS instance attached to the Alb Server Group.
        /// </summary>
        [Output("weight")]
        public Output<int> Weight { get; private set; } = null!;


        /// <summary>
        /// Create a AlbServerGroupAttachment 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 AlbServerGroupAttachment(string name, AlbServerGroupAttachmentArgs args, CustomResourceOptions? options = null)
            : base("alicloud:ess/albServerGroupAttachment:AlbServerGroupAttachment", name, args ?? new AlbServerGroupAttachmentArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AlbServerGroupAttachment(string name, Input<string> id, AlbServerGroupAttachmentState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:ess/albServerGroupAttachment:AlbServerGroupAttachment", 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/rhysmdnz/pulumi-alicloud",
            };
            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 AlbServerGroupAttachment 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 AlbServerGroupAttachment Get(string name, Input<string> id, AlbServerGroupAttachmentState? state = null, CustomResourceOptions? options = null)
        {
            return new AlbServerGroupAttachment(name, id, state, options);
        }
    }

    public sealed class AlbServerGroupAttachmentArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of Alb Server Group.
        /// </summary>
        [Input("albServerGroupId", required: true)]
        public Input<string> AlbServerGroupId { get; set; } = null!;

        /// <summary>
        /// If instances of scaling group are attached/removed from slb backend server when attach/detach alb
        /// server group from scaling group. Default to false.
        /// </summary>
        [Input("forceAttach")]
        public Input<bool>? ForceAttach { get; set; }

        /// <summary>
        /// - The port will be used for Alb Server Group backend server.
        /// </summary>
        [Input("port", required: true)]
        public Input<int> Port { get; set; } = null!;

        /// <summary>
        /// ID of the scaling group.
        /// </summary>
        [Input("scalingGroupId", required: true)]
        public Input<string> ScalingGroupId { get; set; } = null!;

        /// <summary>
        /// The weight of an ECS instance attached to the Alb Server Group.
        /// </summary>
        [Input("weight", required: true)]
        public Input<int> Weight { get; set; } = null!;

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

    public sealed class AlbServerGroupAttachmentState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// ID of Alb Server Group.
        /// </summary>
        [Input("albServerGroupId")]
        public Input<string>? AlbServerGroupId { get; set; }

        /// <summary>
        /// If instances of scaling group are attached/removed from slb backend server when attach/detach alb
        /// server group from scaling group. Default to false.
        /// </summary>
        [Input("forceAttach")]
        public Input<bool>? ForceAttach { get; set; }

        /// <summary>
        /// - The port will be used for Alb Server Group backend server.
        /// </summary>
        [Input("port")]
        public Input<int>? Port { get; set; }

        /// <summary>
        /// ID of the scaling group.
        /// </summary>
        [Input("scalingGroupId")]
        public Input<string>? ScalingGroupId { get; set; }

        /// <summary>
        /// The weight of an ECS instance attached to the Alb Server Group.
        /// </summary>
        [Input("weight")]
        public Input<int>? Weight { get; set; }

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