TTS Converter App is a simple AWS application used to transform text into speech. The first challenge involves writing its corresponding Terraform code.
-
Clone the project
-
Zip the lambda code (the .py file must be at the root of your .zip file)
-
Create an S3 bucket to upload the zip file and update the S3_bucket and S3_key in lambda.tf
-
Run
terraform init
-
Run
terraform apply
-
Try the app using a curl query using the invokeURL of the API Gateway stage, which you can obtain from the output of the Terraform code or directly from the AWS Management Console (you can use the example in this article )
-
Once you've finished testing, remember to run
terraform destroy
to delete all resources if you no longer need them.
You need to provide the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY credentials to allow Terraform to connect and authenticate successfully to AWS. These credentials can be embedded directly into the Terraform code (although this is not considered best practice), or you can leverage terminal environment variables or use a shared credentials file in the local file system.