import * as SDK from 'aws-sdk'; import { AWS } from "./AWS"; import { EC2 } from "./EC2"; import { VPC } from "./VPC"; import { CUR } from "./CUR"; export declare namespace ELB { class TargetGroup extends AWS.Resource { type: TargetGroup.Type; private _targets; static isTypeOf(resource: AWS.Resource): resource is TargetGroup; static new(session: AWS.Session, name?: string, type?: TargetGroup.Type): TargetGroup; private constructor(); protected updateChildren(): Promise; hasType(): boolean; } namespace TargetGroup { type Type = "instance" | "ip" | "lambda" | ""; const type: AWS.Resource.Kind; } class LoadBalancer extends AWS.Resource { scheme: string; dnsName: string; hostedZone: string; zones: LoadBalancer.Zone[]; securityGroups: string[]; type: LoadBalancer.Type; private _vpc; protected _listeners: LoadBalancer.Listener[] | undefined; static isTypeOf(resource: AWS.Resource): resource is LoadBalancer; static new(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: LoadBalancer.Zone[], securityGroups?: string[], vpc?: VPC): LoadBalancer; protected constructor(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: LoadBalancer.Zone[], securityGroups?: string[], vpc?: VPC, type?: LoadBalancer.Type); protected updateChildren(): Promise; isClassic(): this is ClassicLoadBalancer; isApplication(): this is ApplicationLoadBalancer; isNetwork(): this is NetworkLoadBalancer; hasDnsName(): boolean; hasScheme(): boolean; hasHostedZone(): boolean; hasZones(): boolean; hasSecurityGroups(): boolean; setListeners(listeners: LoadBalancer.Listener[]): void; hasListeners(): Promise; listeners: () => Promise; get vpc(): VPC | undefined; hasType(): boolean; getSubnet(az: string): string | undefined; hasCompatibleZonesWith(that: LoadBalancer): boolean; hasDisjointListenersWith(that: LoadBalancer): Promise; create(): Promise; } namespace LoadBalancer { const type = "ELB.LoadBalancer"; type Type = "Classic" | "Application" | "Network" | "Gateway" | ""; class Zone { az: string; subnet: string; constructor(az?: string, subnet?: string); hasAZ(): boolean; hasSubnet(): boolean; } abstract class Listener extends AWS.Resource { protocol: Listener.Protocol; port: number; certificates: Array; loadBalancer: LoadBalancer; protected constructor(session: AWS.Session, loadBalancer: LoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array); protected updateChildren(): Promise; hasCertificates(): boolean; } namespace Listener { const type = "ELB.LoadBalancer.Listener"; } namespace Listener { type Protocol = ApplicationLoadBalancer.Listener.Protocol | NetworkLoadBalancer.Listener.Protocol | ClassicLoadBalancer.Listener.Protocol | ""; } } class ClassicLoadBalancer extends LoadBalancer { status: string; type: "Classic"; protected _listeners: ClassicLoadBalancer.Listener[]; private _instances; static new(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: LoadBalancer.Zone[], securityGroups?: string[], vpc?: VPC, instances?: EC2.Instance[]): ClassicLoadBalancer; protected constructor(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: LoadBalancer.Zone[], securityGroups?: string[], vpc?: VPC, instances?: EC2.Instance[]); protected updateChildren(): Promise; hasInstances(): boolean; listeners: () => Promise; hasOSI7Listeners(): Promise; hasOSI4Listeners(): Promise; isEC2Classic(): boolean; create(): Promise; } abstract class ModernLoadBalancer extends LoadBalancer { arn: string; status: string; protected _listeners: Array | undefined; private _attributes; private _targetGroups; type: "Application" | "Network" | "Gateway"; protected constructor(session: AWS.Session, arn?: string, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: Array, securityGroups?: Array, vpc?: VPC, status?: string, type?: LoadBalancer.Type); hasArn(): boolean; hasStatus(): boolean; protected updateChildren(): Promise; abstract supports(protocol: string): protocol is ModernLoadBalancer.Listener.Protocol; protected abstract getListeners(elb2: SDK.ELBv2): Promise>; listeners: () => Promise; private getAttributes; attributes: () => Promise; private getTargetGroups; targetGroups: () => Promise; protected abstract createListeners(elb2: SDK.ELBv2, arn: string): Promise; create(): Promise; } namespace ModernLoadBalancer { type Attributes = { [key: string]: string; }; abstract class Listener extends LoadBalancer.Listener { protocol: Listener.Protocol; sslPolicy: string; defaultRule: ModernLoadBalancer.Listener.Rule | null; loadBalancer: ModernLoadBalancer; protected constructor(session: AWS.Session, loadBalancer: ModernLoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array, sslPolicy?: string, defaultRule?: ModernLoadBalancer.Listener.Rule); hasSslPolicy(): boolean; } namespace Listener { type Protocol = ApplicationLoadBalancer.Listener.Protocol | NetworkLoadBalancer.Listener.Protocol; type Action = NetworkLoadBalancer.Listener.ForwardAction; abstract class Rule { actions: Array; constructor(actions?: Array); hasActions(): boolean; } } } class ApplicationLoadBalancer extends ModernLoadBalancer { type: "Application"; protected _listeners: Array | undefined; static new(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: Array, securityGroups?: Array, vpc?: VPC, arn?: string, status?: string): ApplicationLoadBalancer; private constructor(); supports(protocol: string): protocol is ApplicationLoadBalancer.Listener.Protocol; private _getListeners; protected getListeners(elb2: SDK.ELBv2): Promise>; protected createListeners(elb2: SDK.ELBv2, arn: string): Promise; } class NetworkLoadBalancer extends ModernLoadBalancer { type: "Network"; protected _listeners: Array | undefined; static new(session: AWS.Session, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: Array, securityGroups?: Array, vpc?: VPC, arn?: string, status?: string): NetworkLoadBalancer; protected constructor(session: AWS.Session, arn?: string, name?: string, dnsName?: string, scheme?: string, hostedZone?: string, zones?: Array, securityGroups?: Array, vpc?: VPC, status?: string); supports(protocol: string): protocol is NetworkLoadBalancer.Listener.Protocol; private _getListeners; protected getListeners(elb2: SDK.ELBv2): Promise>; protected createListeners(elb2: SDK.ELBv2, arn: string): Promise; } namespace ClassicLoadBalancer { class Listener extends LoadBalancer.Listener { protocol: ClassicLoadBalancer.Listener.Protocol; destinationProtocol: ClassicLoadBalancer.Listener.Protocol; destinationPort: number; loadBalancer: ClassicLoadBalancer; static new(session: AWS.Session, loadBalancer: ClassicLoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array, destinationProtocol?: ClassicLoadBalancer.Listener.Protocol, destinationPort?: number): ClassicLoadBalancer.Listener; protected constructor(session: AWS.Session, loadBalancer: ClassicLoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array, destinationProtocol?: ClassicLoadBalancer.Listener.Protocol, destinationPort?: number); protected updateChildren(): Promise; hasDestinationProtocol(): boolean; hasDestinationPort(): boolean; isOSI7(): boolean; isOSI4(): boolean; } namespace Listener { type Protocol = "HTTP" | "HTTPS" | "TCP" | "SSL" | ""; } } namespace NetworkLoadBalancer { class Listener extends ModernLoadBalancer.Listener { protocol: NetworkLoadBalancer.Listener.Protocol; defaultRule: NetworkLoadBalancer.Listener.Rule | null; alpnPolicy: Array; loadBalancer: NetworkLoadBalancer; static new(session: AWS.Session, loadBalancer: NetworkLoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array, sslPolicy?: string, defaultRule?: NetworkLoadBalancer.Listener.Rule, alpnPolicy?: Array): NetworkLoadBalancer.Listener; protected constructor(session: AWS.Session, loadBalancer: NetworkLoadBalancer, protocol?: LoadBalancer.Listener.Protocol, port?: number, certificates?: Array, sslPolicy?: string, defaultRule?: NetworkLoadBalancer.Listener.Rule, alpnPolicy?: Array); hasAlpnPolicy(): boolean; } namespace Listener { type Protocol = "TCP" | "TLS" | "UDP" | "TCP_UDP"; function isProtocol(protocol: string): protocol is Protocol; class Rule extends ModernLoadBalancer.Listener.Rule { actions: Array; constructor(actions: Array); } class ForwardAction { targetGroup: string; stickiness: boolean; stickinessDuration: number; constructor(targetGroup: string, stickiness?: boolean, stickinessDuration?: number); hasStickinessDuration(): boolean; } } } namespace ApplicationLoadBalancer { class Listener extends ModernLoadBalancer.Listener { static new(session: AWS.Session, loadBalancer: ApplicationLoadBalancer, protocol?: ApplicationLoadBalancer.Listener.Protocol, port?: number, certificates?: Array, sslPolicy?: string, defaultRule?: ApplicationLoadBalancer.Listener.Rule, alpnPolicy?: Array): ApplicationLoadBalancer.Listener; } namespace Listener { type Protocol = "HTTP" | "HTTPS"; function isProtocol(protocol: string): protocol is Protocol; class Rule extends ModernLoadBalancer.Listener.Rule { } } } class LoadBalancers extends Array { static describeClassicLoadBalancers(session: AWS.Session, loadBalancers?: ClassicLoadBalancer[], token?: string): Promise; static describeLoadBalancers(session: AWS.Session, loadBalancers?: LoadBalancer[], token?: string, maxResults?: number): Promise; static fetch(session: AWS.Session): Promise; static costs(account: string, curSession: AWS.Session, catalog: string, database: string, table: string, outputLocation: string, year: number): Promise; } namespace Consolidation { type Resource = { vpc?: string; az?: string; subnet?: string; id: string; }; namespace ClassicLoadBalancer { function getResources(session: AWS.Session, instanceIds: Array): Promise>; } } }