Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixes for SSM Parameter commit
  • Loading branch information
dave-moser committed Feb 20, 2025
commit 08d8649db67c741ef276cd83f1827e38cb69accc
90 changes: 47 additions & 43 deletions pca-server/src/pca/pcaconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,58 @@
SPDX-License-Identifier: Apache-2.0
"""
import boto3
import os
from botocore.config import Config

# Get the stack name from environment variable
STACK_NAME = os.environ.get('STACK_NAME')

# Parameter Store Field Names used by main workflow
CONF_COMP_LANGS = "ComprehendLanguages"
CONF_REDACTION_LANGS = "ContentRedactionLanguages"
CONF_CONVO_LOCATION = "ConversationLocation"
CONF_ENTITYENDPOINT = "EntityRecognizerEndpoint"
CONF_ENTITY_FILE = "EntityStringMap"
CONF_ENTITYCONF = "EntityThreshold"
CONF_ENTITY_TYPES = "EntityTypes"
CONF_PREFIX_AUDIO_PLAYBACK = "InputBucketAudioPlayback"
CONF_S3BUCKET_INPUT = "InputBucketName"
CONF_PREFIX_RAW_AUDIO = "InputBucketRawAudio"
CONF_PREFIX_FAILED_AUDIO = "InputBucketFailedTranscriptions"
CONF_PREFIX_INPUT_TRANSCRIPTS = "InputBucketOrigTranscripts"
CONF_MAX_SPEAKERS = "MaxSpeakers"
CONF_MINNEGATIVE = "MinSentimentNegative"
CONF_MINPOSITIVE = "MinSentimentPositive"
CONF_S3BUCKET_OUTPUT = "OutputBucketName"
CONF_PREFIX_TRANSCRIBE_RESULTS = "OutputBucketTranscribeResults"
CONF_PREFIX_PARSED_RESULTS = "OutputBucketParsedResults"
CONF_SPEAKER_NAMES = "SpeakerNames"
CONF_SPEAKER_MODE = "SpeakerSeparationType"
COMP_SFN_NAME = "StepFunctionName"
CONF_SUPPORT_BUCKET = "SupportFilesBucketName"
CONF_TRANSCRIBE_LANG = "TranscribeLanguages"
CONF_TELEPHONY_CTR = "TelephonyCTRType"
CONF_TELEPHONY_CTR_SUFFIX = "TelephonyCTRFileSuffix"
CONF_VOCABNAME = "VocabularyName"
CONF_CLMNAME = "CustomLangModelName"
CONF_FILENAME_DATETIME_REGEX = "FilenameDatetimeRegex"
CONF_FILENAME_DATETIME_FIELDMAP = "FilenameDatetimeFieldMap"
CONF_FILENAME_GUID_REGEX = "FilenameGUIDRegex"
CONF_FILENAME_AGENT_REGEX = "FilenameAgentRegex"
CONF_FILENAME_CUST_REGEX = "FilenameCustRegex"
CONF_FILTER_MODE = "VocabFilterMode"
CONF_FILTER_NAME = "VocabFilterName"
CONF_KENDRA_INDEX_ID = "KendraIndexId"
CONF_WEB_URI = "WebUiUri"
CONF_TRANSCRIBE_API = "TranscribeApiMode"
CONF_REDACTION_TRANSCRIPT = "CallRedactionTranscript"
CONF_REDACTION_AUDIO = "CallRedactionAudio"
CONF_CALL_SUMMARIZATION = "CallSummarization"
CONF_COMP_LANGS = f"{STACK_NAME}-ComprehendLanguages"
CONF_REDACTION_LANGS = f"{STACK_NAME}-ContentRedactionLanguages"
CONF_CONVO_LOCATION = f"{STACK_NAME}-ConversationLocation"
CONF_ENTITYENDPOINT = f"{STACK_NAME}-EntityRecognizerEndpoint"
CONF_ENTITY_FILE = f"{STACK_NAME}-EntityStringMap"
CONF_ENTITYCONF = f"{STACK_NAME}-EntityThreshold"
CONF_ENTITY_TYPES = f"{STACK_NAME}-EntityTypes"
CONF_PREFIX_AUDIO_PLAYBACK = f"{STACK_NAME}-InputBucketAudioPlayback"
CONF_S3BUCKET_INPUT = f"{STACK_NAME}-InputBucketName"
CONF_PREFIX_RAW_AUDIO = f"{STACK_NAME}-InputBucketRawAudio"
CONF_PREFIX_FAILED_AUDIO = f"{STACK_NAME}-InputBucketFailedTranscriptions"
CONF_PREFIX_INPUT_TRANSCRIPTS = f"{STACK_NAME}-InputBucketOrigTranscripts"
CONF_MAX_SPEAKERS = f"{STACK_NAME}-MaxSpeakers"
CONF_MINNEGATIVE = f"{STACK_NAME}-MinSentimentNegative"
CONF_MINPOSITIVE = f"{STACK_NAME}-MinSentimentPositive"
CONF_S3BUCKET_OUTPUT = f"{STACK_NAME}-OutputBucketName"
CONF_PREFIX_TRANSCRIBE_RESULTS = f"{STACK_NAME}-OutputBucketTranscribeResults"
CONF_PREFIX_PARSED_RESULTS = f"{STACK_NAME}-OutputBucketParsedResults"
CONF_SPEAKER_NAMES = f"{STACK_NAME}-SpeakerNames"
CONF_SPEAKER_MODE = f"{STACK_NAME}-SpeakerSeparationType"
COMP_SFN_NAME = f"{STACK_NAME}-StepFunctionName"
CONF_SUPPORT_BUCKET = f"{STACK_NAME}-SupportFilesBucketName"
CONF_TRANSCRIBE_LANG = f"{STACK_NAME}-TranscribeLanguages"
CONF_TELEPHONY_CTR = f"{STACK_NAME}-TelephonyCTRType"
CONF_TELEPHONY_CTR_SUFFIX = f"{STACK_NAME}-TelephonyCTRFileSuffix"
CONF_VOCABNAME = f"{STACK_NAME}-VocabularyName"
CONF_CLMNAME = f"{STACK_NAME}-CustomLangModelName"
CONF_FILENAME_DATETIME_REGEX = f"{STACK_NAME}-FilenameDatetimeRegex"
CONF_FILENAME_DATETIME_FIELDMAP = f"{STACK_NAME}-FilenameDatetimeFieldMap"
CONF_FILENAME_GUID_REGEX = f"{STACK_NAME}-FilenameGUIDRegex"
CONF_FILENAME_AGENT_REGEX = f"{STACK_NAME}-FilenameAgentRegex"
CONF_FILENAME_CUST_REGEX = f"{STACK_NAME}-FilenameCustRegex"
CONF_FILTER_MODE = f"{STACK_NAME}-VocabFilterMode"
CONF_FILTER_NAME = f"{STACK_NAME}-VocabFilterName"
CONF_KENDRA_INDEX_ID = f"{STACK_NAME}-KendraIndexId"
CONF_WEB_URI = f"{STACK_NAME}-WebUiUri"
CONF_TRANSCRIBE_API = f"{STACK_NAME}-TranscribeApiMode"
CONF_REDACTION_TRANSCRIPT = f"{STACK_NAME}-CallRedactionTranscript"
CONF_REDACTION_AUDIO = f"{STACK_NAME}-CallRedactionAudio"
CONF_CALL_SUMMARIZATION = f"{STACK_NAME}-CallSummarization"

# Parameter store fieldnames used by bulk import
BULK_S3_BUCKET = "BulkUploadBucket"
BULK_JOB_LIMIT = "BulkUploadMaxTranscribeJobs"
BULK_MAX_DRIP_RATE = "BulkUploadMaxDripRate"
BULK_S3_BUCKET = f"{STACK_NAME}-BulkUploadBucket"
BULK_JOB_LIMIT = f"{STACK_NAME}-BulkUploadMaxTranscribeJobs"
BULK_MAX_DRIP_RATE = f"{STACK_NAME}-BulkUploadMaxDripRate"

# Transcribe API Modes
API_STANDARD = "standard"
Expand Down
30 changes: 17 additions & 13 deletions pca-ui/cfn/pca-ui.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@ AWSTemplateFormatVersion: "2010-09-09"
Description: Amazon Transcribe Post Call Analytics - PCA UI

Parameters:
ParentStackName:
Type: String
Description: Name of the parent stack

AdminUsername:
Type: String
Default: "admin"
Description: (Required) Username for admin user

AdminEmail:
Type: String
Description: >-
(Required) Email address for the admin user. Will be used for logging in and for setting the admin password.
This email will receive the temporary password for the admin user.
AllowedPattern: ".+\\@.+\\..+"
ConstraintDescription: Must be valid email address eg. [email protected]
Type: String
Description: >-
(Required) Email address for the admin user. Will be used for logging in and for setting the admin password.
This email will receive the temporary password for the admin user.
AllowedPattern: ".+\\@.+\\..+"
ConstraintDescription: Must be valid email address eg. [email protected]

AllowedSignUpEmailDomain:
Type: String
Expand All @@ -26,7 +30,7 @@ Parameters:
If left empty, signup via the web UI is disabled and users will have to be created
using
Cognito.
AllowedPattern: '^(\*||([\w-]+\.)+[\w-]{2,6}(, *([\w-]+\.)+[\w-]{2,6})*)$'
AllowedPattern: '^(\*||([\w-]+\.)+[\w-]{2,6}(, *([\w-]+\.)+[\w-]{2,6})*)$'

AudioBucket:
Type: String
Expand Down Expand Up @@ -64,7 +68,7 @@ Parameters:
- 'LAMBDA'
- 'ANTHROPIC'
Description: This is what model to use for GenAIQuery.

GenAIQueryBedrockModelId:
Type: String
Default: anthropic.claude-3-haiku-20240307-v1:0
Expand Down Expand Up @@ -97,7 +101,7 @@ Parameters:
Default: ''
Type: String
Description: External Boto3 Layer Arn to use. If none is provided, one will be created automatically via boto3.template

PyUtilsLayerArn:
Default: ''
Type: String
Expand Down Expand Up @@ -143,7 +147,7 @@ Resources:
AllowedSignUpEmailDomain: !Ref AllowedSignUpEmailDomain
WebUri: !GetAtt Web.Outputs.Uri
Environment: !Ref Environment
Name:
Name:
!If
- isMainStackNameEmpty
- !Ref AWS::StackName
Expand Down Expand Up @@ -193,15 +197,15 @@ Resources:
DeployCountName: !Ref DeployCount
DeployCountValue: !Ref DeployCount
# DistributionId: !GetAtt Web.Outputs.DistributionId
EnableGenAIQuery: !If
EnableGenAIQuery: !If
- ShouldEnableGenAIQuery
- 'true'
- 'false'

WebUriParameter:
Type: "AWS::SSM::Parameter"
Properties:
Name: WebUiUri
Name: !Sub ${ParentStackName}-WebUiUri
Type: String
Value: !GetAtt Web.Outputs.Uri
Description: PCA Web Application URI
Expand Down