in lib/cdk-stack.ts [63:103]
constructor(scope: cdk.Construct, id: string, props: CdkStackProps) {
super(scope, id, props);
const podcastBucket = new s3.Bucket(this, 'PodcastData', {
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
});
const transcribeAccessRole = makeTranscribeAccessBucketRole(
this,
'PodcastDataTranscribeAccessRole',
podcastBucket
);
const podcastEpisodeTable = new ddb.Table(this, 'PodcastEpisode', {
partitionKey: { type: ddb.AttributeType.STRING, name: 'id' },
});
const transcribeStateMachine = new TranscribeStateMachine(
this,
'TranscribePodcast',
{
...makeTranscribeStatemachineLambdas(this, 'TranscribeHandler', {
workshopLanguage: props.workshopLanguage,
podcastBucket: podcastBucket,
podcastEpisodeTable: podcastEpisodeTable,
transcribeAccessRole: transcribeAccessRole,
}),
}
).stateMachine;
const frontend = new ApiGatewayFrontend(this, 'PodcastApi', {
...makeApiEndpointLambdas(this, 'PodcastHandler', {
workshopLanguage: props.workshopLanguage,
podcastBucket: podcastBucket,
podcastEpisodeTable: podcastEpisodeTable,
transcribeStateMachine: transcribeStateMachine,
}),
});
new cdk.CfnOutput(this, 'APIUrl', {
value: frontend.httpApi.apiEndpoint,
});
}