/
bot.tf
119 lines (104 loc) · 3.21 KB
/
bot.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
resource "aws_lex_bot" "order_food_bot" {
depends_on = [
aws_lex_intent.get_food_order_intent
]
child_directed = false
create_version = false
detect_sentiment = false
enable_model_improvements = true
idle_session_ttl_in_seconds = 300
locale = "en-US"
name = "OrderIntake"
nlu_intent_confidence_threshold = 0
process_behavior = "BUILD"
voice_id = "Salli"
abort_statement {
message {
content = "Sorry, I could not understand. Goodbye."
content_type = "PlainText"
}
}
clarification_prompt {
max_attempts = 5
message {
content = "Sorry, can you please repeat that?"
content_type = "PlainText"
}
}
intent {
intent_name = "CheckOrderStatus"
intent_version = "$LATEST"
}
intent {
intent_name = "GetFoodOrder"
intent_version = "$LATEST"
}
intent {
intent_name = "CustomerServiceRepIntent"
intent_version = "$LATEST"
}
}
resource "aws_lex_bot_alias" "order_intake_connect" {
depends_on = [
aws_lex_bot.order_food_bot
]
bot_name = "OrderIntake"
bot_version = aws_lex_bot.order_food_bot.version
description = "Version of the OrderIntake bot to be used by a Connect instance. This protects against changes to $LATEST."
name = "OrderIntakeConnect"
}
output "bot_arn" {
value = aws_lex_bot.order_food_bot.arn
}
resource "aws_lex_bot" "yes_no_bot" {
depends_on = [
aws_lex_intent.confirm_intent, aws_lex_intent.reject_intent
]
child_directed = false
create_version = false
detect_sentiment = false
enable_model_improvements = true
idle_session_ttl_in_seconds = 300
locale = "en-US"
name = "YesNoBot"
nlu_intent_confidence_threshold = 0.8
process_behavior = "BUILD"
voice_id = "Salli"
abort_statement {
message {
content = "Okay."
content_type = "PlainText"
}
}
clarification_prompt {
max_attempts = 5
message {
content = "Are you calling about a previous order? You could say yes for an order status or no to place a new order."
content_type = "PlainText"
}
}
intent {
intent_name = "ConfirmIntent"
intent_version = "$LATEST"
}
intent {
intent_name = "RejectIntent"
intent_version = "$LATEST"
}
intent {
intent_name = "CancelOrderIntent"
intent_version = "$LATEST"
}
}
resource "aws_lex_bot_alias" "yes_no_connect" {
depends_on = [
aws_lex_bot.yes_no_bot
]
bot_name = "YesNoBot"
bot_version = aws_lex_bot.yes_no_bot.version
description = "Version of the YesNoBot to be used by a Connect instance. This protects against changes to $LATEST."
name = "YesNoConnect"
}
output "yes_no_bot_arn" {
value = aws_lex_bot.yes_no_bot.arn
}