import * as autoscaling from "../../aws-autoscaling";
import * as cloudwatch from "../../aws-cloudwatch";
import * as ec2 from "../../aws-ec2";
import * as kms from "../../aws-kms";
import * as logs from "../../aws-logs";
import * as s3 from "../../aws-s3";
import * as cloudmap from "../../aws-servicediscovery";
import { Duration, IResource, Resource } from "../../core";
import { Construct } from 'constructs';
/**
 * (experimental) The properties used to define an ECS cluster.
 *
 * @experimental
 */
export interface ClusterProps {
    /**
     * (experimental) The name for the cluster.
     *
     * @default CloudFormation-generated name
     * @experimental
     */
    readonly clusterName?: string;
    /**
     * (experimental) The VPC where your ECS instances will be running or your ENIs will be deployed.
     *
     * @default - creates a new VPC with two AZs
     * @experimental
     */
    readonly vpc?: ec2.IVpc;
    /**
     * (experimental) The service discovery namespace created in this cluster.
     *
     * @default - no service discovery namespace created, you can use `addDefaultCloudMapNamespace` to add a
     * default service discovery namespace later.
     * @experimental
     */
    readonly defaultCloudMapNamespace?: CloudMapNamespaceOptions;
    /**
     * (experimental) The ec2 capacity to add to the cluster.
     *
     * @default - no EC2 capacity will be added, you can use `addCapacity` to add capacity later.
     * @experimental
     */
    readonly capacity?: AddCapacityOptions;
    /**
     * (experimental) Whether to enable Fargate Capacity Providers.
     *
     * @default false
     * @experimental
     */
    readonly enableFargateCapacityProviders?: boolean;
    /**
     * (experimental) If true CloudWatch Container Insights will be enabled for the cluster.
     *
     * @default - Container Insights will be disabled for this cluser.
     * @experimental
     */
    readonly containerInsights?: boolean;
    /**
     * (experimental) The execute command configuration for the cluster.
     *
     * @default - no configuration will be provided.
     * @experimental
     */
    readonly executeCommandConfiguration?: ExecuteCommandConfiguration;
}
/**
 * (experimental) The machine image type.
 *
 * @experimental
 */
export declare enum MachineImageType {
    /**
     * (experimental) Amazon ECS-optimized Amazon Linux 2 AMI.
     *
     * @experimental
     */
    AMAZON_LINUX_2 = 0,
    /**
     * (experimental) Bottlerocket AMI.
     *
     * @experimental
     */
    BOTTLEROCKET = 1
}
/**
 * (experimental) A regional grouping of one or more container instances on which you can run tasks and services.
 *
 * @experimental
 */
export declare class Cluster extends Resource implements ICluster {
    /**
     * (experimental) Import an existing cluster to the stack from its attributes.
     *
     * @experimental
     */
    static fromClusterAttributes(scope: Construct, id: string, attrs: ClusterAttributes): ICluster;
    /**
     * (experimental) Manage the allowed network connections for the cluster with Security Groups.
     *
     * @experimental
     */
    readonly connections: ec2.Connections;
    /**
     * (experimental) The VPC associated with the cluster.
     *
     * @experimental
     */
    readonly vpc: ec2.IVpc;
    /**
     * (experimental) The Amazon Resource Name (ARN) that identifies the cluster.
     *
     * @experimental
     */
    readonly clusterArn: string;
    /**
     * (experimental) The name of the cluster.
     *
     * @experimental
     */
    readonly clusterName: string;
    /**
     * The names of both ASG and Fargate capacity providers associated with the cluster.
     */
    private _capacityProviderNames;
    /**
     * The AWS Cloud Map namespace to associate with the cluster.
     */
    private _defaultCloudMapNamespace?;
    /**
     * Specifies whether the cluster has EC2 instance capacity.
     */
    private _hasEc2Capacity;
    /**
     * The autoscaling group for added Ec2 capacity
     */
    private _autoscalingGroup?;
    /**
     * The execute command configuration for the cluster
     */
    private _executeCommandConfiguration?;
    /**
     * (experimental) Constructs a new instance of the Cluster class.
     *
     * @experimental
     */
    constructor(scope: Construct, id: string, props?: ClusterProps);
    /**
     * (experimental) Enable the Fargate capacity providers for this cluster.
     *
     * @experimental
     */
    enableFargateCapacityProviders(): void;
    private renderExecuteCommandConfiguration;
    private renderExecuteCommandLogConfiguration;
    /**
     * (experimental) Add an AWS Cloud Map DNS namespace for this cluster.
     *
     * NOTE: HttpNamespaces are not supported, as ECS always requires a DNSConfig when registering an instance to a Cloud
     * Map service.
     *
     * @experimental
     */
    addDefaultCloudMapNamespace(options: CloudMapNamespaceOptions): cloudmap.INamespace;
    /**
     * (experimental) Getter for namespace added to cluster.
     *
     * @experimental
     */
    get defaultCloudMapNamespace(): cloudmap.INamespace | undefined;
    /**
     * (experimental) This method adds an Auto Scaling Group Capacity Provider to a cluster.
     *
     * @param provider the capacity provider to add to this cluster.
     * @experimental
     */
    addAsgCapacityProvider(provider: AsgCapacityProvider, options?: AddAutoScalingGroupCapacityOptions): void;
    private configureAutoScalingGroup;
    private configureWindowsAutoScalingGroup;
    /**
     * (experimental) Getter for autoscaling group added to cluster.
     *
     * @experimental
     */
    get autoscalingGroup(): autoscaling.IAutoScalingGroup | undefined;
    /**
     * (experimental) Whether the cluster has EC2 capacity associated with it.
     *
     * @experimental
     */
    get hasEc2Capacity(): boolean;
    /**
     * (experimental) Getter for execute command configuration associated with the cluster.
     *
     * @experimental
     */
    get executeCommandConfiguration(): ExecuteCommandConfiguration | undefined;
    /**
     * (experimental) This method returns the CloudWatch metric for this clusters CPU reservation.
     *
     * @default average over 5 minutes
     * @experimental
     */
    metricCpuReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) This method returns the CloudWatch metric for this clusters CPU utilization.
     *
     * @default average over 5 minutes
     * @experimental
     */
    metricCpuUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) This method returns the CloudWatch metric for this clusters memory reservation.
     *
     * @default average over 5 minutes
     * @experimental
     */
    metricMemoryReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) This method returns the CloudWatch metric for this clusters memory utilization.
     *
     * @default average over 5 minutes
     * @experimental
     */
    metricMemoryUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    /**
     * (experimental) This method returns the specifed CloudWatch metric for this cluster.
     *
     * @experimental
     */
    metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
    private cannedMetric;
}
/**
 * (experimental) A regional grouping of one or more container instances on which you can run tasks and services.
 *
 * @experimental
 */
export interface ICluster extends IResource {
    /**
     * (experimental) The name of the cluster.
     *
     * @experimental
     * @attribute true
     */
    readonly clusterName: string;
    /**
     * (experimental) The Amazon Resource Name (ARN) that identifies the cluster.
     *
     * @experimental
     * @attribute true
     */
    readonly clusterArn: string;
    /**
     * (experimental) The VPC associated with the cluster.
     *
     * @experimental
     */
    readonly vpc: ec2.IVpc;
    /**
     * (experimental) Manage the allowed network connections for the cluster with Security Groups.
     *
     * @experimental
     */
    readonly connections: ec2.Connections;
    /**
     * (experimental) Specifies whether the cluster has EC2 instance capacity.
     *
     * @experimental
     */
    readonly hasEc2Capacity: boolean;
    /**
     * (experimental) The AWS Cloud Map namespace to associate with the cluster.
     *
     * @experimental
     */
    readonly defaultCloudMapNamespace?: cloudmap.INamespace;
    /**
     * (experimental) The autoscaling group added to the cluster if capacity is associated to the cluster.
     *
     * @experimental
     */
    readonly autoscalingGroup?: autoscaling.IAutoScalingGroup;
    /**
     * (experimental) The execute command configuration for the cluster.
     *
     * @experimental
     */
    readonly executeCommandConfiguration?: ExecuteCommandConfiguration;
}
/**
 * (experimental) The properties to import from the ECS cluster.
 *
 * @experimental
 */
export interface ClusterAttributes {
    /**
     * (experimental) The name of the cluster.
     *
     * @experimental
     */
    readonly clusterName: string;
    /**
     * (experimental) The Amazon Resource Name (ARN) that identifies the cluster.
     *
     * @default Derived from clusterName
     * @experimental
     */
    readonly clusterArn?: string;
    /**
     * (experimental) The VPC associated with the cluster.
     *
     * @experimental
     */
    readonly vpc: ec2.IVpc;
    /**
     * (experimental) The security groups associated with the container instances registered to the cluster.
     *
     * @experimental
     */
    readonly securityGroups: ec2.ISecurityGroup[];
    /**
     * (experimental) Specifies whether the cluster has EC2 instance capacity.
     *
     * @default true
     * @experimental
     */
    readonly hasEc2Capacity?: boolean;
    /**
     * (experimental) The AWS Cloud Map namespace to associate with the cluster.
     *
     * @default - No default namespace
     * @experimental
     */
    readonly defaultCloudMapNamespace?: cloudmap.INamespace;
    /**
     * (experimental) Autoscaling group added to the cluster if capacity is added.
     *
     * @default - No default autoscaling group
     * @experimental
     */
    readonly autoscalingGroup?: autoscaling.IAutoScalingGroup;
    /**
     * (experimental) The execute command configuration for the cluster.
     *
     * @default - none.
     * @experimental
     */
    readonly executeCommandConfiguration?: ExecuteCommandConfiguration;
}
/**
 * (experimental) The properties for adding an AutoScalingGroup.
 *
 * @experimental
 */
export interface AddAutoScalingGroupCapacityOptions {
    /**
     * (experimental) Specifies whether the containers can access the container instance role.
     *
     * @default false
     * @experimental
     */
    readonly canContainersAccessInstanceRole?: boolean;
    /**
     * (experimental) Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services.
     *
     * For more information, see [Using Spot Instances](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-instance-spot.html).
     *
     * @default false
     * @experimental
     */
    readonly spotInstanceDraining?: boolean;
    /**
     * (experimental) If {@link AddAutoScalingGroupCapacityOptions.taskDrainTime} is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information.
     *
     * @default The SNS Topic will not be encrypted.
     * @experimental
     */
    readonly topicEncryptionKey?: kms.IKey;
    /**
     * (experimental) What type of machine image this is.
     *
     * Depending on the setting, different UserData will automatically be added
     * to the `AutoScalingGroup` to configure it properly for use with ECS.
     *
     * If you create an `AutoScalingGroup` yourself and are adding it via
     * `addAutoScalingGroup()`, you must specify this value. If you are adding an
     * `autoScalingGroup` via `addCapacity`, this value will be determined
     * from the `machineImage` you pass.
     *
     * @default - Automatically determined from `machineImage`, if available, otherwise `MachineImageType.AMAZON_LINUX_2`.
     * @experimental
     */
    readonly machineImageType?: MachineImageType;
}
/**
 * (experimental) The properties for adding instance capacity to an AutoScalingGroup.
 *
 * @experimental
 */
export interface AddCapacityOptions extends AddAutoScalingGroupCapacityOptions, autoscaling.CommonAutoScalingGroupProps {
    /**
     * (experimental) The EC2 instance type to use when launching instances into the AutoScalingGroup.
     *
     * @experimental
     */
    readonly instanceType: ec2.InstanceType;
    /**
     * (experimental) The ECS-optimized AMI variant to use.
     *
     * The default is to use an ECS-optimized AMI of Amazon Linux 2 which is
     * automatically updated to the latest version on every deployment. This will
     * replace the instances in the AutoScalingGroup. Make sure you have not disabled
     * task draining, to avoid downtime when the AMI updates.
     *
     * To use an image that does not update on every deployment, pass:
     *
     * ```ts
     * const machineImage = ecs.EcsOptimizedImage.amazonLinux2(ecs.AmiHardwareType.STANDARD, {
     *    cachedInContext: true,
     * });
     * ```
     *
     * For more information, see [Amazon ECS-optimized
     * AMIs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html).
     *
     * You must define either `machineImage` or `machineImageType`, not both.
     *
     * @default - Automatically updated, ECS-optimized Amazon Linux 2
     * @experimental
     */
    readonly machineImage?: ec2.IMachineImage;
}
/**
 * (experimental) The options for creating an AWS Cloud Map namespace.
 *
 * @experimental
 */
export interface CloudMapNamespaceOptions {
    /**
     * (experimental) The name of the namespace, such as example.com.
     *
     * @experimental
     */
    readonly name: string;
    /**
     * (experimental) The type of CloudMap Namespace to create.
     *
     * @default PrivateDns
     * @experimental
     */
    readonly type?: cloudmap.NamespaceType;
    /**
     * (experimental) The VPC to associate the namespace with.
     *
     * This property is required for private DNS namespaces.
     *
     * @default VPC of the cluster for Private DNS Namespace, otherwise none
     * @experimental
     */
    readonly vpc?: ec2.IVpc;
}
/**
 * (experimental) A Capacity Provider strategy to use for the service.
 *
 * NOTE: defaultCapacityProviderStrategy on cluster not currently supported.
 *
 * @experimental
 */
export interface CapacityProviderStrategy {
    /**
     * (experimental) The name of the capacity provider.
     *
     * @experimental
     */
    readonly capacityProvider: string;
    /**
     * (experimental) The base value designates how many tasks, at a minimum, to run on the specified capacity provider.
     *
     * Only one
     * capacity provider in a capacity provider strategy can have a base defined. If no value is specified, the default
     * value of 0 is used.
     *
     * @default - none
     * @experimental
     */
    readonly base?: number;
    /**
     * (experimental) The weight value designates the relative percentage of the total number of tasks launched that should use the specified capacity provider.
     *
     * The weight value is taken into consideration after the base value, if defined, is satisfied.
     *
     * @default - 0
     * @experimental
     */
    readonly weight?: number;
}
/**
 * (experimental) The details of the execute command configuration.
 *
 * For more information, see
 * [ExecuteCommandConfiguration] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html
 *
 * @experimental
 */
export interface ExecuteCommandConfiguration {
    /**
     * (experimental) The AWS Key Management Service key ID to encrypt the data between the local client and the container.
     *
     * @default - none
     * @experimental
     */
    readonly kmsKey?: kms.IKey;
    /**
     * (experimental) The log configuration for the results of the execute command actions.
     *
     * The logs can be sent to CloudWatch Logs or an Amazon S3 bucket.
     *
     * @default - none
     * @experimental
     */
    readonly logConfiguration?: ExecuteCommandLogConfiguration;
    /**
     * (experimental) The log settings to use for logging the execute command session.
     *
     * @default - none
     * @experimental
     */
    readonly logging?: ExecuteCommandLogging;
}
/**
 * (experimental) The log settings to use to for logging the execute command session.
 *
 * For more information, see
 * [Logging] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandconfiguration.html#cfn-ecs-cluster-executecommandconfiguration-logging
 *
 * @experimental
 */
export declare enum ExecuteCommandLogging {
    /**
     * (experimental) The execute command session is not logged.
     *
     * @experimental
     */
    NONE = "NONE",
    /**
     * (experimental) The awslogs configuration in the task definition is used.
     *
     * If no logging parameter is specified, it defaults to this value. If no awslogs log driver is configured in the task definition, the output won't be logged.
     *
     * @experimental
     */
    DEFAULT = "DEFAULT",
    /**
     * (experimental) Specify the logging details as a part of logConfiguration.
     *
     * @experimental
     */
    OVERRIDE = "OVERRIDE"
}
/**
 * (experimental) The log configuration for the results of the execute command actions.
 *
 * The logs can be sent to CloudWatch Logs and/ or an Amazon S3 bucket.
 * For more information, see [ExecuteCommandLogConfiguration] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-cluster-executecommandlogconfiguration.html
 *
 * @experimental
 */
export interface ExecuteCommandLogConfiguration {
    /**
     * (experimental) Whether or not to enable encryption on the CloudWatch logs.
     *
     * @default - encryption will be disabled.
     * @experimental
     */
    readonly cloudWatchEncryptionEnabled?: boolean;
    /**
     * (experimental) The name of the CloudWatch log group to send logs to.
     *
     * The CloudWatch log group must already be created.
     *
     * @default - none
     * @experimental
     */
    readonly cloudWatchLogGroup?: logs.ILogGroup;
    /**
     * (experimental) The name of the S3 bucket to send logs to.
     *
     * The S3 bucket must already be created.
     *
     * @default - none
     * @experimental
     */
    readonly s3Bucket?: s3.IBucket;
    /**
     * (experimental) Whether or not to enable encryption on the CloudWatch logs.
     *
     * @default - encryption will be disabled.
     * @experimental
     */
    readonly s3EncryptionEnabled?: boolean;
    /**
     * (experimental) An optional folder in the S3 bucket to place logs in.
     *
     * @default - none
     * @experimental
     */
    readonly s3KeyPrefix?: string;
}
/**
 * (experimental) The options for creating an Auto Scaling Group Capacity Provider.
 *
 * @experimental
 */
export interface AsgCapacityProviderProps extends AddAutoScalingGroupCapacityOptions {
    /**
     * (experimental) The name for the capacity provider.
     *
     * @default CloudFormation-generated name
     * @experimental
     */
    readonly capacityProviderName?: string;
    /**
     * (experimental) The autoscaling group to add as a Capacity Provider.
     *
     * @experimental
     */
    readonly autoScalingGroup: autoscaling.IAutoScalingGroup;
    /**
     * (experimental) Whether to enable managed scaling.
     *
     * @default true
     * @experimental
     */
    readonly enableManagedScaling?: boolean;
    /**
     * (experimental) Whether to enable managed termination protection.
     *
     * @default true
     * @experimental
     */
    readonly enableManagedTerminationProtection?: boolean;
    /**
     * (experimental) Maximum scaling step size.
     *
     * In most cases this should be left alone.
     *
     * @default 1000
     * @experimental
     */
    readonly maximumScalingStepSize?: number;
    /**
     * (experimental) Minimum scaling step size.
     *
     * In most cases this should be left alone.
     *
     * @default 1
     * @experimental
     */
    readonly minimumScalingStepSize?: number;
    /**
     * (experimental) Target capacity percent.
     *
     * In most cases this should be left alone.
     *
     * @default 100
     * @experimental
     */
    readonly targetCapacityPercent?: number;
}
/**
 * (experimental) An Auto Scaling Group Capacity Provider.
 *
 * This allows an ECS cluster to target
 * a specific EC2 Auto Scaling Group for the placement of tasks. Optionally (and
 * recommended), ECS can manage the number of instances in the ASG to fit the
 * tasks, and can ensure that instances are not prematurely terminated while
 * there are still tasks running on them.
 *
 * @experimental
 */
export declare class AsgCapacityProvider extends Construct {
    /**
     * (experimental) Capacity provider name.
     *
     * @default Chosen by CloudFormation
     * @experimental
     */
    readonly capacityProviderName: string;
    /**
     * (experimental) Auto Scaling Group.
     *
     * @experimental
     */
    readonly autoScalingGroup: autoscaling.AutoScalingGroup;
    /**
     * (experimental) Auto Scaling Group machineImageType.
     *
     * @experimental
     */
    readonly machineImageType: MachineImageType;
    /**
     * (experimental) Whether managed termination protection is enabled.
     *
     * @experimental
     */
    readonly enableManagedTerminationProtection?: boolean;
    /**
     * @experimental
     */
    constructor(scope: Construct, id: string, props: AsgCapacityProviderProps);
}
