我正在尝试使用cloudformation模板和Amazon Contact流语言创建Amazon Connect Contact流,这对我来说是新的。但我是面对这个问题,栈创建失败。我不确定我是否在我的yml文件中有语法错误。完整的错误信息
Resource handler returned message: "Invalid request (Service: Connect, Status Code: 400, Request ID: aa1e1049-47bb-43ea-8065-0f8b1cf503d2)" (RequestToken: ff62940b-0e60-2308-d33d-917eeb399402, HandlerErrorCode: InvalidRequest)
这是云的形成模板
---
AWSTemplateFormatVersion: "2010-09-09"
Description: "Amazon Connect - Contact Flow"
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: "General Information"
Parameters:
- SystemName
- EnvironmentName
- Label:
default: "Amazon Connect Information"
Parameters:
- InstanceID
- ContactFlowName
Parameters:
SystemName:
Type: String
EnvironmentName:
Type: String
AllowedValues: [prd, stg, dev]
InstanceID:
Type: String
Description: "Enter the Amazon Connect Instance ID (e.g. 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx')"
ContactFlowName:
Type: String
Description: "Enter the Name of the Contact flow"
Resources:
ContactFlow:
Type: 'AWS::Connect::ContactFlow'
Properties:
Name: !Sub "${ContactFlowName}"
Description: Example contact flow
InstanceArn: !Sub "arn:aws:connect:${AWS::Region}:${AWS::AccountId}:instance/${InstanceID}"
Type: CONTACT_FLOW
Content: |
{
"Version": "2019-10-30",
"StartAction": "c8275c19-08aa-4ee5-9b42-bcc47d32e914",
"Metadata": {
"entryPointPosition": {
"x": 20,
"y": 20
},
"snapToGrid": false,
"ActionMetadata": {
"5c47b68e-d790-45eb-a0bd-654027af4868": {
"position": {
"x": 463,
"y": 491
},
"useDynamic": false
},
"c8275c19-08aa-4ee5-9b42-bcc47d32e914": {
"position": {
"x": 180,
"y": 20
},
"conditionMetadata": [
{
"id": "6a7b09ef-d441-4183-8ef3-2f0f360ba747",
"value": "1"
},
{
"id": "f3516737-c758-4d6f-8d31-ea43d1e27990",
"value": "2"
},
{
"id": "21ad3977-2559-4449-ba54-b84d4a0521b6",
"value": "3"
}
],
"useDynamic": false,
"useLexBotDropdown": true,
"useDynamicLexBotArn": false
},
"c36d9f86-780d-4c44-8c79-80c8353a699a": {
"position": {
"x": 1068,
"y": 317
}
},
"14837518-cc08-4d54-ac93-ea7e063481a8": {
"position": {
"x": 492,
"y": 340
},
"overrideConsoleVoice": false,
"defaultVoice": "Standard"
},
"1e435e5f-7b62-4938-8c9f-fa05106c72b3": {
"position": {
"x": 501,
"y": 174
},
"overrideConsoleVoice": false,
"defaultVoice": "Standard"
},
"98768cdb-f5e6-4642-90e3-6e06fd6813e8": {
"position": {
"x": 478,
"y": 21
},
"overrideConsoleVoice": false,
"defaultVoice": "Conversational",
"fragments": {
"SetContactData": "bc981918-e0b3-4840-afa5-12b6d7078248"
}
},
"bc981918-e0b3-4840-afa5-12b6d7078248": {
"position": {
"x": 0,
"y": 0
}
},
"3a521089-edfe-4821-8156-19014b7b8926": {
"position": {
"x": 716,
"y": 45
},
"useDynamic": false,
"ContactFlow": {
"id": "arn:aws:connect:eu-central-1:132387760551:instance/a65f970f-0f59-444e-b421-5ec6ec74c116/contact-flow/d727e34f-6707-437f-8013-20e4f2a867d6",
"text": "Transaction Banking Authentication"
}
}
}
},
"Actions": [
{
"Identifier": "5c47b68e-d790-45eb-a0bd-654027af4868",
"Parameters": {
"Text": "An Error Occured!"
},
"Transitions": {
"NextAction": "c36d9f86-780d-4c44-8c79-80c8353a699a",
"Errors": [
{
"NextAction": "c36d9f86-780d-4c44-8c79-80c8353a699a",
"ErrorType": "NoMatchingError"
}
],
"Conditions": []
},
"Type": "MessageParticipant"
},
{
"Identifier": "c8275c19-08aa-4ee5-9b42-bcc47d32e914",
"Parameters": {
"Text": "To continue in English press 1, Ukuqhubeka ngesiZulu cindezela u- 2, Vir Afrikaans Druk 3.",
"StoreInput": "False",
"InputTimeLimitSeconds": "5"
},
"Transitions": {
"NextAction": "5c47b68e-d790-45eb-a0bd-654027af4868",
"Errors": [
{
"NextAction": "5c47b68e-d790-45eb-a0bd-654027af4868",
"ErrorType": "NoMatchingError"
},
{
"NextAction": "5c47b68e-d790-45eb-a0bd-654027af4868",
"ErrorType": "NoMatchingCondition"
},
{
"NextAction": "5c47b68e-d790-45eb-a0bd-654027af4868",
"ErrorType": "InputTimeLimitExceeded"
}
],
"Conditions": [
{
"NextAction": "98768cdb-f5e6-4642-90e3-6e06fd6813e8",
"Condition": {
"Operator": "Equals",
"Operands": [
"1"
]
}
},
{
"NextAction": "1e435e5f-7b62-4938-8c9f-fa05106c72b3",
"Condition": {
"Operator": "Equals",
"Operands": [
"2"
]
}
},
{
"NextAction": "14837518-cc08-4d54-ac93-ea7e063481a8",
"Condition": {
"Operator": "Equals",
"Operands": [
"3"
]
}
}
]
},
"Type": "GetParticipantInput"
},
{
"Identifier": "c36d9f86-780d-4c44-8c79-80c8353a699a",
"Type": "DisconnectParticipant",
"Parameters": {},
"Transitions": {}
},
{
"Identifier": "14837518-cc08-4d54-ac93-ea7e063481a8",
"Parameters": {
"TextToSpeechVoice": "Lotte"
},
"Transitions": {
"NextAction": "3a521089-edfe-4821-8156-19014b7b8926",
"Errors": [],
"Conditions": []
},
"Type": "UpdateContactTextToSpeechVoice"
},
{
"Identifier": "1e435e5f-7b62-4938-8c9f-fa05106c72b3",
"Parameters": {
"TextToSpeechVoice": "Marlene"
},
"Transitions": {
"NextAction": "3a521089-edfe-4821-8156-19014b7b8926",
"Errors": [],
"Conditions": []
},
"Type": "UpdateContactTextToSpeechVoice"
},
{
"Identifier": "98768cdb-f5e6-4642-90e3-6e06fd6813e8",
"Parameters": {
"TextToSpeechVoice": "Joanna"
},
"Transitions": {
"NextAction": "bc981918-e0b3-4840-afa5-12b6d7078248",
"Errors": [],
"Conditions": []
},
"Type": "UpdateContactTextToSpeechVoice"
},
{
"Identifier": "bc981918-e0b3-4840-afa5-12b6d7078248",
"Parameters": {
"LanguageCode": "en-US"
},
"Transitions": {
"NextAction": "3a521089-edfe-4821-8156-19014b7b8926",
"Errors": [
{
"NextAction": "3a521089-edfe-4821-8156-19014b7b8926",
"ErrorType": "NoMatchingError"
}
],
"Conditions": []
},
"Type": "UpdateContactData"
},
{
"Identifier": "3a521089-edfe-4821-8156-19014b7b8926",
"Parameters": {
"ContactFlowId": "arn:aws:connect:eu-central-1:132387760551:instance/a65f970f-0f59-444e-b421-5ec6ec74c116/contact-flow/d727e34f-6707-437f-8013-20e4f2a867d6"
},
"Transitions": {
"NextAction": "c36d9f86-780d-4c44-8c79-80c8353a699a",
"Errors": [
{
"NextAction": "c36d9f86-780d-4c44-8c79-80c8353a699a",
"ErrorType": "NoMatchingError"
}
],
"Conditions": []
},
"Type": "TransferToFlow"
}
]
Tags:
- Key: System
Value: !Ref SystemName
- Key: Environment
Value: !Ref EnvironmentName
任何帮助都会很感激
好的,看起来Content
对象无效。对于初学者来说,它以]
字符结束,而不是}
,但即使修复它也有问题。
我建议在gui中创建一个流并导出它,然后使用json作为模板。
另外,检查Flow语言文档以获得正确的语法和结构。