"use strict";
/*
 *  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *  SPDX-License-Identifier: Apache-2.0
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = void 0;
const workbench_core_accounts_1 = require("@aws/workbench-core-accounts");
const workbench_core_base_1 = require("@aws/workbench-core-base");
/* eslint-disable-next-line */
async function handler(event) {
    const stackName = process.env.STACK_NAME;
    const mainAccountAwsService = new workbench_core_base_1.AwsService({
        region: process.env.AWS_REGION,
        userAgent: process.env.USER_AGENT_STRING,
        ddbTableName: stackName
    });
    const accountService = new workbench_core_accounts_1.AccountService(mainAccountAwsService.helpers.ddb);
    const hostingAccountLifecycleService = new workbench_core_accounts_1.HostingAccountLifecycleService(stackName, mainAccountAwsService, accountService);
    const accountHandler = new workbench_core_accounts_1.AccountHandler(mainAccountAwsService, accountService, hostingAccountLifecycleService);
    await accountHandler.execute(event);
}
exports.handler = handler;
//# sourceMappingURL=accountHandlerLambda.js.map