import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
import * as s3 from 'aws-cdk-lib/aws-s3';
import type { RuntimeAwakeMetadata } from '../../../lib/runtime-web/runtime-awake';
/**
 * Properties for RuntimeAwakeStack
 *
 * @see Requirements 18.1
 */
export interface RuntimeAwakeStackProps extends cdk.StackProps {
    /**
     * Application name for resource naming
     */
    readonly appName: string;
    /**
     * Deployment stage (dev, staging, prod)
     */
    readonly stage: 'dev' | 'staging' | 'prod';
    /**
     * List of developer IAM user ARNs allowed to use Live Dev.
     * Each developer gets an isolated IoT policy for their devId.
     *
     * @example ['arn:aws:iam::123456789012:user/john.doe']
     */
    readonly allowedDevelopers: string[];
    /**
     * Session TTL in seconds for DynamoDB auto-expiry.
     * @default 120
     */
    readonly sessionTtlSeconds?: number;
    /**
     * Payload TTL in days for S3 lifecycle rules.
     * S3 lifecycle expiration requires whole days (minimum 1 day).
     * @default 1
     */
    readonly payloadTtlDays?: number;
}
/**
 * RuntimeAwakeStack - CDK stack for Awake Lambda Development infrastructure.
 *
 * Creates the core infrastructure resources needed for Awake Lambda Development:
 * - DynamoDB session table with TTL for automatic session expiry
 * - S3 payload bucket with lifecycle rules for large payload handling
 * - IoT policies for developer isolation
 *
 * **Architecture**:
 * - Session Registry: DynamoDB table tracks active developer sessions
 * - Payload Storage: S3 bucket stores payloads exceeding 128KB MQTT limit
 * - Developer Isolation: IoT policies restrict each developer to their own topics
 *
 * **Requirements**: 18.1
 *
 * @example
 * ```typescript
 * const runtimeAwakeStack = new RuntimeAwakeStack(app, 'my-app-runtime-awake-dev', {
 *   appName: 'my-app',
 *   stage: 'dev',
 *   allowedDevelopers: [
 *     'arn:aws:iam::123456789012:user/john.doe',
 *     'arn:aws:iam::123456789012:user/jane.smith',
 *   ],
 * });
 * ```
 */
export declare class RuntimeAwakeStack extends cdk.Stack {
    /**
     * DynamoDB table for session registry.
     * Tracks active developer sessions with TTL for automatic expiry.
     */
    readonly sessionTable: dynamodb.Table;
    /**
     * S3 bucket for large payload storage.
     * Stores payloads exceeding 128KB MQTT limit with lifecycle rules.
     */
    readonly payloadBucket: s3.Bucket;
    /**
     * IoT endpoint URL for MQTT connections.
     * Retrieved from AWS IoT Core.
     */
    readonly iotEndpoint: string;
    /**
     * Map of developer IDs to their IoT policy names.
     */
    readonly developerPolicies: Map<string, string>;
    /**
     * Generated metadata for Local CLI consumption.
     */
    private readonly metadata;
    constructor(scope: Construct, id: string, props: RuntimeAwakeStackProps);
    /**
     * Create DynamoDB session table with TTL.
     *
     * Schema:
     * - PK: devId (partition key)
     * - SK: functionName (sort key)
     * - ttl: TTL attribute for automatic expiry
     *
     * @param appName - Application name
     * @param stage - Deployment stage
     * @param ttlSeconds - TTL in seconds
     * @returns DynamoDB Table
     * @private
     */
    private createSessionTable;
    /**
     * Create S3 bucket for large payload storage.
     *
     * Key pattern: `${devId}/${requestId}/${type}`
     * Lifecycle: Objects expire after configured TTL
     *
     * @param appName - Application name
     * @param stage - Deployment stage
     * @param ttlDays - TTL in days (S3 lifecycle requires whole days)
     * @returns S3 Bucket
     * @private
     */
    private createPayloadBucket;
    /**
     * Get IoT Core endpoint URL.
     *
     * Uses a custom resource to retrieve the IoT endpoint at deploy time.
     *
     * @returns IoT endpoint URL
     * @private
     */
    private getIotEndpoint;
    /**
     * Create IoT policies for developer isolation.
     *
     * Each developer gets a policy that restricts them to their own topic namespace:
     * - Connect: `${devId}-*` client IDs only
     * - Subscribe: `runtime/dev/${devId}/*` topics only
     * - Publish/Receive: `runtime/dev/${devId}/*` topics only
     *
     * @param appName - Application name
     * @param stage - Deployment stage
     * @param developerArns - List of developer IAM ARNs
     * @private
     */
    private createDeveloperPolicies;
    /**
     * Create IoT policy document for a developer.
     *
     * @param devId - Developer ID
     * @returns IoT policy document
     * @private
     */
    private createIoTPolicyDocument;
    /**
     * Extract developer ID from IAM ARN.
     *
     * @param arn - IAM user ARN
     * @returns Developer ID (username)
     * @private
     */
    private extractDevIdFromArn;
    /**
     * Create CloudFormation outputs.
     *
     * @param appName - Application name
     * @param stage - Deployment stage
     * @private
     */
    private createOutputs;
    /**
     * Get the generated metadata for Local CLI consumption.
     *
     * @returns RuntimeAwakeMetadata object
     */
    getMetadata(): RuntimeAwakeMetadata;
    /**
     * Register a handler in the metadata.
     *
     * Called by ProxyLambdaConstruct to populate handler mappings.
     *
     * @param constructId - Lambda construct ID
     * @param arn - Lambda function ARN
     * @param microserviceName - Microservice name
     * @param handlerHashKey - Handler hash key
     */
    registerHandler(constructId: string, arn: string, microserviceName: string, handlerHashKey: string): void;
}
