File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ import { RemovalPolicy } from 'aws-cdk-lib';
1010
1111interface BackendStackProps extends cdk . StackProps {
1212 environment : string ;
13- domainName ?: string ; // Optional domain name for certificate
14- hostedZoneId ?: string ; // Optional hosted zone ID for domain
1513 cognitoClientId : string ;
1614 cognitoUserPoolId : string ;
15+ domainName ?: string ; // Optional domain name for certificate
16+ hostedZoneId ?: string ; // Optional hosted zone ID for domain
1717}
1818
1919export class BackendStack extends cdk . Stack {
Original file line number Diff line number Diff line change @@ -13,16 +13,22 @@ export function main() {
1313 const app = new cdk . App ( ) ;
1414
1515 console . log ( 'NODE_ENV' , process . env . NODE_ENV ) ;
16- console . log ( 'AWS_COGNITO_CLIENT_ID' , process . env . AWS_COGNITO_CLIENT_ID ) ;
16+
17+ const cognitoClientId = process . env . AWS_COGNITO_CLIENT_ID ;
18+ const cognitoUserPoolId = process . env . AWS_COGNITO_USER_POOL_ID ;
19+
20+ if ( ! cognitoClientId || ! cognitoUserPoolId ) {
21+ throw new Error ( 'AWS_COGNITO_CLIENT_ID and AWS_COGNITO_USER_POOL_ID must be set' ) ;
22+ }
1723
1824 new BackendStack ( app , `ai-team-medical-reports-stack-${ process . env . NODE_ENV } ` , {
1925 environment : process . env . NODE_ENV || 'development' ,
2026 env : {
2127 account : process . env . CDK_DEFAULT_ACCOUNT ,
2228 region : process . env . CDK_DEFAULT_REGION || 'us-east-1' ,
2329 } ,
24- cognitoClientId : process . env . AWS_COGNITO_CLIENT_ID ,
25- cognitoUserPoolId : process . env . AWS_COGNITO_USER_POOL_ID ,
30+ cognitoClientId : cognitoClientId ,
31+ cognitoUserPoolId : cognitoUserPoolId ,
2632 } ) ;
2733
2834 return app ;
You can’t perform that action at this time.
0 commit comments