Created
December 17, 2020 19:02
-
-
Save skippednote/12100ddfacf19ddb65c37584c8e4a47d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class SoftskillsStack extends cdk.Stack { | |
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); | |
const layer = lambda.LayerVersion.fromLayerVersionArn( | |
this, | |
'ffmpeg', | |
'arn:aws:lambda:us-east-1:448159408791:layer:ffmpeg:1' | |
); | |
const transcribeQueue = new sqs.Queue(this, 'Queue', { | |
visibilityTimeout: Duration.minutes(30), | |
}); | |
const tranlations = new s3.Bucket(this, 'Tranlations', { | |
bucketName: 'softskillstranslations', | |
publicReadAccess: true, | |
removalPolicy: cdk.RemovalPolicy.DESTROY, | |
}); | |
const table = new dynamodb.Table(this, 'Table', { | |
partitionKey: { name: 'text', type: dynamodb.AttributeType.STRING }, | |
sortKey: { name: 'ep', type: dynamodb.AttributeType.NUMBER }, | |
}); | |
const trimMedia = new lambda.Function(this, 'TrimMedia', { | |
code: lambda.Code.fromAsset('fns/trimMedia'), | |
runtime: lambda.Runtime.NODEJS_10_X, | |
handler: 'index.handler', | |
layers: [layer], | |
environment: { | |
CLIPS_BUCKET_NAME: clips.bucketName, | |
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1', | |
}, | |
memorySize: 1024, | |
timeout: Duration.seconds(15), | |
}); | |
// full content of the file linked at the very end. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment