import 'source-map-support/register' ; import * as cdk from '@aws-cdk/core' ; import { LaravelOnAwsWorkshopStack } from '../lib/cdk-stack' ; const env = { region : process . env . CDK_DEFAULT_REGION || "" , account : process . env . CDK_DEFAULT_ACCOUNT || "" , } ; const deploymentEnv = { type : process . env . THIS_DEPLOYMENT_ENV || "" , namespace : process . env . THIS_DEPLOYMENT_NAMESPACE || "" , } ; function capitalizeFirstLetter ( string ) { return string . charAt ( 0 ) . toUpperCase ( ) + string . slice ( 1 ) ; } function generateName ( name ) { return capitalizeFirstLetter ( deploymentEnv . type ) + capitalizeFirstLetter ( deploymentEnv . namespace ) + name ; } if ( ( deploymentEnv . type !== "" ) && ( deploymentEnv . namespace !== "" ) ) { const app = new cdk . App ( ) ; new LaravelOnAwsWorkshopStack ( app , generateName ( 'LaravelOnAwsWorkshopStack' ) , { env } ) ; app . synth ( ) ; } else { if ( deploymentEnv . type === "" ) console . log ( "[] Please `export THIS_DEPLOYMENT_ENV=` within your shell.\n" ) ; if ( deploymentEnv . namespace === "" ) console . log ( "[] Please `export THIS_DEPLOYMENT_NAMESPACE=` within your shell.\n" ) ; process . exit ( 1 ) ; }