"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.CfnWarmPoolPropsMixin = exports.CfnScheduledActionPropsMixin = exports.CfnScalingPolicyPropsMixin = exports.CfnLifecycleHookPropsMixin = exports.CfnLaunchConfigurationPropsMixin = exports.CfnAutoScalingGroupPropsMixin = void 0;
const jsiiDeprecationWarnings = require("../../../.warnings.jsii.js");
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
/* eslint-disable @stylistic/max-len, eol-last */
const cdk = __importStar(require("aws-cdk-lib/core"));
const service = __importStar(require("aws-cdk-lib/aws-autoscaling"));
/**
 * The `AWS::AutoScaling::AutoScalingGroup` resource defines an Amazon EC2 Auto Scaling group, which is a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management.
 *
 * For more information about Amazon EC2 Auto Scaling, see the [Amazon EC2 Auto Scaling User Guide](https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html) .
 *
 * > Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a [launch template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) or a launch configuration. We strongly recommend that you do not use launch configurations. For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html) in the *Amazon EC2 Auto Scaling User Guide* .
 * >
 * > For help migrating from launch configurations to launch templates, see [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * @cloudformationResource AWS::AutoScaling::AutoScalingGroup
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html
 */
class CfnAutoScalingGroupPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnAutoScalingGroupPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingGroupName", "availabilityZoneDistribution", "availabilityZoneIds", "availabilityZoneImpairmentPolicy", "availabilityZones", "capacityRebalance", "capacityReservationSpecification", "context", "cooldown", "defaultInstanceWarmup", "deletionProtection", "desiredCapacity", "desiredCapacityType", "healthCheckGracePeriod", "healthCheckType", "instanceId", "instanceLifecyclePolicy", "instanceMaintenancePolicy", "launchConfigurationName", "launchTemplate", "lifecycleHookSpecificationList", "loadBalancerNames", "maxInstanceLifetime", "maxSize", "metricsCollection", "minSize", "mixedInstancesPolicy", "newInstancesProtectedFromScaleIn", "notificationConfiguration", "notificationConfigurations", "placementGroup", "serviceLinkedRoleArn", "skipZonalShiftValidation", "tags", "targetGroupArns", "terminationPolicies", "trafficSources", "vpcZoneIdentifier"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::AutoScalingGroup`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnAutoScalingGroupMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAutoScalingGroupPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnAutoScalingGroupMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnAutoScalingGroup.isCfnAutoScalingGroup(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAutoScalingGroupPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAutoScalingGroupPropsMixin = CfnAutoScalingGroupPropsMixin;
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinLaunchTemplateSpecificationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        launchTemplateId: (!props.launchTemplateId ? undefined : cdk.getRefProperty(props.launchTemplateId?.launchTemplateRef, 'launchTemplateId') ?? cdk.ensureStringOrUndefined(props.launchTemplateId, "launchTemplateId", "ec2.ILaunchTemplateRef | string")),
        launchTemplateName: (!props.launchTemplateName ? undefined : props.launchTemplateName),
        version: (!props.version ? undefined : props.version)
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinLifecycleHookSpecificationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        defaultResult: (!props.defaultResult ? undefined : props.defaultResult),
        heartbeatTimeout: (!props.heartbeatTimeout ? undefined : props.heartbeatTimeout),
        lifecycleHookName: (!props.lifecycleHookName ? undefined : props.lifecycleHookName),
        lifecycleTransition: (!props.lifecycleTransition ? undefined : props.lifecycleTransition),
        notificationMetadata: (!props.notificationMetadata ? undefined : props.notificationMetadata),
        notificationTargetArn: (!props.notificationTargetArn ? undefined : cdk.getRefProperty(props.notificationTargetArn?.topicRef, 'topicArn') ?? cdk.getRefProperty(props.notificationTargetArn?.queueRef, 'queueArn') ?? cdk.ensureStringOrUndefined(props.notificationTargetArn, "notificationTargetArn", "sns.ITopicRef | sqs.IQueueRef | string")),
        roleArn: (!props.roleArn ? undefined : cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinLaunchTemplateOverridesProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        imageId: (!props.imageId ? undefined : props.imageId),
        instanceRequirements: (!props.instanceRequirements ? undefined : props.instanceRequirements),
        instanceType: (!props.instanceType ? undefined : props.instanceType),
        launchTemplateSpecification: (!props.launchTemplateSpecification ? undefined : (!props.launchTemplateSpecification ? undefined : flattenCfnAutoScalingGroupPropsMixinLaunchTemplateSpecificationProperty(props.launchTemplateSpecification))),
        weightedCapacity: (!props.weightedCapacity ? undefined : props.weightedCapacity)
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinLaunchTemplateProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        launchTemplateSpecification: (!props.launchTemplateSpecification ? undefined : flattenCfnAutoScalingGroupPropsMixinLaunchTemplateSpecificationProperty(props.launchTemplateSpecification)),
        overrides: (!props.overrides ? undefined : (cdk.isResolvableObject(props.overrides) ? props.overrides : (!props.overrides ? undefined : cdk.mapArrayInPlace(props.overrides, (item) => flattenCfnAutoScalingGroupPropsMixinLaunchTemplateOverridesProperty(item)))))
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinMixedInstancesPolicyProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        instancesDistribution: (!props.instancesDistribution ? undefined : props.instancesDistribution),
        launchTemplate: (!props.launchTemplate ? undefined : flattenCfnAutoScalingGroupPropsMixinLaunchTemplateProperty(props.launchTemplate))
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupPropsMixinNotificationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        notificationTypes: (!props.notificationTypes ? undefined : props.notificationTypes),
        topicArn: (!props.topicArn ? undefined : cdk.getRefProperty(props.topicArn?.topicRef, 'topicArn') ?? cdk.ensureStringOrUndefined(props.topicArn, "topicArn", "sns.ITopicRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnAutoScalingGroupMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupName !== undefined))
        ret.autoScalingGroupName = props.autoScalingGroupName;
    if ((props.launchConfigurationName !== undefined))
        ret.launchConfigurationName = cdk.getRefProperty(props.launchConfigurationName?.launchConfigurationRef, 'launchConfigurationName') ?? cdk.ensureStringOrUndefined(props.launchConfigurationName, "launchConfigurationName", "autoscaling.ILaunchConfigurationRef | string");
    if ((props.launchTemplate !== undefined))
        ret.launchTemplate = flattenCfnAutoScalingGroupPropsMixinLaunchTemplateSpecificationProperty(props.launchTemplate);
    if ((props.lifecycleHookSpecificationList !== undefined))
        ret.lifecycleHookSpecificationList = (cdk.isResolvableObject(props.lifecycleHookSpecificationList) ? props.lifecycleHookSpecificationList : cdk.mapArrayInPlace(props.lifecycleHookSpecificationList, (item) => flattenCfnAutoScalingGroupPropsMixinLifecycleHookSpecificationProperty(item)));
    if ((props.loadBalancerNames !== undefined))
        ret.loadBalancerNames = props.loadBalancerNames;
    if ((props.mixedInstancesPolicy !== undefined))
        ret.mixedInstancesPolicy = flattenCfnAutoScalingGroupPropsMixinMixedInstancesPolicyProperty(props.mixedInstancesPolicy);
    if ((props.notificationConfiguration !== undefined))
        ret.notificationConfiguration = flattenCfnAutoScalingGroupPropsMixinNotificationConfigurationProperty(props.notificationConfiguration);
    if ((props.notificationConfigurations !== undefined))
        ret.notificationConfigurations = (cdk.isResolvableObject(props.notificationConfigurations) ? props.notificationConfigurations : cdk.mapArrayInPlace(props.notificationConfigurations, (item) => flattenCfnAutoScalingGroupPropsMixinNotificationConfigurationProperty(item)));
    if ((props.serviceLinkedRoleArn !== undefined))
        ret.serviceLinkedRoleArn = cdk.getRefProperty(props.serviceLinkedRoleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.serviceLinkedRoleArn, "serviceLinkedRoleArn", "iam.IRoleRef | string");
    if ((props.targetGroupArns !== undefined))
        ret.targetGroupArns = cdk.mapArrayInPlace(props.targetGroupArns, (item) => cdk.getRefProperty(item?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(item, "targetGroupArns", "elasticloadbalancingv2.ITargetGroupRef | string"));
    if ((props.vpcZoneIdentifier !== undefined))
        ret.vpcZoneIdentifier = cdk.mapArrayInPlace(props.vpcZoneIdentifier, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "vpcZoneIdentifier", "ec2.ISubnetRef | string"));
    return ret;
}
/**
 * The `AWS::AutoScaling::LaunchConfiguration` resource specifies the launch configuration that can be used by an Auto Scaling group to configure Amazon EC2 instances.
 *
 * When you update the launch configuration for an Auto Scaling group, CloudFormation deletes that resource and creates a new launch configuration with the updated properties and a new name. Existing instances are not affected. To update existing instances when you update the `AWS::AutoScaling::LaunchConfiguration` resource, you can specify an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) for the group. You can find sample update policies for rolling updates in [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html) .
 *
 * > Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a [launch template](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html) or a launch configuration. We strongly recommend that you do not use launch configurations. For more information, see [Launch configurations](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html) in the *Amazon EC2 Auto Scaling User Guide* .
 * >
 * > For help migrating from launch configurations to launch templates, see [Migrate AWS CloudFormation stacks from launch configurations to launch templates](https://docs.aws.amazon.com/autoscaling/ec2/userguide/migrate-launch-configurations-with-cloudformation.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * @cloudformationResource AWS::AutoScaling::LaunchConfiguration
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-launchconfiguration.html
 */
class CfnLaunchConfigurationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnLaunchConfigurationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["associatePublicIpAddress", "blockDeviceMappings", "classicLinkVpcId", "classicLinkVpcSecurityGroups", "ebsOptimized", "iamInstanceProfile", "imageId", "instanceId", "instanceMonitoring", "instanceType", "kernelId", "keyName", "launchConfigurationName", "metadataOptions", "placementTenancy", "ramDiskId", "securityGroups", "spotPrice", "userData"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::LaunchConfiguration`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnLaunchConfigurationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLaunchConfigurationPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnLaunchConfigurationMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnLaunchConfiguration.isCfnLaunchConfiguration(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLaunchConfigurationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLaunchConfigurationPropsMixin = CfnLaunchConfigurationPropsMixin;
// @ts-ignore TS6133
function flattenCfnLaunchConfigurationMixinProps(props) {
    const ret = {};
    if ((props.iamInstanceProfile !== undefined))
        ret.iamInstanceProfile = cdk.getRefProperty(props.iamInstanceProfile?.instanceProfileRef, 'instanceProfileName') ?? cdk.ensureStringOrUndefined(props.iamInstanceProfile, "iamInstanceProfile", "iam.IInstanceProfileRef | string");
    if ((props.securityGroups !== undefined))
        ret.securityGroups = cdk.mapArrayInPlace(props.securityGroups, (item) => cdk.getRefProperty(item?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(item, "securityGroups", "ec2.ISecurityGroupRef | string"));
    return ret;
}
/**
 * The `AWS::AutoScaling::LifecycleHook` resource specifies lifecycle hooks for an Auto Scaling group.
 *
 * These hooks let you create solutions that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to wait for the action to complete before the instance transitions to the next state.
 *
 * Use lifecycle hooks to prepare new instances for use or to delay them from being registered behind a load balancer before their configuration has been applied completely. You can also use lifecycle hooks to prepare running instances to be terminated by, for example, downloading logs or other data.
 *
 * For more information, see [Amazon EC2 Auto Scaling lifecycle hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * @cloudformationResource AWS::AutoScaling::LifecycleHook
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-lifecyclehook.html
 */
class CfnLifecycleHookPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnLifecycleHookPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingGroupName", "defaultResult", "heartbeatTimeout", "lifecycleHookName", "lifecycleTransition", "notificationMetadata", "notificationTargetArn", "roleArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::LifecycleHook`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnLifecycleHookMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnLifecycleHookPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnLifecycleHookMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnLifecycleHook.isCfnLifecycleHook(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnLifecycleHookPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnLifecycleHookPropsMixin = CfnLifecycleHookPropsMixin;
// @ts-ignore TS6133
function flattenCfnLifecycleHookMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupName !== undefined))
        ret.autoScalingGroupName = cdk.getRefProperty(props.autoScalingGroupName?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.ensureStringOrUndefined(props.autoScalingGroupName, "autoScalingGroupName", "autoscaling.IAutoScalingGroupRef | string");
    if ((props.notificationTargetArn !== undefined))
        ret.notificationTargetArn = cdk.getRefProperty(props.notificationTargetArn?.topicRef, 'topicArn') ?? cdk.getRefProperty(props.notificationTargetArn?.queueRef, 'queueArn') ?? cdk.ensureStringOrUndefined(props.notificationTargetArn, "notificationTargetArn", "sns.ITopicRef | sqs.IQueueRef | string");
    if ((props.roleArn !== undefined))
        ret.roleArn = cdk.getRefProperty(props.roleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.roleArn, "roleArn", "iam.IRoleRef | string");
    return ret;
}
/**
 * The `AWS::AutoScaling::ScalingPolicy` resource specifies an Amazon EC2 Auto Scaling scaling policy so that the Auto Scaling group can scale the number of instances available for your application.
 *
 * For more information about using scaling policies to scale your Auto Scaling group automatically, see [Dynamic scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) and [Predictive scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-predictive-scaling.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * @cloudformationResource AWS::AutoScaling::ScalingPolicy
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html
 */
class CfnScalingPolicyPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnScalingPolicyPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["adjustmentType", "autoScalingGroupName", "cooldown", "estimatedInstanceWarmup", "metricAggregationType", "minAdjustmentMagnitude", "policyType", "predictiveScalingConfiguration", "scalingAdjustment", "stepAdjustments", "targetTrackingConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::ScalingPolicy`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnScalingPolicyMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnScalingPolicyPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnScalingPolicyMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnScalingPolicy.isCfnScalingPolicy(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnScalingPolicyPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnScalingPolicyPropsMixin = CfnScalingPolicyPropsMixin;
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinMetricDimensionProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        name: (!props.name ? undefined : props.name),
        value: (!props.value ? undefined : cdk.getRefProperty(props.value?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.getRefProperty(props.value?.clusterRef, 'clusterName') ?? cdk.ensureStringOrUndefined(props.value, "value", "autoscaling.IAutoScalingGroupRef | ecs.IClusterRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinMetricProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        dimensions: (!props.dimensions ? undefined : (cdk.isResolvableObject(props.dimensions) ? props.dimensions : (!props.dimensions ? undefined : cdk.mapArrayInPlace(props.dimensions, (item) => flattenCfnScalingPolicyPropsMixinMetricDimensionProperty(item))))),
        metricName: (!props.metricName ? undefined : props.metricName),
        namespace: (!props.namespace ? undefined : props.namespace)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinMetricStatProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        metric: (!props.metric ? undefined : flattenCfnScalingPolicyPropsMixinMetricProperty(props.metric)),
        stat: (!props.stat ? undefined : props.stat),
        unit: (!props.unit ? undefined : props.unit)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinMetricDataQueryProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        expression: (!props.expression ? undefined : props.expression),
        id: (!props.id ? undefined : props.id),
        label: (!props.label ? undefined : props.label),
        metricStat: (!props.metricStat ? undefined : (!props.metricStat ? undefined : flattenCfnScalingPolicyPropsMixinMetricStatProperty(props.metricStat))),
        returnData: (!props.returnData ? undefined : props.returnData)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedLoadMetricProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        metricDataQueries: (!props.metricDataQueries ? undefined : (cdk.isResolvableObject(props.metricDataQueries) ? props.metricDataQueries : cdk.mapArrayInPlace(props.metricDataQueries, (item) => flattenCfnScalingPolicyPropsMixinMetricDataQueryProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedCapacityMetricProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        metricDataQueries: (!props.metricDataQueries ? undefined : (cdk.isResolvableObject(props.metricDataQueries) ? props.metricDataQueries : cdk.mapArrayInPlace(props.metricDataQueries, (item) => flattenCfnScalingPolicyPropsMixinMetricDataQueryProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedScalingMetricProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        metricDataQueries: (!props.metricDataQueries ? undefined : (cdk.isResolvableObject(props.metricDataQueries) ? props.metricDataQueries : cdk.mapArrayInPlace(props.metricDataQueries, (item) => flattenCfnScalingPolicyPropsMixinMetricDataQueryProperty(item))))
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinPredictiveScalingMetricSpecificationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        customizedCapacityMetricSpecification: (!props.customizedCapacityMetricSpecification ? undefined : (!props.customizedCapacityMetricSpecification ? undefined : flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedCapacityMetricProperty(props.customizedCapacityMetricSpecification))),
        customizedLoadMetricSpecification: (!props.customizedLoadMetricSpecification ? undefined : (!props.customizedLoadMetricSpecification ? undefined : flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedLoadMetricProperty(props.customizedLoadMetricSpecification))),
        customizedScalingMetricSpecification: (!props.customizedScalingMetricSpecification ? undefined : (!props.customizedScalingMetricSpecification ? undefined : flattenCfnScalingPolicyPropsMixinPredictiveScalingCustomizedScalingMetricProperty(props.customizedScalingMetricSpecification))),
        predefinedLoadMetricSpecification: (!props.predefinedLoadMetricSpecification ? undefined : props.predefinedLoadMetricSpecification),
        predefinedMetricPairSpecification: (!props.predefinedMetricPairSpecification ? undefined : props.predefinedMetricPairSpecification),
        predefinedScalingMetricSpecification: (!props.predefinedScalingMetricSpecification ? undefined : props.predefinedScalingMetricSpecification),
        targetValue: (!props.targetValue ? undefined : props.targetValue)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinPredictiveScalingConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        maxCapacityBreachBehavior: (!props.maxCapacityBreachBehavior ? undefined : props.maxCapacityBreachBehavior),
        maxCapacityBuffer: (!props.maxCapacityBuffer ? undefined : props.maxCapacityBuffer),
        metricSpecifications: (!props.metricSpecifications ? undefined : (cdk.isResolvableObject(props.metricSpecifications) ? props.metricSpecifications : cdk.mapArrayInPlace(props.metricSpecifications, (item) => flattenCfnScalingPolicyPropsMixinPredictiveScalingMetricSpecificationProperty(item)))),
        mode: (!props.mode ? undefined : props.mode),
        schedulingBufferTime: (!props.schedulingBufferTime ? undefined : props.schedulingBufferTime)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinTargetTrackingMetricStatProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        metric: (!props.metric ? undefined : flattenCfnScalingPolicyPropsMixinMetricProperty(props.metric)),
        period: (!props.period ? undefined : props.period),
        stat: (!props.stat ? undefined : props.stat),
        unit: (!props.unit ? undefined : props.unit)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinTargetTrackingMetricDataQueryProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        expression: (!props.expression ? undefined : props.expression),
        id: (!props.id ? undefined : props.id),
        label: (!props.label ? undefined : props.label),
        metricStat: (!props.metricStat ? undefined : (!props.metricStat ? undefined : flattenCfnScalingPolicyPropsMixinTargetTrackingMetricStatProperty(props.metricStat))),
        period: (!props.period ? undefined : props.period),
        returnData: (!props.returnData ? undefined : props.returnData)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinCustomizedMetricSpecificationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        dimensions: (!props.dimensions ? undefined : (cdk.isResolvableObject(props.dimensions) ? props.dimensions : (!props.dimensions ? undefined : cdk.mapArrayInPlace(props.dimensions, (item) => flattenCfnScalingPolicyPropsMixinMetricDimensionProperty(item))))),
        metricName: (!props.metricName ? undefined : props.metricName),
        metrics: (!props.metrics ? undefined : (cdk.isResolvableObject(props.metrics) ? props.metrics : (!props.metrics ? undefined : cdk.mapArrayInPlace(props.metrics, (item) => flattenCfnScalingPolicyPropsMixinTargetTrackingMetricDataQueryProperty(item))))),
        namespace: (!props.namespace ? undefined : props.namespace),
        period: (!props.period ? undefined : props.period),
        statistic: (!props.statistic ? undefined : props.statistic),
        unit: (!props.unit ? undefined : props.unit)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyPropsMixinTargetTrackingConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        customizedMetricSpecification: (!props.customizedMetricSpecification ? undefined : (!props.customizedMetricSpecification ? undefined : flattenCfnScalingPolicyPropsMixinCustomizedMetricSpecificationProperty(props.customizedMetricSpecification))),
        disableScaleIn: (!props.disableScaleIn ? undefined : props.disableScaleIn),
        predefinedMetricSpecification: (!props.predefinedMetricSpecification ? undefined : props.predefinedMetricSpecification),
        targetValue: (!props.targetValue ? undefined : props.targetValue)
    };
}
// @ts-ignore TS6133
function flattenCfnScalingPolicyMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupName !== undefined))
        ret.autoScalingGroupName = cdk.getRefProperty(props.autoScalingGroupName?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.ensureStringOrUndefined(props.autoScalingGroupName, "autoScalingGroupName", "autoscaling.IAutoScalingGroupRef | string");
    if ((props.predictiveScalingConfiguration !== undefined))
        ret.predictiveScalingConfiguration = flattenCfnScalingPolicyPropsMixinPredictiveScalingConfigurationProperty(props.predictiveScalingConfiguration);
    if ((props.targetTrackingConfiguration !== undefined))
        ret.targetTrackingConfiguration = flattenCfnScalingPolicyPropsMixinTargetTrackingConfigurationProperty(props.targetTrackingConfiguration);
    return ret;
}
/**
 * The `AWS::AutoScaling::ScheduledAction` resource specifies an Amazon EC2 Auto Scaling scheduled action so that the Auto Scaling group can change the number of instances available for your application in response to predictable load changes.
 *
 * When you update a stack with an Auto Scaling group and scheduled action, CloudFormation always sets the min size, max size, and desired capacity properties of your group to the values that are defined in the `AWS::AutoScaling::AutoScalingGroup` section of your template. However, you might not want CloudFormation to do that when you have a scheduled action in effect. You can use an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) to prevent CloudFormation from changing the min size, max size, or desired capacity property values during a stack update unless you modified the individual values in your template. If you have rolling updates enabled, before you can update the Auto Scaling group, you must suspend scheduled actions by specifying an [UpdatePolicy attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html) for the Auto Scaling group. You can find a sample update policy for rolling updates in [Configure Amazon EC2 Auto Scaling resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2-auto-scaling.html) .
 *
 * For more information, see [Scheduled scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html) and [Suspending and resuming scaling processes](https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * @cloudformationResource AWS::AutoScaling::ScheduledAction
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scheduledaction.html
 */
class CfnScheduledActionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnScheduledActionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingGroupName", "desiredCapacity", "endTime", "maxSize", "minSize", "recurrence", "startTime", "timeZone"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::ScheduledAction`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnScheduledActionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnScheduledActionPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnScheduledActionMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnScheduledAction.isCfnScheduledAction(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnScheduledActionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnScheduledActionPropsMixin = CfnScheduledActionPropsMixin;
// @ts-ignore TS6133
function flattenCfnScheduledActionMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupName !== undefined))
        ret.autoScalingGroupName = cdk.getRefProperty(props.autoScalingGroupName?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.ensureStringOrUndefined(props.autoScalingGroupName, "autoScalingGroupName", "autoscaling.IAutoScalingGroupRef | string");
    return ret;
}
/**
 * The `AWS::AutoScaling::WarmPool` resource creates a pool of pre-initialized EC2 instances that sits alongside the Auto Scaling group.
 *
 * Whenever your application needs to scale out, the Auto Scaling group can draw on the warm pool to meet its new desired capacity.
 *
 * When you create a warm pool, you can define a minimum size. When your Auto Scaling group scales out and the size of the warm pool shrinks, Amazon EC2 Auto Scaling launches new instances into the warm pool to maintain its minimum size.
 *
 * For more information, see [Warm pools for Amazon EC2 Auto Scaling](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-warm-pools.html) in the *Amazon EC2 Auto Scaling User Guide* .
 *
 * > CloudFormation supports the `UpdatePolicy` attribute for Auto Scaling groups. During an update, if `UpdatePolicy` is set to `AutoScalingRollingUpdate` , CloudFormation replaces `InService` instances only. Instances in the warm pool are not replaced. The difference in which instances are replaced can potentially result in different instance configurations after the stack update completes. If `UpdatePolicy` is set to `AutoScalingReplacingUpdate` , you do not encounter this issue because CloudFormation replaces both the Auto Scaling group and the warm pool.
 *
 * @cloudformationResource AWS::AutoScaling::WarmPool
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-warmpool.html
 */
class CfnWarmPoolPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_autoscaling.CfnWarmPoolPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingGroupName", "instanceReusePolicy", "maxGroupPreparedCapacity", "minSize", "poolState"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AutoScaling::WarmPool`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_autoscaling_CfnWarmPoolMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnWarmPoolPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnWarmPoolMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnWarmPool.isCfnWarmPool(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnWarmPoolPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnWarmPoolPropsMixin = CfnWarmPoolPropsMixin;
// @ts-ignore TS6133
function flattenCfnWarmPoolMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupName !== undefined))
        ret.autoScalingGroupName = cdk.getRefProperty(props.autoScalingGroupName?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.ensureStringOrUndefined(props.autoScalingGroupName, "autoScalingGroupName", "autoscaling.IAutoScalingGroupRef | string");
    return ret;
}
