import * as core from 'aws-cdk-lib'; import { aws_iam as iam } from 'aws-cdk-lib'; import { Construct } from 'constructs'; import { WeightedTargetGroup, HTTPMatch, IService } from './index'; /** * AuthTypes */ export declare enum AuthType { /** * No Authorization */ NONE = "NONE", /** * Use IAM Policy as */ AWS_IAM = "AWS_IAM" } /** * HTTP/HTTPS methods */ export declare enum Protocol { /** * HTTP Protocol */ HTTP = "HTTP", /** * HTTPS Protocol */ HTTPS = "HTTPS" } /** * Fixed response codes */ export declare enum FixedResponse { /** * Not Found 404 */ NOT_FOUND = 404, /** * OK 200 */ OK = 200 } /** * HTTP Methods */ export declare enum HTTPMethods { /** * GET Method */ GET = "GET", /** * POST Method */ POST = "POST", /** * PUT Method */ PUT = "PUT", /** * Delete Method */ DELETE = "DELETE" } /** * Operators for Matches */ export declare enum MatchOperator { /** * Contains Match */ CONTAINS = "CONTAINS", /** * Exact Match */ EXACT = "EXACT", /** * Prefix Match */ PREFIX = "PREFIX" } /** * Operators for Path Matches */ export declare enum PathMatchType { /** * Exact Match */ EXACT = "EXACT", /** * Prefix Match */ PREFIX = "PREFIX" } /** * Access mode for the rule. */ export declare enum RuleAccessMode { /** * Unauthenticated Access */ UNAUTHENTICATED = "UNAUTHENTICATED", /** * Unauthenticated Access */ AUTHENTICATED_ONLY = "AUTHENTICATED", /** * THIS Org only */ ORG_ONLY = "ORG_ONLY", /** * Do not create a s */ NO_STATEMENT = "NO_STATEMENT" } /** * A default listener action. * one of fixed response or forward needs to be provided. */ export interface DefaultListenerAction { /** * Provide a fixed Response * @default none */ readonly fixedResponse?: FixedResponse; /** * Forward to a target group * @default none */ readonly forward?: WeightedTargetGroup; } /** * Propertys to Create a Lattice Listener */ export interface ListenerProps { /** * * A default action that will be taken if no rules match. * @default 404 NOT Found */ readonly defaultAction?: DefaultListenerAction | undefined; /** * protocol that the listener will listen on * @default HTTPS */ readonly protocol?: Protocol | undefined; /** * Optional port number for the listener. If not supplied, will default to 80 or 443, depending on the Protocol * @default 80 or 443 depending on the Protocol */ readonly port?: number | undefined; /** * The Name of the service. * @default CloudFormation provided name. */ readonly name?: string; /** * The Id of the service that this listener is associated with. */ readonly service: IService; /** * rules for the listener */ readonly rules?: RuleProp[] | undefined; } /** * Create a vpcLattice Listener. * Implemented by `Listener`. */ export interface IListener extends core.IResource { /** * The Amazon Resource Name (ARN) of the service. */ readonly listenerArn: string; /** * The Id of the Service Network */ readonly listenerId: string; /** * Add A Listener Rule to the Listener */ addListenerRule(props: RuleProp): void; } /** * Properties to add rules to to a listener * One of headerMatch, PathMatch, or methodMatch can be supplied, * the Rule can not match multiple Types */ export interface RuleProp { /** * A name for the the Rule */ readonly name: string; /** * the action for the rule, is either a fixed Reponse, or a being sent to Weighted TargetGroup */ readonly action: FixedResponse | WeightedTargetGroup[]; /** * the priority of this rule, a lower priority will be processed first * @default 50 */ readonly priority?: number; /** * the Matching criteria for the rule. This must contain at least one of * header, method or patchMatches */ readonly httpMatch: HTTPMatch; /** * List of principals that are allowed to access the resource * @default none */ readonly allowedPrincipals?: iam.IPrincipal[] | undefined; /** * List of principalArns that are allowed to access the resource * @default none */ readonly allowedPrincipalArn?: string[] | undefined; /** * Set an access mode. * @default false */ readonly accessMode?: RuleAccessMode | undefined; } /** * This class should not be called directly. * Use the .addListener() Method on an instance of LatticeService * Creates a vpcLattice Listener */ export declare class Listener extends core.Resource implements IListener { /** * The Id of the Listener */ readonly listenerId: string; /** * THe Arn of the Listener */ readonly listenerArn: string; /** * A list of prioritys, to check for duplicates */ listenerPrioritys: number[]; /** * The service this listener is attached to */ service: IService; /** * Service auth Policy * @default none. */ constructor(scope: Construct, id: string, props: ListenerProps); /** * add a rule to the listener * @param props AddRuleProps */ addListenerRule(props: RuleProp): void; }