"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.CfnVpcIngressConnectionPropsMixin = exports.CfnVpcConnectorPropsMixin = exports.CfnServicePropsMixin = exports.CfnObservabilityConfigurationPropsMixin = exports.CfnAutoScalingConfigurationPropsMixin = 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-apprunner"));
/**
 * Specify an AWS App Runner Automatic Scaling configuration by using the `AWS::AppRunner::AutoScalingConfiguration` resource in an AWS CloudFormation template.
 *
 * The `AWS::AppRunner::AutoScalingConfiguration` resource is an AWS App Runner resource type that specifies an App Runner automatic scaling configuration.
 *
 * App Runner requires this resource to set non-default auto scaling settings for instances used to process the web requests. You can share an auto scaling configuration across multiple services.
 *
 * Create multiple revisions of a configuration by calling this action multiple times using the same `AutoScalingConfigurationName` . The call returns incremental `AutoScalingConfigurationRevision` values. When you create a service and configure an auto scaling configuration resource, the service uses the latest active revision of the auto scaling configuration by default. You can optionally configure the service to use a specific revision.
 *
 * Configure a higher `MinSize` to increase the spread of your App Runner service over more Availability Zones in the AWS Region . The tradeoff is a higher minimal cost.
 *
 * Configure a lower `MaxSize` to control your cost. The tradeoff is lower responsiveness during peak demand.
 *
 * @cloudformationResource AWS::AppRunner::AutoScalingConfiguration
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-autoscalingconfiguration.html
 */
class CfnAutoScalingConfigurationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_apprunner.CfnAutoScalingConfigurationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingConfigurationName", "maxConcurrency", "maxSize", "minSize", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AppRunner::AutoScalingConfiguration`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_apprunner_CfnAutoScalingConfigurationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnAutoScalingConfigurationPropsMixin);
            }
            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.CfnAutoScalingConfiguration.isCfnAutoScalingConfiguration(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnAutoScalingConfigurationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnAutoScalingConfigurationPropsMixin = CfnAutoScalingConfigurationPropsMixin;
/**
 * Specify an AWS App Runner observability configuration by using the `AWS::AppRunner::ObservabilityConfiguration` resource in an AWS CloudFormation template.
 *
 * The `AWS::AppRunner::ObservabilityConfiguration` resource is an AWS App Runner resource type that specifies an App Runner observability configuration.
 *
 * App Runner requires this resource when you specify App Runner services and you want to enable non-default observability features. You can share an observability configuration across multiple services.
 *
 * Create multiple revisions of a configuration by specifying this resource multiple times using the same `ObservabilityConfigurationName` . App Runner creates multiple resources with incremental `ObservabilityConfigurationRevision` values. When you specify a service and configure an observability configuration resource, the service uses the latest active revision of the observability configuration by default. You can optionally configure the service to use a specific revision.
 *
 * The observability configuration resource is designed to configure multiple features (currently one feature, tracing). This resource takes optional parameters that describe the configuration of these features (currently one parameter, `TraceConfiguration` ). If you don't specify a feature parameter, App Runner doesn't enable the feature.
 *
 * @cloudformationResource AWS::AppRunner::ObservabilityConfiguration
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-observabilityconfiguration.html
 */
class CfnObservabilityConfigurationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_apprunner.CfnObservabilityConfigurationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["observabilityConfigurationName", "tags", "traceConfiguration"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AppRunner::ObservabilityConfiguration`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_apprunner_CfnObservabilityConfigurationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnObservabilityConfigurationPropsMixin);
            }
            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.CfnObservabilityConfiguration.isCfnObservabilityConfiguration(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnObservabilityConfigurationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnObservabilityConfigurationPropsMixin = CfnObservabilityConfigurationPropsMixin;
/**
 * Specify an AWS App Runner service by using the `AWS::AppRunner::Service` resource in an AWS CloudFormation template.
 *
 * The `AWS::AppRunner::Service` resource is an AWS App Runner resource type that specifies an App Runner service.
 *
 * @cloudformationResource AWS::AppRunner::Service
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-service.html
 */
class CfnServicePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_apprunner.CfnServicePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["autoScalingConfigurationArn", "encryptionConfiguration", "healthCheckConfiguration", "instanceConfiguration", "networkConfiguration", "observabilityConfiguration", "serviceName", "sourceConfiguration", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AppRunner::Service`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_apprunner_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 flattenCfnServicePropsMixinInstanceConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        cpu: (!props.cpu ? undefined : props.cpu),
        instanceRoleArn: (!props.instanceRoleArn ? undefined : cdk.getRefProperty(props.instanceRoleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.instanceRoleArn, "instanceRoleArn", "iam.IRoleRef | string")),
        memory: (!props.memory ? undefined : props.memory)
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinAuthenticationConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        accessRoleArn: (!props.accessRoleArn ? undefined : cdk.getRefProperty(props.accessRoleArn?.roleRef, 'roleArn') ?? cdk.ensureStringOrUndefined(props.accessRoleArn, "accessRoleArn", "iam.IRoleRef | string")),
        connectionArn: (!props.connectionArn ? undefined : props.connectionArn)
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinSourceConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        authenticationConfiguration: (!props.authenticationConfiguration ? undefined : (!props.authenticationConfiguration ? undefined : flattenCfnServicePropsMixinAuthenticationConfigurationProperty(props.authenticationConfiguration))),
        autoDeploymentsEnabled: (!props.autoDeploymentsEnabled ? undefined : props.autoDeploymentsEnabled),
        codeRepository: (!props.codeRepository ? undefined : props.codeRepository),
        imageRepository: (!props.imageRepository ? undefined : props.imageRepository)
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinEgressConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        egressType: (!props.egressType ? undefined : props.egressType),
        vpcConnectorArn: (!props.vpcConnectorArn ? undefined : cdk.getRefProperty(props.vpcConnectorArn?.vpcConnectorRef, 'vpcConnectorArn') ?? cdk.ensureStringOrUndefined(props.vpcConnectorArn, "vpcConnectorArn", "apprunner.IVpcConnectorRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnServicePropsMixinNetworkConfigurationProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        egressConfiguration: (!props.egressConfiguration ? undefined : (!props.egressConfiguration ? undefined : flattenCfnServicePropsMixinEgressConfigurationProperty(props.egressConfiguration))),
        ingressConfiguration: (!props.ingressConfiguration ? undefined : props.ingressConfiguration),
        ipAddressType: (!props.ipAddressType ? undefined : props.ipAddressType)
    };
}
// @ts-ignore TS6133
function flattenCfnServiceMixinProps(props) {
    const ret = {};
    if ((props.instanceConfiguration !== undefined))
        ret.instanceConfiguration = flattenCfnServicePropsMixinInstanceConfigurationProperty(props.instanceConfiguration);
    if ((props.networkConfiguration !== undefined))
        ret.networkConfiguration = flattenCfnServicePropsMixinNetworkConfigurationProperty(props.networkConfiguration);
    if ((props.sourceConfiguration !== undefined))
        ret.sourceConfiguration = flattenCfnServicePropsMixinSourceConfigurationProperty(props.sourceConfiguration);
    return ret;
}
/**
 * Specify an AWS App Runner VPC connector by using the `AWS::AppRunner::VpcConnector` resource in an AWS CloudFormation template.
 *
 * The `AWS::AppRunner::VpcConnector` resource is an AWS App Runner resource type that specifies an App Runner VPC connector.
 *
 * App Runner requires this resource when you want to associate your App Runner service to a custom Amazon Virtual Private Cloud ( Amazon VPC ).
 *
 * @cloudformationResource AWS::AppRunner::VpcConnector
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-vpcconnector.html
 */
class CfnVpcConnectorPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_apprunner.CfnVpcConnectorPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["securityGroups", "subnets", "tags", "vpcConnectorName"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AppRunner::VpcConnector`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_apprunner_CfnVpcConnectorMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnVpcConnectorPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnVpcConnectorMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnVpcConnector.isCfnVpcConnector(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnVpcConnectorPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnVpcConnectorPropsMixin = CfnVpcConnectorPropsMixin;
// @ts-ignore TS6133
function flattenCfnVpcConnectorMixinProps(props) {
    const ret = {};
    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;
}
/**
 * Specify an AWS App Runner VPC Ingress Connection by using the `AWS::AppRunner::VpcIngressConnection` resource in an AWS CloudFormation template.
 *
 * The `AWS::AppRunner::VpcIngressConnection` resource is an AWS App Runner resource type that specifies an App Runner VPC Ingress Connection.
 *
 * App Runner requires this resource when you want to associate your App Runner service to an Amazon VPC endpoint.
 *
 * @cloudformationResource AWS::AppRunner::VpcIngressConnection
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apprunner-vpcingressconnection.html
 */
class CfnVpcIngressConnectionPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_apprunner.CfnVpcIngressConnectionPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["ingressVpcConfiguration", "serviceArn", "tags", "vpcIngressConnectionName"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::AppRunner::VpcIngressConnection`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_apprunner_CfnVpcIngressConnectionMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnVpcIngressConnectionPropsMixin);
            }
            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.CfnVpcIngressConnection.isCfnVpcIngressConnection(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnVpcIngressConnectionPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnVpcIngressConnectionPropsMixin = CfnVpcIngressConnectionPropsMixin;
