问题
According to http://docs.aws.amazon.com/lex/latest/dg/API_Operations_Amazon_Lex_Model_Building_Service.html you can create or update bots and intents/slots (Put{Bot|Intend|Slot}, Create{Bot|Intend|Slot}Version).
So by using Put* I can configure a bot and with Create*Version I can publish one, but in order to publish it, first you need to build it and I can't find an API method for that.
回答1:
When using PutBot you can supply the --process-behavior flag with value BUILD to force a build.
From the documentation:
If you set the
processBehaviorelement toBuild, Amazon Lex builds the bot so that it can be run. If you set the element toSaveAmazon Lex saves the bot, but doesn't build it. If you don't specify this value, the default value isSave.
回答2:
You can add below line in your json file if you are using CLI:
"processBehavior": "BUILD",
It will build the bot.
来源:https://stackoverflow.com/questions/44441662/how-do-i-build-an-amazon-lex-bot-using-the-rest-api