import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as iam from 'aws-cdk-lib/aws-iam';
import { Construct } from 'constructs';
import { IdleMonitor } from './idle-monitor/idle-monitor';
/**
 * Custom installation step for SSM document
 * Allows users to extend the installer with additional shell commands
 */
export interface CustomInstallStep {
    /**
     * Name of the installation step
     * Must be unique within the SSM document
     *
     * @example 'InstallCustomTool'
     */
    readonly name: string;
    /**
     * Shell commands to run for this step
     * Each command will be executed in sequence
     *
     * @example ['#!/bin/bash', 'echo "Installing custom tool"', 'apt-get install -y my-tool']
     */
    readonly commands: string[];
}
/**
 * Properties for the VSCodeServer construct
 */
export interface VSCodeServerProps {
    /**
     * UserName for VSCode Server
     *
     * @default - participant
     */
    readonly vscodeUser?: string;
    /**
     * Password for VSCode Server
     *
     * @default - empty and will then be generated
     */
    readonly vscodePassword?: string;
    /**
     * VSCode Server EC2 instance name
     *
     * @default - VSCodeServer
     */
    readonly instanceName?: string;
    /**
     * VSCode Server EC2 instance volume size in GB
     *
     * @default - 40
     */
    readonly instanceVolumeSize?: number;
    /**
     * VSCode Server EC2 instance class
     *
     * @default - m7g
     */
    readonly instanceClass?: ec2.InstanceClass;
    /**
     * VSCode Server EC2 instance size
     *
     * @default - xlarge
     */
    readonly instanceSize?: ec2.InstanceSize;
    /**
     * VSCode Server EC2 operating system
     *
     * @default - Ubuntu-24
     */
    readonly instanceOperatingSystem?: LinuxFlavorType;
    /**
     * VSCode Server EC2 cpu architecture for the operating system
     *
     * @default - arm
     */
    readonly instanceCpuArchitecture?: LinuxArchitectureType;
    /**
     * Folder to open in VS Code server
     *
     * @default - /Workshop
     */
    readonly homeFolder?: string;
    /**
     * Base path for the application to be added to Nginx sites-available list
     *
     * @default - app
     */
    readonly devServerBasePath?: string;
    /**
     * Port for the DevServer
     *
     * @default - 8081
     */
    readonly devServerPort?: number;
    /**
     * Additional instance role policies
     *
     * @default - []
     */
    readonly additionalInstanceRolePolicies?: iam.PolicyStatement[];
    /**
     * Additional tags to add to the instance
     *
     * @default - {}
     */
    readonly additionalTags?: {
        [key: string]: string;
    };
    /**
     * Custom domain name for the VS Code server
     * When provided, creates a CloudFront distribution with this domain name
     * and sets up Route53 A record pointing to the distribution
     *
     * @default - uses CloudFront default domain
     */
    readonly domainName?: string;
    /**
     * Route53 hosted zone ID for the domain
     * Required when using autoCreateCertificate
     * If not provided, will attempt to lookup hosted zone from domain name
     *
     * @default - auto-discover from domain name
     */
    readonly hostedZoneId?: string;
    /**
     * ARN of existing ACM certificate for the domain
     * Certificate must be in us-east-1 region for CloudFront
     * Cannot be used together with autoCreateCertificate
     *
     * @default - auto-create certificate if autoCreateCertificate is true
     */
    readonly certificateArn?: string;
    /**
     * Auto-create ACM certificate with DNS validation in us-east-1 region
     * Requires hostedZoneId to be provided for DNS validation
     * Cannot be used together with certificateArn
     * Certificate will automatically be created in us-east-1 as required by CloudFront
     *
     * @default false
     */
    readonly autoCreateCertificate?: boolean;
    /**
     * Enable automatic instance stop when idle
     * Monitors CloudFront metrics and stops the EC2 instance after specified idle time
     *
     * @default false
     */
    readonly enableAutoStop?: boolean;
    /**
     * Minutes of inactivity before stopping the instance
     * Only applies when enableAutoStop is true
     *
     * @default 30
     */
    readonly idleTimeoutMinutes?: number;
    /**
     * How often to check for idle activity (in minutes)
     * Only applies when enableAutoStop is true
     *
     * @default 5 - Check every 5 minutes
     */
    readonly idleCheckIntervalMinutes?: number;
    /**
     * Skip instance status checks in IdleMonitor
     * When true, IdleMonitor will stop idle instances even if status checks haven't passed
     * This is useful for integration tests where status check initialization time
     * exceeds the test timeout limits
     *
     * WARNING: For testing only - in production, you should wait for status checks
     * to pass before stopping instances to avoid stopping unhealthy instances
     *
     * @default false
     */
    readonly skipStatusChecks?: boolean;
    /**
     * Remote git repository URL to clone into the home folder.
     *
     * If provided, the repository will be cloned into the user's home folder during instance setup.
     * Useful for pre-populating workshop environments with starter code.
     *
     * @example 'https://github.com/aws-samples/my-workshop-repo.git'
     * @default - no repo cloned
     */
    readonly repoUrl?: string;
    /**
     * S3 path to a zip file containing assets to extract into the home folder.
     *
     * The zip contents will be extracted to the user's home folder and committed to git.
     * Use this to provide workshop materials, sample data, or configuration files.
     *
     * @example 'my-workshop-bucket/assets/workshop-materials.zip'
     * @default - no assets downloaded
     */
    readonly assetZipS3Path?: string;
    /**
     * S3 path to a zip file containing git branches to create in the home folder repository.
     *
     * Each top-level folder in the zip becomes a separate git branch with that folder's contents.
     * Ideal for creating step-by-step workshop branches (e.g., step-1, step-2, solution).
     *
     * @example 'my-workshop-bucket/branches/lab-branches.zip' (containing folders: step-1/, step-2/, solution/)
     * @default - no branches created
     */
    readonly branchZipS3Path?: string;
    /**
     * S3 path to a zip file containing multiple folders to create as separate git repositories.
     *
     * Each top-level folder in the zip becomes a separate subfolder in the parent directory,
     * initialized as its own git repository. Useful for multi-project workshops.
     *
     * @example 'my-workshop-bucket/folders/workshop-projects.zip' (containing folders: frontend/, backend/, infrastructure/)
     * @default - no folders created
     */
    readonly folderZipS3Path?: string;
    /**
     * Custom installation steps to extend the SSM document
     *
     * Allows you to add additional shell commands that run after the standard installation steps.
     * Useful for installing workshop-specific tools, configuring custom environments, or running
     * setup scripts.
     *
     * Each step will be executed in the order provided, after all standard installation steps complete.
     *
     * @example
     * customInstallSteps: [
     *   {
     *     name: 'InstallCustomTool',
     *     commands: [
     *       '#!/bin/bash',
     *       'echo "Installing my custom tool"',
     *       'curl -O https://example.com/tool.sh',
     *       'bash tool.sh',
     *     ],
     *   },
     *   {
     *     name: 'ConfigureWorkshopEnv',
     *     commands: [
     *       '#!/bin/bash',
     *       'echo "export MY_VAR=value" >> /home/participant/.bashrc',
     *     ],
     *   },
     * ]
     *
     * @default - no custom installation steps
     */
    readonly customInstallSteps?: CustomInstallStep[];
}
/**
 * The flavor of linux you want to run vscode server on
 */
export declare enum LinuxFlavorType {
    /**
     * Ubuntu 22
     */
    UBUNTU_22 = "ubuntu22",
    /**
     * Ubuntu 24
     */
    UBUNTU_24 = "ubuntu24",
    /**
     * Ubuntu 25
     */
    UBUNTU_25 = "ubuntu25",
    /**
     * Amazon Linux 2023
     */
    AMAZON_LINUX_2023 = "al2023"
}
/**
 * The architecture of the cpu you want to run vscode server on
 */
export declare enum LinuxArchitectureType {
    /**
     * ARM architecture
     */
    ARM = "arm",
    /**
     * AMD64 architecture
     */
    AMD64 = "amd64"
}
/**
 * VSCodeServer - spin it up in under 10 minutes
 */
export declare class VSCodeServer extends Construct {
    /**
     * The name of the domain the server is reachable
     */
    readonly domainName: string;
    /**
     * The password to login to the server
     */
    readonly password: string;
    /**
     * The EC2 instance running VS Code Server
     */
    readonly instance: ec2.IInstance;
    /**
     * The IdleMonitor construct (only present if enableAutoStop is true)
     */
    readonly idleMonitor?: IdleMonitor;
    constructor(scope: Construct, id: string, props?: VSCodeServerProps);
}
