"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.CfnServicePropsMixin = exports.CfnRoutePropsMixin = exports.CfnEnvironmentPropsMixin = exports.CfnApplicationPropsMixin = 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-refactorspaces"));
/**
 * > AWS Migration Hub is no longer open to new customers as of November 7, 2025.
 *
 * For capabilities similar to AWS Migration Hub , explore [AWS Migration Hub](https://docs.aws.amazon.com/https://aws.amazon.com/transform) .
 *
 * Creates an AWS Migration Hub Refactor Spaces application. The account that owns the environment also owns the applications created inside the environment, regardless of the account that creates the application. Refactor Spaces provisions an Amazon API Gateway, API Gateway VPC link, and Network Load Balancer for the application proxy inside your account.
 *
 * In environments created with a [CreateEnvironment:NetworkFabricType](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType) of `NONE` you need to configure [VPC to VPC connectivity](https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/amazon-vpc-to-amazon-vpc-connectivity-options.html) between your service VPC and the application proxy VPC to route traffic through the application proxy to a service with a private URL endpoint. For more information, see [Create an application](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/userguide/getting-started-create-application.html) in the *Refactor Spaces User Guide* .
 *
 * @cloudformationResource AWS::RefactorSpaces::Application
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-refactorspaces-application.html
 */
class CfnApplicationPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_refactorspaces.CfnApplicationPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["apiGatewayProxy", "environmentIdentifier", "name", "proxyType", "tags", "vpcId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RefactorSpaces::Application`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_refactorspaces_CfnApplicationMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnApplicationPropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnApplicationMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnApplication.isCfnApplication(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnApplicationPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnApplicationPropsMixin = CfnApplicationPropsMixin;
// @ts-ignore TS6133
function flattenCfnApplicationMixinProps(props) {
    const ret = {};
    if ((props.environmentIdentifier !== undefined))
        ret.environmentIdentifier = cdk.getRefProperty(props.environmentIdentifier?.environmentRef, 'environmentIdentifier') ?? cdk.ensureStringOrUndefined(props.environmentIdentifier, "environmentIdentifier", "refactorspaces.IEnvironmentRef | string");
    if ((props.vpcId !== undefined))
        ret.vpcId = cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string");
    return ret;
}
/**
 * > AWS Migration Hub is no longer open to new customers as of November 7, 2025.
 *
 * For capabilities similar to AWS Migration Hub , explore [AWS Migration Hub](https://docs.aws.amazon.com/https://aws.amazon.com/transform) .
 *
 * Creates an AWS Migration Hub Refactor Spaces environment. The caller owns the environment resource, and all Refactor Spaces applications, services, and routes created within the environment. They are referred to as the *environment owner* . The environment owner has cross-account visibility and control of Refactor Spaces resources that are added to the environment by other accounts that the environment is shared with.
 *
 * When creating an environment with a [CreateEnvironment:NetworkFabricType](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType) of `TRANSIT_GATEWAY` , Refactor Spaces provisions a transit gateway to enable services in VPCs to communicate directly across accounts. If [CreateEnvironment:NetworkFabricType](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType) is `NONE` , Refactor Spaces does not create a transit gateway and you must use your network infrastructure to route traffic to services with private URL endpoints.
 *
 * @cloudformationResource AWS::RefactorSpaces::Environment
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-refactorspaces-environment.html
 */
class CfnEnvironmentPropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_refactorspaces.CfnEnvironmentPropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["description", "name", "networkFabricType", "tags"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RefactorSpaces::Environment`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_refactorspaces_CfnEnvironmentMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnEnvironmentPropsMixin);
            }
            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.CfnEnvironment.isCfnEnvironment(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnEnvironmentPropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnEnvironmentPropsMixin = CfnEnvironmentPropsMixin;
/**
 * Creates an AWS Migration Hub Refactor Spaces route.
 *
 * The account owner of the service resource is always the environment owner, regardless of which account creates the route. Routes target a service in the application. If an application does not have any routes, then the first route must be created as a `DEFAULT` `RouteType` .
 *
 * When created, the default route defaults to an active state so state is not a required input. However, like all other state values the state of the default route can be updated after creation, but only when all other routes are also inactive. Conversely, no route can be active without the default route also being active.
 *
 * > In the `AWS::RefactorSpaces::Route` resource, you can only update the `ActivationState` property, which resides under the `UriPathRoute` and `DefaultRoute` properties. All other properties associated with the `AWS::RefactorSpaces::Route` cannot be updated, even though the property description might indicate otherwise. Updating all other properties will result in the replacement of Route.
 *
 * When you create a route, Refactor Spaces configures the ABPlong to send traffic to the target service as follows:
 *
 * - *URL Endpoints*
 *
 * If the service has a URL endpoint, and the endpoint resolves to a private IP address, Refactor Spaces routes traffic using the ABP VPC link. If a service endpoint resolves to a public IP address, Refactor Spaces routes traffic over the public internet. Services can have HTTP or HTTPS URL endpoints. For HTTPS URLs, publicly-signed certificates are supported. Private Certificate Authorities (CAs) are permitted only if the CA's domain is also publicly resolvable.
 *
 * Refactor Spaces automatically resolves the public Domain Name System (DNS) names that are set in `CreateService:UrlEndpoint` when you create a service. The DNS names resolve when the DNS time-to-live (TTL) expires, or every 60 seconds for TTLs less than 60 seconds. This periodic DNS resolution ensures that the route configuration remains up-to-date.
 *
 * *One-time health check*
 *
 * A one-time health check is performed on the service when either the route is updated from inactive to active, or when it is created with an active state. If the health check fails, the route transitions the route state to `FAILED` , an error code of `SERVICE_ENDPOINT_HEALTH_CHECK_FAILURE` is provided, and no traffic is sent to the service.
 *
 * For private URLs, a target group is created on the Network Load Balancer and the load balancer target group runs default target health checks. By default, the health check is run against the service endpoint URL. Optionally, the health check can be performed against a different protocol, port, and/or path using the [CreateService:UrlEndpoint](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateService.html#migrationhubrefactorspaces-CreateService-request-UrlEndpoint) parameter. All other health check settings for the load balancer use the default values described in the [Health checks for your target groups](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html) in the *Elastic Load Balancing guide* . The health check is considered successful if at least one target within the target group transitions to a healthy state.
 * - *AWS Lambda function endpoints*
 *
 * If the service has an AWS Lambda function endpoint, then Refactor Spaces configures the Lambda function's resource policy to allow the application's ABP to invoke the function.
 *
 * The Lambda function state is checked. If the function is not active, the function configuration is updated so that Lambda resources are provisioned. If the Lambda state is `Failed` , then the route creation fails. For more information, see the [GetFunctionConfiguration's State response parameter](https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html#SSS-GetFunctionConfiguration-response-State) in the *AWS Lambda Developer Guide* .
 *
 * A check is performed to determine that a Lambda function with the specified ARN exists. If it does not exist, the health check fails. For public URLs, a connection is opened to the public endpoint. If the URL is not reachable, the health check fails.
 *
 * *Environments without a network bridge*
 *
 * When you create environments without a network bridge ( [CreateEnvironment:NetworkFabricType](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/APIReference/API_CreateEnvironment.html#migrationhubrefactorspaces-CreateEnvironment-request-NetworkFabricType) is `NONE)` and you use your own networking infrastructure, you need to configure [VPC to VPC connectivity](https://docs.aws.amazon.com/whitepapers/latest/aws-vpc-connectivity-options/amazon-vpc-to-amazon-vpc-connectivity-options.html) between your network and the application proxy VPC. Route creation from the application proxy to service endpoints will fail if your network is not configured to connect to the application proxy VPC. For more information, see [Create a route](https://docs.aws.amazon.com/migrationhub-refactor-spaces/latest/userguide/getting-started-create-role.html) in the *Refactor Spaces User Guide* .
 *
 * @cloudformationResource AWS::RefactorSpaces::Route
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-refactorspaces-route.html
 */
class CfnRoutePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_refactorspaces.CfnRoutePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationIdentifier", "defaultRoute", "environmentIdentifier", "routeType", "serviceIdentifier", "tags", "uriPathRoute"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RefactorSpaces::Route`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_refactorspaces_CfnRouteMixinProps(props);
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_CfnPropertyMixinOptions(options);
        }
        catch (error) {
            if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
                Error.captureStackTrace(error, CfnRoutePropsMixin);
            }
            throw error;
        }
        this.props = {
            ...props,
            ...flattenCfnRouteMixinProps(props)
        };
        this.strategy = (options.strategy ?? cdk.PropertyMergeStrategy.combine());
    }
    /**
     * Check if this mixin supports the given construct
     */
    supports(construct) {
        return (cdk.CfnResource.isCfnResource(construct) && service.CfnRoute.isCfnRoute(construct));
    }
    /**
     * Apply the mixin properties to the construct
     */
    applyTo(construct) {
        if (this.supports(construct)) {
            this.strategy.apply(construct, this.props, CfnRoutePropsMixin.CFN_PROPERTY_KEYS);
        }
    }
}
exports.CfnRoutePropsMixin = CfnRoutePropsMixin;
// @ts-ignore TS6133
function flattenCfnRouteMixinProps(props) {
    const ret = {};
    if ((props.applicationIdentifier !== undefined))
        ret.applicationIdentifier = cdk.getRefProperty(props.applicationIdentifier?.applicationRef, 'applicationIdentifier') ?? cdk.ensureStringOrUndefined(props.applicationIdentifier, "applicationIdentifier", "refactorspaces.IApplicationRef | string");
    if ((props.environmentIdentifier !== undefined))
        ret.environmentIdentifier = cdk.getRefProperty(props.environmentIdentifier?.environmentRef, 'environmentIdentifier') ?? cdk.ensureStringOrUndefined(props.environmentIdentifier, "environmentIdentifier", "refactorspaces.IEnvironmentRef | string");
    if ((props.serviceIdentifier !== undefined))
        ret.serviceIdentifier = cdk.getRefProperty(props.serviceIdentifier?.serviceRef, 'serviceIdentifier') ?? cdk.ensureStringOrUndefined(props.serviceIdentifier, "serviceIdentifier", "refactorspaces.IServiceRef | string");
    return ret;
}
/**
 * > AWS Migration Hub is no longer open to new customers as of November 7, 2025.
 *
 * For capabilities similar to AWS Migration Hub , explore [AWS Migration Hub](https://docs.aws.amazon.com/https://aws.amazon.com/transform) .
 *
 * Creates an AWS Migration Hub Refactor Spaces service. The account owner of the service is always the environment owner, regardless of which account in the environment creates the service. Services have either a URL endpoint in a virtual private cloud (VPC), or a Lambda function endpoint.
 *
 * > If an AWS resource is launched in a service VPC, and you want it to be accessible to all of an environment’s services with VPCs and routes, apply the `RefactorSpacesSecurityGroup` to the resource. Alternatively, to add more cross-account constraints, apply your own security group.
 *
 * @cloudformationResource AWS::RefactorSpaces::Service
 * @mixin true
 * @stability external
 * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-refactorspaces-service.html
 */
class CfnServicePropsMixin extends cdk.Mixin {
    static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/cfn-property-mixins.aws_refactorspaces.CfnServicePropsMixin", version: "2.258.1" };
    static CFN_PROPERTY_KEYS = ["applicationIdentifier", "description", "endpointType", "environmentIdentifier", "lambdaEndpoint", "name", "tags", "urlEndpoint", "vpcId"];
    props;
    strategy;
    /**
     * Create a mixin to apply properties to `AWS::RefactorSpaces::Service`.
     *
     * @param props L1 properties to apply
     * @param options Mixin options
     */
    constructor(props, options = {}) {
        super();
        try {
            jsiiDeprecationWarnings._aws_cdk_cfn_property_mixins_aws_refactorspaces_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 flattenCfnServicePropsMixinLambdaEndpointInputProperty(props) {
    if (cdk.isResolvableObject(props))
        return props;
    return {
        arn: (!props.arn ? undefined : cdk.getRefProperty(props.arn?.functionRef, 'functionArn') ?? cdk.ensureStringOrUndefined(props.arn, "arn", "lambda.IFunctionRef | string"))
    };
}
// @ts-ignore TS6133
function flattenCfnServiceMixinProps(props) {
    const ret = {};
    if ((props.applicationIdentifier !== undefined))
        ret.applicationIdentifier = cdk.getRefProperty(props.applicationIdentifier?.applicationRef, 'applicationIdentifier') ?? cdk.ensureStringOrUndefined(props.applicationIdentifier, "applicationIdentifier", "refactorspaces.IApplicationRef | string");
    if ((props.environmentIdentifier !== undefined))
        ret.environmentIdentifier = cdk.getRefProperty(props.environmentIdentifier?.environmentRef, 'environmentIdentifier') ?? cdk.ensureStringOrUndefined(props.environmentIdentifier, "environmentIdentifier", "refactorspaces.IEnvironmentRef | string");
    if ((props.lambdaEndpoint !== undefined))
        ret.lambdaEndpoint = flattenCfnServicePropsMixinLambdaEndpointInputProperty(props.lambdaEndpoint);
    if ((props.vpcId !== undefined))
        ret.vpcId = cdk.getRefProperty(props.vpcId?.vpcRef, 'vpcId') ?? cdk.ensureStringOrUndefined(props.vpcId, "vpcId", "ec2.IVPCRef | string");
    return ret;
}
