Last active
May 3, 2023 18:13
-
-
Save em-shea/5dcda9622a676e01e5aecfda3087a954 to your computer and use it in GitHub Desktop.
SAM definition for audio generation workflow
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
GenerateAudioStateMachine: | |
Type: AWS::Serverless::StateMachine | |
Properties: | |
Name: !Sub GenerateAudioStateMachine-${Stage} | |
DefinitionUri: src/generate_audio_state_machine.asl.json | |
DefinitionSubstitutions: | |
TableName: !Ref DynamoDBTable | |
GetWordsForListIdFunction: !Ref GetWordsForListId | |
PronunciationAudioBucket: !Ref PronunciationAudioBucket | |
Policies: | |
# SAM policy templates to simplify common IAM permissions | |
- S3WritePolicy: | |
BucketName: !Ref PronunciationAudioBucket | |
- DynamoDBCrudPolicy: | |
TableName: !Ref DynamoDBTable | |
- LambdaInvokePolicy: | |
FunctionName: !Ref GetWordsForListId | |
# Custom policy for Polly | |
- Statement: | |
- Sid: PollySynthesizeText | |
Effect: Allow | |
Action: | |
- polly:StartSpeechSynthesisTask | |
Resource: '*' | |
# SAM definitions for Lambda function, DynamoDB table, and S3 bucket not included | |
# See full template at: https://github.com/em-shea/vocab/blob/master/template.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment