@@ -15,6 +15,11 @@ export class JProfByBotStack extends cdk.Stack {
1515 billingMode : dynamodb . BillingMode . PAY_PER_REQUEST ,
1616 removalPolicy : RemovalPolicy . DESTROY ,
1717 } ) ;
18+ const youtubeChannelsWhitelistTable = new dynamodb . Table ( this , 'jprof-by-bot-table-youtube-channels-whitelist' , {
19+ tableName : 'jprof-by-bot-table-youtube-channels-whitelist' ,
20+ partitionKey : { name : 'id' , type : dynamodb . AttributeType . STRING } ,
21+ billingMode : dynamodb . BillingMode . PAY_PER_REQUEST ,
22+ } ) ;
1823
1924 const lambdaWebhook = new lambda . Function ( this , 'jprof-by-bot-lambda-webhook' , {
2025 functionName : 'jprof-by-bot-lambda-webhook' ,
@@ -26,11 +31,14 @@ export class JProfByBotStack extends cdk.Stack {
2631 environment : {
2732 'LOG_THRESHOLD' : 'DEBUG' ,
2833 'TABLE_VOTES' : votesTable . tableName ,
29- 'TELEGRAM_BOT_TOKEN' : props . telegramToken ,
34+ 'TABLE_YOUTUBE_CHANNELS_WHITELIST' : youtubeChannelsWhitelistTable . tableName ,
35+ 'TOKEN_TELEGRAM_BOT' : props . telegramToken ,
36+ 'TOKEN_YOUTUBE_API' : props . youtubeToken ,
3037 } ,
3138 } ) ;
3239
3340 votesTable . grantReadWriteData ( lambdaWebhook ) ;
41+ youtubeChannelsWhitelistTable . grantReadData ( lambdaWebhook ) ;
3442
3543 const api = new apigateway . RestApi ( this , 'jprof-by-bot-api' , {
3644 restApiName : 'jprof-by-bot-api' ,
0 commit comments