import { Construct } from "constructs";
import { DistributionDomainProps } from "./Distribution.js";
import { SSTConstruct } from "./Construct.js";
import { Permissions } from "./util/permission.js";
import { FunctionBindingProps } from "./util/functionBinding.js";
import { IVpc } from "aws-cdk-lib/aws-ec2";
import { Cluster, ContainerDefinitionOptions } from "aws-cdk-lib/aws-ecs";
import { RetentionDays } from "aws-cdk-lib/aws-logs";
declare const supportedCpus: {
    "0.25 vCPU": number;
    "0.5 vCPU": number;
    "1 vCPU": number;
    "2 vCPU": number;
    "4 vCPU": number;
    "8 vCPU": number;
    "16 vCPU": number;
};
export interface ServiceDomainProps extends DistributionDomainProps {
}
export interface ServiceProps {
    /**
     * Path to the directory where the app is located.
     * @default "."
     */
    path?: string;
    /**
     * Path to Dockerfile relative to the defined "path".
     * @default "Dockerfile"
     */
    file?: string;
    /**
     * The amount of cpu allocated.
     * @default "0.25 vCPU"
     * @example
     * ```js
     * {
     *   cpu: "1 vCPU",
     * }
     *```
     */
    cpu?: keyof typeof supportedCpus;
    /**
     * The amount of memory allocated.
     * @default "0.5 GB"
     * @example
     * ```js
     * {
     *   memory: "2 GB",
     * }
     *```
     */
    memory?: `${number} GB`;
    /**
     * The port number on the container.
     * @default 3000
     * @example
     * ```js
     * {
     *   port: 8000,
     * }
     *```
     */
    port?: number;
    scaling?: {
        /**
         * The minimum capacity for the cluster.
         * @default 1
         * @example
         * ```js
         * {
         *   scaling: {
         *    minContainers: 4,
         *    maxContainers: 16,
         *   },
         * }
         *```
         */
        minContainers?: number;
        /**
         * The maximum capacity for the cluster.
         * @default 1
         * @example
         * ```js
         * {
         *   scaling: {
         *    minContainers: 4,
         *    maxContainers: 16,
         *   },
         * }
         *```
         */
        maxContainers?: number;
        /**
         * Scales in or out to achieve a target cpu utilization.
         * @default 70
         * @example
         * ```js
         * {
         *   scaling: {
         *    cpuUtilization: 50,
         *    memoryUtilization: 50,
         *   },
         * }
         *```
         */
        cpuUtilization?: number;
        /**
         * Scales in or out to achieve a target memory utilization.
         * @default 70
         * @example
         * ```js
         * {
         *   scaling: {
         *    cpuUtilization: 50,
         *    memoryUtilization: 50,
         *   },
         * }
         *```
         */
        memoryUtilization?: number;
        /**
         * Scales in or out to achieve a target request count per container.
         * @default 500
         * @example
         * ```js
         * {
         *   scaling: {
         *    requestsPerContainer: 1000,
         *   },
         * }
         *```
         */
        requestsPerContainer?: number;
    };
    /**
     * Bind resources for the function
     *
     * @example
     * ```js
     * {
     *   bind: [STRIPE_KEY, bucket],
     * }
     * ```
     */
    bind?: SSTConstruct[];
    /**
     * The customDomain for this service. SST supports domains that are hosted
     * either on [Route 53](https://aws.amazon.com/route53/) or externally.
     *
     * Note that you can also migrate externally hosted domains to Route 53 by
     * [following this guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html).
     *
     * @example
     * ```js
     * {
     *   customDomain: "domain.com",
     * }
     * ```
     *
     * ```js
     * {
     *   customDomain: {
     *     domainName: "domain.com",
     *     domainAlias: "www.domain.com",
     *     hostedZone: "domain.com"
     *   }
     * }
     * ```
     */
    customDomain?: string | ServiceDomainProps;
    /**
     * Attaches the given list of permissions to the SSR function. Configuring this property is equivalent to calling `attachPermissions()` after the site is created.
     * @example
     * ```js
     * {
     *   permissions: ["ses"]
     * }
     * ```
     */
    permissions?: Permissions;
    /**
     * An object with the key being the environment variable name.
     *
     * @example
     * ```js
     * {
     *   environment: {
     *     API_URL: api.url,
     *     USER_POOL_CLIENT: auth.cognitoUserPoolClient.userPoolClientId,
     *   },
     * }
     * ```
     */
    environment?: Record<string, string>;
    /**
     * The duration logs are kept in CloudWatch Logs.
     * @default Logs retained indefinitely
     * @example
     * ```js
     * {
     *   logRetention: "one_week"
     * }
     * ```
     */
    logRetention?: Lowercase<keyof typeof RetentionDays>;
    /**
     * While deploying, SST waits for the CloudFront cache invalidation process to finish. This ensures that the new content will be served once the deploy command finishes. However, this process can sometimes take more than 5 mins. For non-prod environments it might make sense to pass in `false`. That'll skip waiting for the cache to invalidate and speed up the deploy process.
     * @default false
     * @example
     * ```js
     * {
     *   waitForInvalidation: true
     * }
     * ```
     */
    waitForInvalidation?: boolean;
    dev?: {
        /**
         * When running `sst dev, site is not deployed. This is to ensure `sst dev` can start up quickly.
         * @default false
         * @example
         * ```js
         * {
         *   dev: {
         *     deploy: true
         *   }
         * }
         * ```
         */
        deploy?: boolean;
        /**
         * The local site URL when running `sst dev`.
         * @example
         * ```js
         * {
         *   dev: {
         *     url: "http://localhost:3000"
         *   }
         * }
         * ```
         */
        url?: string;
    };
    cdk?: {
        /**
         * Customizing the container definition for the ECS task.
         * @example
         * ```js
         * {
         *   cdk: {
         *     container: {
         *       healthCheck: {
         *         command: ["CMD-SHELL", "curl -f http://localhost/ || exit 1"],
         *       },
         *     }
         *   }
         * }
         * ```
         */
        container?: Omit<ContainerDefinitionOptions, "image">;
        /**
         * Runs codebuild job in the specified VPC. Note this will only work once deployed.
         *
         * @example
         * ```js
         * import { Vpc } from "aws-cdk-lib/aws-ec2";
         *
         * {
         *   cdk: {
         *     vpc: Vpc.fromLookup(stack, "VPC", {
         *       vpcId: "vpc-xxxxxxxxxx",
         *     }),
         *   }
         * }
         * ```
         */
        vpc?: IVpc;
    };
}
type ServiceNormalizedProps = ServiceProps & {
    path: Exclude<ServiceProps["path"], undefined>;
    cpu: Exclude<ServiceProps["cpu"], undefined>;
    memory: Exclude<ServiceProps["memory"], undefined>;
    port: Exclude<ServiceProps["port"], undefined>;
    logRetention: Exclude<ServiceProps["logRetention"], undefined>;
    waitForInvalidation: Exclude<ServiceProps["waitForInvalidation"], undefined>;
};
/**
 * The `Service` construct is a higher level CDK construct that makes it easy to create modern web apps with Server Side Rendering capabilities.
 * @example
 * Deploys a service in the `app` directory.
 *
 * ```js
 * new Service(stack, "myApp", {
 *   path: "app",
 * });
 * ```
 */
export declare class Service extends Construct implements SSTConstruct {
    readonly id: string;
    private props;
    private doNotDeploy;
    private devFunction?;
    private vpc;
    private cluster;
    private container;
    private taskDefinition;
    private distribution;
    constructor(scope: Construct, id: string, props?: ServiceProps);
    /**
     * The CloudFront URL of the website.
     */
    get url(): string | undefined;
    /**
     * If the custom domain is enabled, this is the URL of the website with the
     * custom domain.
     */
    get customDomainUrl(): string | undefined;
    /**
     * The internally created CDK resources.
     */
    get cdk(): {
        vpc: IVpc;
        cluster: Cluster;
        distribution: import("aws-cdk-lib/aws-cloudfront").IDistribution;
        hostedZone: import("aws-cdk-lib/aws-route53").IHostedZone | undefined;
        certificate: import("aws-cdk-lib/aws-certificatemanager").ICertificate | undefined;
    } | undefined;
    getConstructMetadata(): {
        type: "Service";
        data: {
            mode: "placeholder" | "deployed";
            path: string;
            customDomainUrl: string | undefined;
            url: string | undefined;
            devFunction: string | undefined;
            task: string;
            container: string;
            secrets: string[];
        };
    };
    /** @internal */
    getFunctionBinding(): FunctionBindingProps;
    /**
     * Binds additional resources to service.
     *
     * @example
     * ```js
     * service.bind([STRIPE_KEY, bucket]);
     * ```
     */
    bind(constructs: SSTConstruct[]): void;
    /**
     * Attaches the given list of permissions to allow the service
     * to access other AWS resources.
     *
     * @example
     * ```js
     * service.attachPermissions(["sns"]);
     * ```
     */
    attachPermissions(permissions: Permissions): void;
    /**
     * Attaches additional environment variable to the service.
     *
     * @example
     * ```js
     * service.addEnvironment({
     *   DEBUG: "*"
     * });
     * ```
     */
    addEnvironment(name: string, value: string): void;
    private validateServiceExists;
    private validateMemoryAndCpu;
    private createVpc;
    private createService;
    private createLoadBalancer;
    private createAutoScaling;
    private createDistribution;
    private createDevFunction;
    private bindForService;
    private addEnvironmentForService;
    private attachPermissionsForService;
    private createNixpacksBuilder;
    private runNixpacksBuild;
    private runDockerBuild;
    private updateContainerImage;
}
export declare const useServices: () => {
    add(stack: string, name: string, props: ServiceNormalizedProps): void;
    readonly all: {
        stack: string;
        name: string;
        props: ServiceNormalizedProps;
    }[];
};
export {};
