import * as cloudwatch from "../../../aws-cloudwatch";
import * as ec2 from "../../../aws-ec2";
import { Duration } from "../../../core";
import { IConstruct, Construct } from 'constructs';
import { BaseTargetGroupProps, ITargetGroup, LoadBalancerTargetProps, TargetGroupAttributes, TargetGroupBase } from '../shared/base-target-group';
import { ApplicationProtocol, ApplicationProtocolVersion } from '../shared/enums';
import { IApplicationListener } from './application-listener';
import { HttpCodeTarget } from './application-load-balancer';
/**
 * (experimental) Properties for defining an Application Target Group.
 *
 * @experimental
 */
export interface ApplicationTargetGroupProps extends BaseTargetGroupProps {
    /**
     * (experimental) The protocol to use.
     *
     * @default - Determined from port if known, optional for Lambda targets.
     * @experimental
     */
    readonly protocol?: ApplicationProtocol;
    /**
     * (experimental) The protocol version to use.
     *
     * @default ApplicationProtocolVersion.HTTP1
     * @experimental
     */
    readonly protocolVersion?: ApplicationProtocolVersion;
    /**
     * (experimental) The port on which the listener listens for requests.
     *
     * @default - Determined from protocol if known, optional for Lambda targets.
     * @experimental
     */
    readonly port?: number;
    /**
     * (experimental) The time period during which the load balancer sends a newly registered target a linearly increasing share of the traffic to the target group.
     *
     * The range is 30-900 seconds (15 minutes).
     *
     * @default 0
     * @experimental
     */
    readonly slowStart?: Duration;
    /**
     * (experimental) The stickiness cookie expiration period.
     *
     * Setting this value enables load balancer stickiness.
     *
     * After this period, the cookie is considered stale. The minimum value is
     * 1 second and the maximum value is 7 days (604800 seconds).
     *
     * @default Duration.days(1)
     * @experimental
     */
    readonly stickinessCookieDuration?: Duration;
    /**
     * (experimental) The name of an application-based stickiness cookie.
     *
     * Names that start with the following prefixes are not allowed: AWSALB, AWSALBAPP,
     * and AWSALBTG; they're reserved for use by the load balancer.
     *
     * Note: `stickinessCookieName` parameter depends on the presence of `stickinessCookieDuration` parameter.
     * If `stickinessCookieDuration` is not set, `stickinessCookieName` will be omitted.
     *
     * @default - If `stickinessCookieDuration` is set, a load-balancer generated cookie is used. Otherwise, no stickiness is defined.
     * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
     * @experimental
     */
    readonly stickinessCookieName?: string;
    /**
     * (experimental) The targets to add to this target group.
     *
     * Can be `Instance`, `IPAddress`, or any self-registering load balancing
     * target. If you use either `Instance` or `IPAddress` as targets, all
     * target must be of the same type.
     *
     * @default - No targets.
     * @experimental
     */
    readonly targets?: IApplicationLoadBalancerTarget[];
}
/**
 * (experimental) Define an Application Target Group.
 *
 * @experimental
 */
export declare class ApplicationTargetGroup extends TargetGroupBase implements IApplicationTargetGroup {
    /**
     * (experimental) Import an existing target group.
     *
     * @experimental
     */
    static fromTargetGroupAttributes(scope: Construct, id: string, attrs: TargetGroupAttributes): IApplicationTargetGroup;
    private readonly connectableMembers;
    private readonly listeners;
    private readonly protocol?;
    private readonly port?;
    /**
     * @experimental
     */
    constructor(scope: Construct, id: string, props?: ApplicationTargetGroupProps);
    /**
     * (experimental) Add a load balancing target to this target group.
     *
     * @experimental
     */
    addTarget(...targets: IApplicationLoadBalancerTarget[]): void;
    /**
     * (experimental) Enable sticky routing via a cookie to members of this target group.
     *
     * Note: If the `cookieName` parameter is set, application-based stickiness will be applied,
     * otherwise it defaults to duration-based stickiness attributes (`lb_cookie`).
     *
     * @see https://docs.aws.amazon.com/elasticloadbalancing/latest/application/sticky-sessions.html
     * @experimental
     */
    enableCookieStickiness(duration: Duration, cookieName?: string): void;
    /**
     * (experimental) Register a connectable as a member of this target group.
     *
     * Don't call this directly. It will be called by load balancing targets.
     *
     * @experimental
     */
    registerConnectable(connectable: ec2.IConnectable, portRange?: ec2.Port): void;
    /**
     * (experimental) Register a listener that is load balancing to this target group.
     *
     * Don't call this directly. It will be called by listeners.
     *
     * @experimental
     */
    registerListener(listener: IApplicationListener, associatingConstruct?: IConstruct): void;
    /**
     * (experimental) Full name of first load balancer.
     *
     * @experimental
     */
    get firstLoadBalancerFullName(): string;
    /**
     * (experimental) Return the given named metric for this Application Load Balancer Target Group.
     *
     * Returns the metric for this target group from the point of view of the first
     * load balancer load balancing to it. If you have multiple load balancers load
     * sending traffic to the same target group, you will have to override the dimensions
     * on this metric.
     *
     * @default Average over 5 minutes
     * @experimental
     */
    metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of IPv6 requests received by the target group.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricIpv6RequestCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of requests processed over IPv4 and IPv6.
     *
     * This count includes only the requests with a response generated by a target of the load balancer.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricRequestCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of healthy hosts in the target group.
     *
     * @default Average over 5 minutes
     * @experimental
     */
    metricHealthyHostCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of unhealthy hosts in the target group.
     *
     * @default Average over 5 minutes
     * @experimental
     */
    metricUnhealthyHostCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of HTTP 2xx/3xx/4xx/5xx response codes generated by all targets in this target group.
     *
     * This does not include any response codes generated by the load balancer.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The average number of requests received by each target in a target group.
     *
     * The only valid statistic is Sum. Note that this represents the average not the sum.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricRequestCountPerTarget(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of connections that were not successfully established between the load balancer and target.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricTargetConnectionErrorCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The time elapsed, in seconds, after the request leaves the load balancer until a response from the target is received.
     *
     * @default Average over 5 minutes
     * @experimental
     */
    metricTargetResponseTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) The number of TLS connections initiated by the load balancer that did not establish a session with the target.
     *
     * Possible causes include a mismatch of ciphers or protocols.
     *
     * @default Sum over 5 minutes
     * @experimental
     */
    metricTargetTLSNegotiationErrorCount(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * @experimental
     */
    protected validateTargetGroup(): string[];
    private cannedMetric;
}
/**
 * (experimental) A Target Group for Application Load Balancers.
 *
 * @experimental
 */
export interface IApplicationTargetGroup extends ITargetGroup {
    /**
     * (experimental) Register a listener that is load balancing to this target group.
     *
     * Don't call this directly. It will be called by listeners.
     *
     * @experimental
     */
    registerListener(listener: IApplicationListener, associatingConstruct?: IConstruct): void;
    /**
     * (experimental) Register a connectable as a member of this target group.
     *
     * Don't call this directly. It will be called by load balancing targets.
     *
     * @experimental
     */
    registerConnectable(connectable: ec2.IConnectable, portRange?: ec2.Port): void;
    /**
     * (experimental) Add a load balancing target to this target group.
     *
     * @experimental
     */
    addTarget(...targets: IApplicationLoadBalancerTarget[]): void;
}
/**
 * (experimental) Interface for constructs that can be targets of an application load balancer.
 *
 * @experimental
 */
export interface IApplicationLoadBalancerTarget {
    /**
     * (experimental) Attach load-balanced target to a TargetGroup.
     *
     * May return JSON to directly add to the [Targets] list, or return undefined
     * if the target will register itself with the load balancer.
     *
     * @experimental
     */
    attachToApplicationTargetGroup(targetGroup: IApplicationTargetGroup): LoadBalancerTargetProps;
}
