AWS Cloud Operations & Migrations Blog

Create speech-enabled products using AWS Service Catalog and Amazon Polly

In this post, we’ll show how enterprises can use AWS Service Catalog to create AWS Service Catalog products based on AWS machine learning (ML) services, such as Amazon Polly and Amazon Rekognition.

These products are packaged in AWS Service Catalog portfolios that customers can use for their use cases. These portfolios can generate revenue for service provider when deployed in a service provider managed environment. In this post, we’ll focus on a use case for Amazon Polly.Preview Changes (opens in a new tab)

Amazon Polly is a service that turns text into lifelike speech, which in turn lets you create applications that can talk and build speech-enabled products. Amazon Polly uses advanced deep learning technology to synthesize speech that sounds like the human voice. Many organizations need to provide spoken responses with their web and mobile applications, like accessibility applications for visually impaired people, news readers, story readers, e-learning platforms, and internet connected devices. Amazon Polly produces high-quality audio files with superior natural speech, high pronunciation accuracy, and low latency, all in a cost-effective manner.

Prerequisites­

Concepts and terminology

The following AWS Service Catalog concepts are used in this post

  • A product is a blueprint for building the AWS resources necessary to make it available for deployment on AWS, along with the configuration information. Create a product by importing an AWS CloudFormation template, or, in case of AWS Marketplace-based products, by copying the product to the AWS Service Catalog. A product can belong to multiple portfolios.
  • A portfolio is a collection of products, together with the configuration information. Use portfolios to manage user access to specific products. You can grant portfolio access for an AWS Identity and Access Management (IAM) user, IAM group, or IAM role level.
  • A provisioned product is an AWS CloudFormation stack. In other words, the AWS resources that are created. When an end-user launches a product, AWS Service Catalog provisions the product from an AWS CloudFormation stack.
  • Constraints control the way that users can deploy a product. Launch constraints let you specify a role that the AWS Service Catalog can assume to launch a product.

For more information, see Overview of AWS Service Catalog in the AWS Service Catalog administrator guide.

Solution overview

The following diagram maps out the solution architecture.

The managed service provider creates an Amazon Polly product in AWS Service Catalog and makes it available to other accounts through CloudFormation. The member accounts deploy the CloudFormation template, which creates an AWS Service Catalog product in their account. You launch the product from the member account.

Figure 1: Solution architecture

The walkthrough includes the following steps:

  1. The managed service provider creates an Amazon Polly AWS Service Catalog product through CloudFormation.
  2. The AWS Service Catalog administrator in the member account adds the portfolio and product by launching the CloudFormation template.
  3. End users in the member account use the AWS Service Catalog product.

Configure the environment

For your convenience, this post provides an AWS CloudFormation template to automate the creation of required AWS resources. We recommend using the northern Virginia Region (US-East-1) for this walkthrough.

Download the CloudFormation Template and create an S3 bucket

  1. Sign in to the new AWS account as an administrator with permissions to create AWS resources.
  2. Download this CloudFormation Template locally and extract its contents. It will create a folder named content.
  3. Create an S3 bucket and note its name.
  4. Upload the content folder to the bucket.
  5. Open the content/scpolly folder.
  6. Select the scpolly_setup.json file.
  7. Within the Object overview section, copy the object URL.

Deploy the CloudFormation template

  1. Sign in to your AWS account as an administrator with permissions to create AWS resources.
  2. In the AWS CloudFormation console, choose Create stack, and then choose With new resources (standard).
  3. In the Specify template section, choose Amazon S3 URL.
  4. In the Amazon S3 URL field, paste the object URL that you copied in the previous procedure, and then choose Next.

    In the Parameters section of Specify stack details

    Figure 2: Specify stack details

  5. On Specify stack details, for Stack name, enter scpollysetup.
  6. For SourceBucket, enter the name of your S3 bucket that you created earlier, and then choose Next.
  7. On the Configure stack options page, choose Next.

On the Review page, select I acknowledge that AWS CloudFormation might create IAM resources, and then choose Create stack. Your stack is ready when the status changes to CREATE_COMPLETE.

In the outputs tab on the CloudFormation console, choose the InputTextFolder, then upload your text files

Figure 3: Upload Text File

Launch the AWS Service Catalog product

  1. On the Outputs tab of the CloudFormation console, right-click on the SwitchRoleSCEndUserRole URL, and then choose Open Link in the new Tab.
  2. Choose Switch Role.
  3. Open the AWS Service Catalog console.
  4. Choose the SCpolly product (for provision product name, click generate name).
  5. Choose Launch product.
  6. Select an InputFolder, such as the example provided leadership-principles.
  7. For Your Email, enter the email address into which the results should go.
  8. Choose Launch product.
  9. When the status of the product changes to Available, choose Events.
  10. Choose Outputlink to view the results and listen to the Amazon Polly-created MP3 files. By default, it’s accessible for only three hours.
    1. Choose InputFolder to add additional folders of text, then go to the Update folder section.
  11. Scroll down and choose the report URL. The report displays the title of the text document and a graph. The report isn’t public.
The report is displayed after choosing the report URL. In the first column of the report, the title of the text document is displayed. In the second column of the report is the corresponding link to listen to the text converted to speech using Amazon Polly.

Figure 4: Amazon Polly Report

Adding additional folders

Prerequisites

This section requires the following prerequisites:

  • Create a folder on your local system
  • Create text files in the folder and save with a .txt extension

Follow these steps to complete this section:

  1. Open the AWS Service Catalog console.
  2. Choose the SCpolly product.
  3. Choose Provisioned products.
  4. Choose a previously provisioned product.
  5. Right-click on the inputFolder URL and open in a new tab.
  6. Choose the Upload button.
  7. Choose Add folder and upload the folder(s).

Updating the service catalog product

  1. On the Outputs tab of the CloudFormation console, right-click the SwitchRoleSCEndUserRole URL, and then choose Open Link in new Tab.
  2. Choose Switch Role.
  3. Open the AWS Service Catalog console.
  4. Choose the SCpolly product
  5. Choose Launch product.
  6. Choose update for the inputFolder parameter.
  7. For YourEmail, enter the email address to which results should go.
  8. Choose Launch product (this step will add the new folders to the dropdown InputFolder to be available next time).

Cleanup

To avoid ongoing charges to your account, delete the resources that you created. In the AWS Service Catalog console, choose Provisioned products and from the Actions menu, choose Terminate.

Conclusion

AWS Service Catalog enables organizations to create and manage catalogs of approved IT services for use on AWS. In this post, we showed how managed service providers can use AWS Service Catalog and CloudFormation to create AWS Service Catalog portfolios that customers can use for their use cases.

AWS Control Tower is a managed AWS service that automates the creation of a multi-account AWS environment based upon the AWS Well-Architected Framework (AWS WAF) to capture AWS best practices for security and management services. In AWS Control Tower, AWS Organizations helps centrally share resources across your member AWS accounts. AWS Service Catalog portfolios can be managed centrally and distributed across your enterprise using Organizations in a multi-account environment.

About the authors:

Kenneth Walsh

Kenneth Walsh is a New York-based Solutions Architect whose focus is AWS Marketplace. Kenneth is passionate about cloud computing and loves being a trusted advisor for his customers. When he’s not working with customers on their journey to the cloud, he enjoys cooking, audio books, movies, and spending time with his family and dog.

Rayette Toles-Abdullah

Rayette Toles-Abdullah is a Senior Solutions Architect with the World-Wide Public Sector Federal Civilian Team. Rayette specializes in enterprise management, cloud operations, governance, and application modernization. In her free time, she loves to be of service to those who serve.