"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.CfnExpressGatewayServicePropsMixin = exports.CfnDaemonTaskDefinitionPropsMixin = exports.CfnDaemonPropsMixin = exports.CfnTaskSetPropsMixin = exports.CfnTaskDefinitionPropsMixin = exports.CfnServicePropsMixin = exports.CfnPrimaryTaskSetPropsMixin = exports.CfnClusterCapacityProviderAssociationsPropsMixin = exports.CfnClusterPropsMixin = exports.CfnCapacityProviderPropsMixin = 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-ecs"));
/**
 * Creates a capacity provider.
 *
 * Capacity providers are associated with a cluster and are used in capacity provider strategies to facilitate cluster auto scaling. You can create capacity providers for Amazon ECS Managed Instances and EC2 instances. AWS Fargate has the predefined `FARGATE` and `FARGATE_SPOT` capacity providers.
 *
 * @cloudformationResource AWS::ECS::CapacityProvider
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-capacityprovider.html
 */
class CfnCapacityProviderPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnCapacityProviderPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingGroupProvider", "clusterName", "managedInstancesProvider", "name", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::CapacityProvider`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnCapacityProviderMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnCapacityProviderPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnCapacityProviderMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnCapacityProvider.isCfnCapacityProvider(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnCapacityProviderPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnCapacityProviderPropsMixin = CfnCapacityProviderPropsMixin;
// @ts-ignore TS6133
function flattenCfnCapacityProviderPropsMixinAutoScalingGroupProviderProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        autoScalingGroupArn: (!props.autoScalingGroupArn ? undefined : cdk.getRefProperty(props.autoScalingGroupArn?.autoScalingGroupRef, 'autoScalingGroupName') ?? cdk.ensureStringOrUndefined(props.autoScalingGroupArn, "autoScalingGroupArn", "autoscaling.IAutoScalingGroupRef | string")),
        managedDraining: (!props.managedDraining ? undefined : props.managedDraining),
        managedScaling: (!props.managedScaling ? undefined : props.managedScaling),
        managedTerminationProtection: (!props.managedTerminationProtection ? undefined : props.managedTerminationProtection)
    };
}
// @ts-ignore TS6133
function flattenCfnCapacityProviderMixinProps(props) {
    const ret = {};
    if ((props.autoScalingGroupProvider !== undefined))
        ret.autoScalingGroupProvider = flattenCfnCapacityProviderPropsMixinAutoScalingGroupProviderProperty(props.autoScalingGroupProvider);
    return ret;
}
/**
 * The `AWS::ECS::Cluster` resource creates an Amazon Elastic Container Service (Amazon ECS) cluster.
 *
 * @cloudformationResource AWS::ECS::Cluster
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html
 */
class CfnClusterPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnClusterPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["capacityProviders", "clusterName", "clusterSettings", "configuration", "defaultCapacityProviderStrategy", "serviceConnectDefaults", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::Cluster`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnClusterMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnClusterPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnClusterMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnCluster.isCfnCluster(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnClusterPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnClusterPropsMixin = CfnClusterPropsMixin;
// @ts-ignore TS6133
function flattenCfnClusterPropsMixinExecuteCommandLogConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cloudWatchEncryptionEnabled: (!props.cloudWatchEncryptionEnabled ? undefined : props.cloudWatchEncryptionEnabled),
        cloudWatchLogGroupName: (!props.cloudWatchLogGroupName ? undefined : cdk.getRefProperty(props.cloudWatchLogGroupName?.logGroupRef, 'logGroupName') ?? cdk.ensureStringOrUndefined(props.cloudWatchLogGroupName, "cloudWatchLogGroupName", "logs.ILogGroupRef | string")),
        s3BucketName: (!props.s3BucketName ? undefined : props.s3BucketName),
        s3EncryptionEnabled: (!props.s3EncryptionEnabled ? undefined : props.s3EncryptionEnabled),
        s3KeyPrefix: (!props.s3KeyPrefix ? undefined : props.s3KeyPrefix)
    };
}
// @ts-ignore TS6133
function flattenCfnClusterPropsMixinExecuteCommandConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        kmsKeyId: (!props.kmsKeyId ? undefined : cdk.getRefProperty(props.kmsKeyId?.keyRef, 'keyArn') ?? cdk.ensureStringOrUndefined(props.kmsKeyId, "kmsKeyId", "kms.IKeyRef | string")),
        logConfiguration: (!props.logConfiguration ? undefined : (!props.logConfiguration ? undefined : flattenCfnClusterPropsMixinExecuteCommandLogConfigurationProperty(props.logConfiguration))),
        logging: (!props.logging ? undefined : props.logging)
    };
}
// @ts-ignore TS6133
function flattenCfnClusterPropsMixinClusterConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        executeCommandConfiguration: (!props.executeCommandConfiguration ? undefined : (!props.executeCommandConfiguration ? undefined : flattenCfnClusterPropsMixinExecuteCommandConfigurationProperty(props.executeCommandConfiguration))),
        managedStorageConfiguration: (!props.managedStorageConfiguration ? undefined : props.managedStorageConfiguration)
    };
}
// @ts-ignore TS6133
function flattenCfnClusterMixinProps(props) {
    const ret = {};
    if ((props.capacityProviders !== undefined))
        ret.capacityProviders = cdk.mapArrayInPlace(props.capacityProviders, (item) => cdk.getRefProperty(item?.capacityProviderRef, 'capacityProviderName') ?? cdk.ensureStringOrUndefined(item, "capacityProviders", "ecs.ICapacityProviderRef | string"));
    if ((props.configuration !== undefined))
        ret.configuration = flattenCfnClusterPropsMixinClusterConfigurationProperty(props.configuration);
    return ret;
}
/**
 * The `AWS::ECS::ClusterCapacityProviderAssociations` resource associates one or more capacity providers and a default capacity provider strategy with a cluster.
 *
 * @cloudformationResource AWS::ECS::ClusterCapacityProviderAssociations
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html
 */
class CfnClusterCapacityProviderAssociationsPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnClusterCapacityProviderAssociationsPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["capacityProviders", "cluster", "defaultCapacityProviderStrategy"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::ClusterCapacityProviderAssociations`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnClusterCapacityProviderAssociationsMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnClusterCapacityProviderAssociationsPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnClusterCapacityProviderAssociationsMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnClusterCapacityProviderAssociations.isCfnClusterCapacityProviderAssociations(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnClusterCapacityProviderAssociationsPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnClusterCapacityProviderAssociationsPropsMixin = CfnClusterCapacityProviderAssociationsPropsMixin;
// @ts-ignore TS6133
function flattenCfnClusterCapacityProviderAssociationsMixinProps(props) {
    const ret = {};
    if ((props.capacityProviders !== undefined))
        ret.capacityProviders = cdk.mapArrayInPlace(props.capacityProviders, (item) => cdk.getRefProperty(item?.capacityProviderRef, 'capacityProviderName') ?? cdk.ensureStringOrUndefined(item, "capacityProviders", "ecs.ICapacityProviderRef | string"));
    if ((props.cluster !== undefined))
        ret.cluster = cdk.getRefProperty(props.cluster?.clusterRef, 'clusterArn') ?? cdk.getRefProperty(props.cluster?.clusterRef, 'clusterName') ?? cdk.ensureStringOrUndefined(props.cluster, "cluster", "ecs.IClusterRef | string");
    return ret;
}
/**
 * Modifies which task set in a service is the primary task set.
 *
 * Any parameters that are updated on the primary task set in a service will transition to the service. This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS Deployment Types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * @cloudformationResource AWS::ECS::PrimaryTaskSet
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-primarytaskset.html
 */
class CfnPrimaryTaskSetPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnPrimaryTaskSetPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cluster", "service", "taskSetId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::PrimaryTaskSet`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnPrimaryTaskSetMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnPrimaryTaskSetPropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnPrimaryTaskSet.isCfnPrimaryTaskSet(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnPrimaryTaskSetPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnPrimaryTaskSetPropsMixin = CfnPrimaryTaskSetPropsMixin;
/**
 * The `AWS::ECS::Service` resource creates an Amazon Elastic Container Service (Amazon ECS) service that runs and maintains the requested number of tasks and associated load balancers.
 *
 * > The stack update fails if you change any properties that require replacement and at least one Amazon ECS Service Connect `ServiceConnectConfiguration` property is configured. This is because AWS CloudFormation creates the replacement service first, but each `ServiceConnectService` must have a name that is unique in the namespace. > Starting April 15, 2023, AWS ; will not onboard new customers to Amazon Elastic Inference (EI), and will help current customers migrate their workloads to options that offer better price and performance. After April 15, 2023, new customers will not be able to launch instances with Amazon EI accelerators in Amazon SageMaker, Amazon ECS , or Amazon EC2 . However, customers who have used Amazon EI at least once during the past 30-day period are considered current customers and will be able to continue using the service. > On June 12, 2025, Amazon ECS launched support for updating capacity provider configuration for Amazon ECS services. With this launch, Amazon ECS also aligned the CloudFormation update behavior for `CapacityProviderStrategy` parameter with the standard practice. For more information, see [Amazon ECS adds support for updating capacity provider configuration for ECS services](https://docs.aws.amazon.com/about-aws/whats-new/2025/05/amazon-ecs-capacity-provider-configuration-ecs/) . Previously Amazon ECS ignored the `CapacityProviderStrategy` property if it was set to an empty list for example, `[]` in CloudFormation , because updating capacity provider configuration was not supported. Now, with support for capacity provider updates, customers can remove capacity providers from a service by passing an empty list. When you specify an empty list ( `[]` ) for the `CapacityProviderStrategy` property in your CloudFormation template, Amazon ECS will remove any capacity providers associated with the service, as follows:
 * >
 * > - For services created with a capacity provider strategy after the launch:
 * >
 * > - If there's a cluster default strategy set, the service will revert to using that default strategy.
 * > - If no cluster default strategy exists, you will receive the following error:
 * >
 * > No launch type to fall back to for empty capacity provider strategy. Your service was not created with a launch type.
 * > - For services created with a capacity provider strategy prior to the launch:
 * >
 * > - If `CapacityProviderStrategy` had `FARGATE_SPOT` or `FARGATE` capacity providers, the launch type will be updated to `FARGATE` and the capacity provider will be removed.
 * > - If the strategy included Auto Scaling group capacity providers, the service will revert to EC2 launch type, and the Auto Scaling group capacity providers will not be used.
 * >
 * > Recommended Actions
 * >
 * > If you are currently using `CapacityProviderStrategy: []` in your CloudFormation templates, you should take one of the following actions:
 * >
 * > - If you do not intend to update the Capacity Provider Strategy:
 * >
 * > - Remove the `CapacityProviderStrategy` property entirely from your CloudFormation template
 * > - Alternatively, use `!Ref AWS ::NoValue` for the `CapacityProviderStrategy` property in your template
 * > - If you intend to maintain or update the Capacity Provider Strategy, specify the actual Capacity Provider Strategy for the service in your CloudFormation template.
 * >
 * > If your CloudFormation template had an empty list ([]) for `CapacityProviderStrategy` prior to the aforementioned launch on June 12, and you are using the same template with `CapacityProviderStrategy: []` , you might encounter the following error:
 * >
 * > Invalid request provided: When switching from launch type to capacity provider strategy on an existing service, or making a change to a capacity provider strategy on a service that is already using one, you must force a new deployment. (Service: Ecs, Status Code: 400, Request ID: xxx) (SDK Attempt Count: 1)" (RequestToken: xxx HandlerErrorCode: InvalidRequest)
 * >
 * > Note that CloudFormation automatically initiates a new deployment when it detects a parameter change, but customers cannot choose to force a deployment through CloudFormation . This is an invalid input scenario that requires one of the remediation actions listed above.
 * >
 * > If you are experiencing active production issues related to this change, contact AWS Support or your Technical Account Manager.
 *
 * @cloudformationResource AWS::ECS::Service
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-service.html
 */
class CfnServicePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnServicePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["availabilityZoneRebalancing", "capacityProviderStrategy", "cluster", "deploymentConfiguration", "deploymentController", "desiredCount", "enableEcsManagedTags", "enableExecuteCommand", "forceNewDeployment", "healthCheckGracePeriodSeconds", "launchType", "loadBalancers", "networkConfiguration", "placementConstraints", "placementStrategies", "platformVersion", "propagateTags", "role", "schedulingStrategy", "serviceConnectConfiguration", "serviceName", "serviceRegistries", "tags", "taskDefinition", "volumeConfigurations", "vpcLatticeConfigurations"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::Service`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnServiceMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnServicePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnServiceMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnService.isCfnService(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnServicePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnServicePropsMixin = CfnServicePropsMixin;
// @ts-ignore TS6133
function flattenCfnServicePropsMixinLoadBalancerProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        advancedConfiguration: (!props.advancedConfiguration ? undefined : props.advancedConfiguration),
        containerName: (!props.containerName ? undefined : props.containerName),
        containerPort: (!props.containerPort ? undefined : props.containerPort),
        loadBalancerName: (!props.loadBalancerName ? undefined : props.loadBalancerName),
        targetGroupArn: (!props.targetGroupArn ? undefined : cdk.getRefProperty(props.targetGroupArn?.targetGroupRef, 'targetGroupArn') ?? cdk.ensureStringOrUndefined(props.targetGroupArn, "targetGroupArn", "elasticloadbalancingv2.ITargetGroupRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinCapacityProviderStrategyItemProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        base: (!props.base ? undefined : props.base),
        capacityProvider: (!props.capacityProvider ? undefined : cdk.getRefProperty(props.capacityProvider?.capacityProviderRef, 'capacityProviderName') ?? cdk.ensureStringOrUndefined(props.capacityProvider, "capacityProvider", "ecs.ICapacityProviderRef | string")),
        weight: (!props.weight ? undefined : props.weight)
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinAwsVpcConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        assignPublicIp: (!props.assignPublicIp ? undefined : props.assignPublicIp),
        securityGroups: (!props.securityGroups ? undefined : cdk.mapArrayInPlace(props.securityGroups, (item) => cdk.getRefProperty(item?.securityGroupRef, 'securityGroupId') ?? cdk.ensureStringOrUndefined(item, "securityGroups", "ec2.ISecurityGroupRef | string"))),
        subnets: (!props.subnets ? undefined : cdk.mapArrayInPlace(props.subnets, (item) => cdk.getRefProperty(item?.subnetRef, 'subnetId') ?? cdk.ensureStringOrUndefined(item, "subnets", "ec2.ISubnetRef | string")))
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinNetworkConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        awsvpcConfiguration: (!props.awsvpcConfiguration ? undefined : (!props.awsvpcConfiguration ? undefined : flattenCfnServicePropsMixinAwsVpcConfigurationProperty(props.awsvpcConfiguration)))
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinDeploymentAlarmsProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        alarmNames: (!props.alarmNames ? undefined : cdk.mapArrayInPlace(props.alarmNames, (item) => cdk.getRefProperty(item?.alarmRef, 'alarmName') ?? cdk.ensureStringOrUndefined(item, "alarmNames", "cloudwatch.IAlarmRef | string"))),
        enable: (!props.enable ? undefined : props.enable),
        rollback: (!props.rollback ? undefined : props.rollback)
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinDeploymentConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        alarms: (!props.alarms ? undefined : (!props.alarms ? undefined : flattenCfnServicePropsMixinDeploymentAlarmsProperty(props.alarms))),
        bakeTimeInMinutes: (!props.bakeTimeInMinutes ? undefined : props.bakeTimeInMinutes),
        canaryConfiguration: (!props.canaryConfiguration ? undefined : props.canaryConfiguration),
        deploymentCircuitBreaker: (!props.deploymentCircuitBreaker ? undefined : props.deploymentCircuitBreaker),
        lifecycleHooks: (!props.lifecycleHooks ? undefined : props.lifecycleHooks),
        linearConfiguration: (!props.linearConfiguration ? undefined : props.linearConfiguration),
        maximumPercent: (!props.maximumPercent ? undefined : props.maximumPercent),
        minimumHealthyPercent: (!props.minimumHealthyPercent ? undefined : props.minimumHealthyPercent),
        strategy: (!props.strategy ? undefined : props.strategy)
    };
}
// @ts-ignore TS6133
function flattenCfnServiceMixinProps(props) {
    const ret = {};
    if ((props.capacityProviderStrategy !== undefined))
        ret.capacityProviderStrategy = (cdk.isResolvableObject(props.capacityProviderStrategy) ? props.capacityProviderStrategy : cdk.mapArrayInPlace(props.capacityProviderStrategy, (item) => flattenCfnServicePropsMixinCapacityProviderStrategyItemProperty(item)));
    if ((props.cluster !== undefined))
        ret.cluster = cdk.getRefProperty(props.cluster?.clusterRef, 'clusterName') ?? cdk.ensureStringOrUndefined(props.cluster, "cluster", "ecs.IClusterRef | string");
    if ((props.deploymentConfiguration !== undefined))
        ret.deploymentConfiguration = flattenCfnServicePropsMixinDeploymentConfigurationProperty(props.deploymentConfiguration);
    if ((props.loadBalancers !== undefined))
        ret.loadBalancers = (cdk.isResolvableObject(props.loadBalancers) ? props.loadBalancers : cdk.mapArrayInPlace(props.loadBalancers, (item) => flattenCfnServicePropsMixinLoadBalancerProperty(item)));
    if ((props.networkConfiguration !== undefined))
        ret.networkConfiguration = flattenCfnServicePropsMixinNetworkConfigurationProperty(props.networkConfiguration);
    if ((props.role !== undefined))
        ret.role = cdk.getRefProperty(props.role?.roleRef, 'roleArn') ?? cdk.getRefProperty(props.role?.roleRef, 'roleName') ?? cdk.ensureStringOrUndefined(props.role, "role", "iam.IRoleRef | string");
    if ((props.taskDefinition !== undefined))
        ret.taskDefinition = cdk.getRefProperty(props.taskDefinition?.taskDefinitionRef, 'taskDefinitionArn') ?? cdk.ensureStringOrUndefined(props.taskDefinition, "taskDefinition", "ecs.ITaskDefinitionRef | string");
    return ret;
}
/**
 * Registers a new task definition from the supplied `family` and `containerDefinitions` .
 *
 * Optionally, you can add data volumes to your containers with the `volumes` parameter. For more information about task definition parameters and defaults, see [Amazon ECS Task Definitions](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * You can specify a role for your task with the `taskRoleArn` parameter. When you specify a role for a task, its containers can then use the latest versions of the AWS CLI or SDKs to make API requests to the AWS services that are specified in the policy that's associated with the role. For more information, see [IAM Roles for Tasks](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * You can specify a Docker networking mode for the containers in your task definition with the `networkMode` parameter. If you specify the `awsvpc` network mode, the task is allocated an elastic network interface, and you must specify a [NetworkConfiguration](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_NetworkConfiguration.html) when you create a service or run a task with the task definition. For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * @cloudformationResource AWS::ECS::TaskDefinition
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskdefinition.html
 */
class CfnTaskDefinitionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnTaskDefinitionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["containerDefinitions", "cpu", "enableFaultInjection", "ephemeralStorage", "executionRoleArn", "family", "inferenceAccelerators", "ipcMode", "memory", "networkMode", "pidMode", "placementConstraints", "proxyConfiguration", "requiresCompatibilities", "runtimePlatform", "tags", "taskRoleArn", "volumes"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::TaskDefinition`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnTaskDefinitionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTaskDefinitionPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnTaskDefinitionMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnTaskDefinition.isCfnTaskDefinition(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTaskDefinitionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTaskDefinitionPropsMixin = CfnTaskDefinitionPropsMixin;
// @ts-ignore TS6133
function flattenCfnTaskDefinitionPropsMixinAuthorizationConfigProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        accessPointId: (!props.accessPointId ? undefined : cdk.getRefProperty(props.accessPointId?.accessPointRef, 'accessPointId') ?? cdk.ensureStringOrUndefined(props.accessPointId, "accessPointId", "efs.IAccessPointRef | string")),
        iam: (!props.iam ? undefined : props.iam)
    };
}
// @ts-ignore TS6133
function flattenCfnTaskDefinitionPropsMixinEFSVolumeConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authorizationConfig: (!props.authorizationConfig ? undefined : (!props.authorizationConfig ? undefined : flattenCfnTaskDefinitionPropsMixinAuthorizationConfigProperty(props.authorizationConfig))),
        filesystemId: (!props.filesystemId ? undefined : cdk.getRefProperty(props.filesystemId?.fileSystemRef, 'fileSystemId') ?? cdk.ensureStringOrUndefined(props.filesystemId, "filesystemId", "efs.IFileSystemRef | string")),
        rootDirectory: (!props.rootDirectory ? undefined : props.rootDirectory),
        transitEncryption: (!props.transitEncryption ? undefined : props.transitEncryption),
        transitEncryptionPort: (!props.transitEncryptionPort ? undefined : props.transitEncryptionPort)
    };
}
// @ts-ignore TS6133
function flattenCfnTaskDefinitionPropsMixinVolumeProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        configuredAtLaunch: (!props.configuredAtLaunch ? undefined : props.configuredAtLaunch),
        dockerVolumeConfiguration: (!props.dockerVolumeConfiguration ? undefined : props.dockerVolumeConfiguration),
        efsVolumeConfiguration: (!props.efsVolumeConfiguration ? undefined : (!props.efsVolumeConfiguration ? undefined : flattenCfnTaskDefinitionPropsMixinEFSVolumeConfigurationProperty(props.efsVolumeConfiguration))),
        fSxWindowsFileServerVolumeConfiguration: (!props.fSxWindowsFileServerVolumeConfiguration ? undefined : props.fSxWindowsFileServerVolumeConfiguration),
        host: (!props.host ? undefined : props.host),
        name: (!props.name ? undefined : props.name),
        s3FilesVolumeConfiguration: (!props.s3FilesVolumeConfiguration ? undefined : props.s3FilesVolumeConfiguration)
    };
}
// @ts-ignore TS6133
function flattenCfnTaskDefinitionMixinProps(props) {
    const ret = {};
    if ((props.executionRoleArn !== undefined))
        ret.executionRoleArn = cdk.getRefProperty(props.executionRoleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.executionRoleArn, "executionRoleArn", "iam.IRoleRef | string");
    if ((props.taskRoleArn !== undefined))
        ret.taskRoleArn = cdk.getRefProperty(props.taskRoleArn?.roleRef, 'roleArn') ?? cdk.getRefProperty(props.taskRoleArn?.roleRef, 'roleName') ?? cdk.ensureStringOrUndefined(props.taskRoleArn, "taskRoleArn", "iam.IRoleRef | string");
    if ((props.volumes !== undefined))
        ret.volumes = (cdk.isResolvableObject(props.volumes) ? props.volumes : cdk.mapArrayInPlace(props.volumes, (item) => flattenCfnTaskDefinitionPropsMixinVolumeProperty(item)));
    return ret;
}
/**
 * Create a task set in the specified cluster and service.
 *
 * This is used when a service uses the `EXTERNAL` deployment controller type. For more information, see [Amazon ECS deployment types](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-types.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * > On March 21, 2024, a change was made to resolve the task definition revision before authorization. When a task definition revision is not specified, authorization will occur using the latest revision of a task definition.
 *
 * For information about the maximum number of task sets and other quotas, see [Amazon ECS service quotas](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-quotas.html) in the *Amazon Elastic Container Service Developer Guide* .
 *
 * @cloudformationResource AWS::ECS::TaskSet
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-taskset.html
 */
class CfnTaskSetPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnTaskSetPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["capacityProviderStrategy", "cluster", "externalId", "launchType", "loadBalancers", "networkConfiguration", "platformVersion", "scale", "service", "serviceRegistries", "tags", "taskDefinition"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::TaskSet`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnTaskSetMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnTaskSetPropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnTaskSet.isCfnTaskSet(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnTaskSetPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnTaskSetPropsMixin = CfnTaskSetPropsMixin;
/**
 * Information about a daemon resource.
 *
 * @cloudformationResource AWS::ECS::Daemon
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-daemon.html
 */
class CfnDaemonPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnDaemonPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["capacityProviderArns", "clusterArn", "daemonName", "daemonTaskDefinitionArn", "deploymentConfiguration", "enableEcsManagedTags", "enableExecuteCommand", "propagateTags", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::Daemon`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnDaemonMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDaemonPropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnDaemon.isCfnDaemon(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDaemonPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDaemonPropsMixin = CfnDaemonPropsMixin;
/**
 * The details of a daemon task definition.
 *
 * A daemon task definition is a template that describes the containers that form a daemon. Daemons deploy cross-cutting software agents independently across your Amazon ECS infrastructure.
 *
 * @cloudformationResource AWS::ECS::DaemonTaskDefinition
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-daemontaskdefinition.html
 */
class CfnDaemonTaskDefinitionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnDaemonTaskDefinitionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["containerDefinitions", "cpu", "executionRoleArn", "family", "memory", "tags", "taskRoleArn", "volumes"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::DaemonTaskDefinition`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnDaemonTaskDefinitionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnDaemonTaskDefinitionPropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnDaemonTaskDefinition.isCfnDaemonTaskDefinition(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnDaemonTaskDefinitionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnDaemonTaskDefinitionPropsMixin = CfnDaemonTaskDefinitionPropsMixin;
/**
 * Creates an Express service that simplifies deploying containerized web applications on Amazon ECS with managed AWS infrastructure.
 *
 * This operation provisions and configures Application Load Balancers, target groups, security groups, and auto-scaling policies automatically.
 *
 * Specify a primary container configuration with your application image and basic settings. Amazon ECS creates the necessary AWS resources for traffic distribution, health monitoring, network access control, and capacity management.
 *
 * Provide an execution role for task operations and an infrastructure role for managing AWS resources on your behalf.
 *
 * @cloudformationResource AWS::ECS::ExpressGatewayService
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-expressgatewayservice.html
 */
class CfnExpressGatewayServicePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_ecs.CfnExpressGatewayServicePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["cluster", "cpu", "executionRoleArn", "healthCheckPath", "infrastructureRoleArn", "memory", "networkConfiguration", "primaryContainer", "scalingTarget", "serviceName", "tags", "taskRoleArn"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::ECS::ExpressGatewayService`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_ecs_CfnExpressGatewayServiceMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnExpressGatewayServicePropsMixin);
            }
            throw error;
        }
        this.props = props;
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnExpressGatewayService.isCfnExpressGatewayService(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnExpressGatewayServicePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnExpressGatewayServicePropsMixin = CfnExpressGatewayServicePropsMixin;
