Skip to content

Text-to-Speech application built using the CDK, Docker, and AWS Solutions Constructs.

Notifications You must be signed in to change notification settings

blake-enyart/text_to_speech_pipeline

Repository files navigation

Welcome to the Text-to-Speech Pipeline project!

You should explore the contents of this project. It demonstrates a CDK app with an instance of a stack (text_to_speech_pipeline_stack) which contains an Amazon S3 bucket that triggers an AWS Lambda to send .txt style content to AWS Polly for conversion to .mp3 that is landed in another S3 bucket.

What is the CDK?

I find that a picture is worth a thousand words, but I look at the CDK as an abstraction on top of CloudFormation/Terraform that allows developers to rapidly build out solutions.

If you would like to learn more about it here is a great link covering this topic.

CDK Conceptual Image

Reference Architecture

Reference Architecture

Instructions for Usage

Project Overview

The cdk.json file tells the CDK Toolkit how to execute your app.

This project is set up like a standard Python project. The initialization process also creates a virtualenv within this project, stored under the .venv directory. To create the virtualenv it assumes that there is a python3 executable in your path with access to the venv package. If for any reason the automatic creation of the virtualenv fails, you can create the virtualenv manually once the init process completes.

To setup this project, manually create a virtualenv on MacOS and Linux:

$ python3 -m venv .venv

After the virtualenv is created, you can use the following step to activate your virtualenv.

$ source .venv/bin/activate

If you are a Windows platform, you would activate the virtualenv like this:

% .venv\Scripts\activate.bat

Once the virtualenv is activated, you can install the required dependencies.

$ pip install -r requirements.txt
$ poetry install

Configure pre-commit hooks prior to development:

$ inv install-hooks

Note: this workflow will now looks something like:

  • git add <file>
  • git commit
  • git add . -- if there are code corrections
  • git cz -- to make a descriptive commit to the repo

At this point you can now synthesize the CloudFormation template for this code.

$ inv synth

You can now begin exploring the source code, contained in the text_to_speech directory. There is also a very trivial test included that can be run like this:

$ pytest

To add additional dependencies, for example other CDK libraries, just run the poetry add <library> command.

Useful commands

  • inv ls list all stacks in the app
  • inv synth emits the synthesized CloudFormation template
  • inv deploy deploy this stack to your default AWS account/region
  • inv diff compare deployed stack with current state
  • cdk docs open CDK documentation

Enjoy!

About

Text-to-Speech application built using the CDK, Docker, and AWS Solutions Constructs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published