George McKinney Adventures in Software Development

March 10, 2021

AWS BASH Export Lex Bots

Filed under: AWS — georgemck @ 6:14 pm

AWS CLI 2 for Exporting a Bot

https://docs.aws.amazon.com/lex/latest/dg/export-to-lex.html

https://docs.aws.amazon.com/lex/latest/dg/API_GetExport.html

Export all bots to lexbots directory as indivudual zip files. Be sure to update the region, currently set to us-east-1

 

mkdir lexbots
aws lex-models get-bots | grep name | cut -d '"' -f4 | \
while read -r name; do
echo $name
url=$(aws lex-models get-export --name $name --resource-type BOT --export-type LEX --resource-version 1 --region us-east-1 --output json | grep url | cut -d '"' -f4)
wget $url -O ./lexbots/$name.zip
done

 

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

Powered by WordPress