lambda_fundamentals_scenarios Flashcards

(17 cards)

1
Q

You need to greet customers by name but the name is stored in an external CRM. What’s your approach?

A

Use Invoke AWS Lambda function block to pass phone number to Lambda. Lambda queries CRM and returns firstName and lastName. Use dynamic prompt with returned attributes to greet customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Customer wants to make a payment but your payment system is external. How do you implement self-service?

A

Use Lex bot to capture payment details. Pass details to Lambda via Invoke block. Lambda calls payment system API and returns transaction result as contact attribute. Play prompt reads result back to customer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You need to route French-speaking premium customers to French-speaking agents. How do you get this info?

A

Lambda queries customer database using phone number. Returns membershipStatus and preferredLanguage as STRING_MAP. Use Check contact attribute block to branch and route to appropriate queue.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Your Lambda function sometimes takes 6 seconds and sometimes takes 10 seconds. What do you do?

A

If 10 seconds is regular occurrence design for async. If occasional spike implement retry logic and increase timeout to 8 seconds max. Test under load to determine pattern.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Experience designer says they need nested customer data with address and account details. What response format?

A

Use JSON response format. STRING_MAP only supports flat key-value pairs. JSON accommodates complex nested objects like address containing street

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

You need to use the same Lambda function across dev

A

When you need to use the same Lambda function across dev, staging, and production environments, you have several strategies: use environment variables to control behavior, deploy separate function versions/aliases, or maintain identical code with different configurations. The goal is to test in staging exactly what will run in production while keeping environments isolated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Your team keeps deploying Lambda changes that immediately affect production traffic. What’s the fix?

A

Use Lambda aliases. Point flow to alias ARN instead of function ARN. Update alias to route traffic between versions. Test new version with weighted routing before switching 100% traffic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Flow times out after 3 seconds but Lambda successfully completes in 6 seconds. What’s wrong?

A

Flow timeout doesn’t match Lambda timeout. Flow block configured for 3 seconds but Lambda needs 6 seconds. Increase flow block timeout to match Lambda processing time up to 8 second max.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Developer hard-coded instance ID in Lambda function. Now function can’t be reused. What should they have done?

A

Store instance ID as environment variable. Access at function initialization with process.env.INSTANCE_ID. Makes function reusable across multiple instances without code changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You deployed new Lambda version but want to test with 20% of traffic first. How?

A

Create Lambda alias with weighted configuration. Route 80% to old version and 20% to new version. Monitor metrics then gradually increase percentage to new version.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Experience designer configured flow to expect STRING_MAP but Lambda returns nested JSON. What happens?

A

Flow takes error branch. Response doesn’t match expected format. Either change flow to expect JSON or change Lambda to return flat key-value pairs as STRING_MAP.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Lambda function is in us-west-2 but Connect instance is in us-east-1. What permissions are needed?

A

Use AssociateLambdaFunction API to link Lambda to instance. Attach resource-based IAM policy to Lambda with connect.amazonaws.com as principal and Connect instance ARN.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you test Lambda function works correctly with Amazon Connect before deploying to production?

A

Use Lambda console test event feature. Create test event with sample Amazon Connect event structure including Details

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Customer says they need to update queue IDs in Lambda function every time they create new environment. What’s wrong with their setup?

A

They hard-coded queue IDs in function code. Should use environment variables. Update variables per environment without touching code. Makes deployments faster and less error-prone.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Flow needs to call external API that returns data in 200ms. Sync or async approach?

A

Synchronous. Response time is well under 8 second timeout. Flow waits for Lambda

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Lambda returns customer account balance. Do you use STRING_MAP or JSON?

A

Either works if balance is single value. STRING_MAP: {balance: “1234.56”}. JSON if you want to include currency and formatted value: {balance: {amount: 1234.56

17
Q

Developer forgot to set Function ARN to use alias. What’s the risk?

A

Every Lambda deployment immediately affects live production traffic. No ability to test new version gradually. Can’t rollback quickly if new version has bugs. Always use alias for production flows.