Composite Key (DynamoDB)
A primary key made of two parts: partition key + sort key. Lets you group related items under one partition key and query specific items with the sort key. Example: FlowName (partition) + PromptName (sort) lets you pull all prompts for one flow or one specific prompt. Section 1: DynamoDB Foundation
Partition Key
The first part of a DynamoDB key that determines which physical partition stores the item. All items with the same partition key are stored together. In the Likewize pattern: FlowName is the partition key so all prompts for a flow live together. Section 1: DynamoDB Foundation
Sort Key
The second part of a composite key that orders items within a partition. Enables range queries like ‘get all items where sort key begins with X’. In the Likewize pattern: PromptName is the sort key so you can query individual prompts or all prompts for a flow. Section 1: DynamoDB Foundation
DynamoDB Query vs Scan
Query targets a specific partition key and optionally filters by sort key - fast and efficient. Scan reads every item in the entire table - slow and expensive. Always design your keys so you can Query instead of Scan. Section 1: DynamoDB Foundation
DynamoDB Item
A single record in a DynamoDB table, similar to a row in a relational database. Each item is a collection of attributes. In the prompts table, one item = one prompt with its text, category, active status, etc. Section 1: DynamoDB Foundation
DynamoDB Attribute
A single data element within an item - like a column value in a relational database. Can be strings, numbers, booleans, lists, or maps. Example attributes: PromptText_en, IsActive, Order. Section 1: DynamoDB Foundation
Provisioned vs On-Demand Capacity
Two billing modes for DynamoDB. Provisioned: you set read/write capacity units upfront and pay for that capacity. On-Demand: pay per request with no capacity planning. On-Demand is simpler for dev/lab work, Provisioned is cheaper at predictable scale. Section 1: DynamoDB Foundation
DynamoDB GetItem
API call that retrieves a single item by its full primary key (partition key + sort key if composite). Returns the exact item or nothing. Use when you know exactly which item you need. Section 1: DynamoDB Foundation
DynamoDB PutItem
API call that creates a new item or completely replaces an existing item with the same primary key. Overwrites the entire item - not a partial update. Use for inserting or full replacement. Section 1: DynamoDB Foundation
DynamoDB UpdateItem
API call that modifies specific attributes on an existing item without replacing the whole thing. Can add, remove, or change individual attributes. Use for partial updates like toggling IsActive. Section 1: DynamoDB Foundation
Prompts Table Design (Likewize Pattern)
DynamoDB table with FlowName (partition key) + PromptName (sort key). Attributes: PromptText_en, PromptText_es, Category, Description, IsActive, IsClientVisible, Order. Flows call Lambda which queries this table and returns prompt text as contact attributes. Section 1: DynamoDB Foundation
Config Table Design (Likewize Pattern)
DynamoDB table holding LOB-specific configuration. Each LOB has ~12 general config settings like queue mappings, business hours, and feature flags. Lambda reads this config to determine routing behavior per line of business. Section 1: DynamoDB Foundation
LOB (Line of Business)
A distinct business unit or product line that has its own configuration in the contact center. Each LOB can have different queues, prompts, hours, and routing rules. Likewize has multiple LOBs configured in DynamoDB. Section 1: DynamoDB Foundation
Lambda Handler Function
The entry point of your Lambda code that AWS invokes when the function is triggered. In Python: def lambda_handler(event, context). It receives the event data, processes it, and returns a response. This is the function you point Lambda to execute. Section 2: Lambda Development
Lambda Event Object
The JSON payload passed to your handler containing the trigger data. When Amazon Connect invokes Lambda, the event includes contact attributes, contact ID, and flow details. You parse this to know what the caller needs. Section 2: Lambda Development
Lambda Context Object
The second parameter in your handler providing runtime info about the invocation: function name, memory limit, remaining execution time, request ID. Use context.get_remaining_time_in_millis() to check if you’re about to timeout. Section 2: Lambda Development
Lambda Response Format (Connect)
Lambda must return a flat dictionary of key-value string pairs for Connect to consume. Example: {‘PromptText_en’: ‘Welcome to Likewize’, ‘IsActive’: ‘true’}. Connect reads these as contact attributes. Nested objects or non-string values will fail. Section 2: Lambda Development
Lambda Timeout
Maximum execution time before AWS kills the function. Default is 3 seconds, max is 15 minutes. For Connect-invoked Lambdas, keep it under 8 seconds or the flow times out. Set this in the function configuration. Section 2: Lambda Development
Lambda Environment Variables
Key-value pairs configured on the function that your code reads at runtime. Use for table names, environment identifiers, feature flags. Accessed via os.environ[‘TABLE_NAME’] in Python. Keeps config out of code. Section 2: Lambda Development
Lambda IAM Execution Role
The IAM role your Lambda function assumes when it runs. Defines what AWS services the function can access. If your Lambda queries DynamoDB, the execution role needs dynamodb:Query and dynamodb:GetItem permissions on that specific table. Section 2: Lambda Development
Least Privilege (IAM)
Security principle: grant only the minimum permissions needed to perform a task. Don’t give Lambda full DynamoDB access - give it Query permission on the specific table ARN it needs. Reduces blast radius if the function is compromised. Section 2: Lambda Development
boto3
AWS SDK for Python. The library you import in Lambda to interact with AWS services. Use boto3.resource(‘dynamodb’) for high-level DynamoDB operations or boto3.client(‘dynamodb’) for low-level API calls. Already available in the Lambda Python runtime. Section 2: Lambda Development
boto3 Resource vs Client
Two interfaces in boto3. Resource is high-level and Pythonic - table.query() returns clean dictionaries. Client is low-level and matches the AWS API exactly - returns raw typed responses. Resource is easier for DynamoDB work. Section 2: Lambda Development
Graceful Degradation (Lambda)
Designing your Lambda so it handles failures without crashing the entire flow. If DynamoDB query fails, return default prompt text instead of throwing an error. The caller still gets a response - just not the customized one. Section 2: Lambda Development