<reponame>zchase/pulumi-awsx-go// *** WARNING: this file was generated by Pulumi SDK Generator. ***
// *** 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.AwsxGo.Lb
{
    /// <summary>
    /// Attach an EC2 instance or Lambda to a Load Balancer. This will create required permissions if attaching to a Lambda Function.
    /// </summary>
    [AwsxGoResourceType("awsx-go:lb:TargetGroupAttachment")]
    public partial class TargetGroupAttachment : Pulumi.ComponentResource
    {
        /// <summary>
        /// Auto-created Lambda permission, if targeting a Lambda function
        /// </summary>
        [Output("lambdaPermission")]
        public Output<Pulumi.Aws.Lambda.Permission?> LambdaPermission { get; private set; } = null!;

        /// <summary>
        /// Underlying Target Group Attachment resource
        /// </summary>
        [Output("targetGroupAttachment")]
        public Output<Pulumi.Aws.LB.TargetGroupAttachment> Attachment { get; private set; } = null!;


        /// <summary>
        /// Create a TargetGroupAttachment 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 TargetGroupAttachment(string name, TargetGroupAttachmentArgs? args = null, ComponentResourceOptions? options = null)
            : base("awsx-go:lb:TargetGroupAttachment", name, args ?? new TargetGroupAttachmentArgs(), MakeResourceOptions(options, ""), remote: true)
        {
        }

        private static ComponentResourceOptions MakeResourceOptions(ComponentResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new ComponentResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = ComponentResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
    }

    public sealed class TargetGroupAttachmentArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
        /// </summary>
        [Input("instance")]
        public Input<Pulumi.Aws.Ec2.Instance>? Instance { get; set; }

        /// <summary>
        /// ID of an EC2 Instance to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
        /// </summary>
        [Input("instanceId")]
        public Input<string>? InstanceId { get; set; }

        /// <summary>
        /// Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
        /// </summary>
        [Input("lambda")]
        public Input<Pulumi.Aws.Lambda.Function>? Lambda { get; set; }

        /// <summary>
        /// ARN of a Lambda Function to attach to the Target Group. Exactly 1 of [instance], [instanceId], [lambda] or [lambdaArn] must be provided.
        /// </summary>
        [Input("lambdaArn")]
        public Input<string>? LambdaArn { get; set; }

        /// <summary>
        /// Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
        /// </summary>
        [Input("targetGroup")]
        public Input<Pulumi.Aws.LB.TargetGroup>? TargetGroup { get; set; }

        /// <summary>
        /// ARN of the Target Group to attach to. Exactly one of [targetGroup] or [targetGroupArn] must be specified.
        /// </summary>
        [Input("targetGroupArn")]
        public Input<string>? TargetGroupArn { get; set; }

        public TargetGroupAttachmentArgs()
        {
        }
    }
}
