我已经使用 UI 在 AWS 中创建了一个 API 网关,我想自动化这个过程并编写一个 shell 脚本来创建 API 网关,就像我在 AWS 中配置它一样。
As already suggested, I also recommend using better tools such as cloudformation to manage the infrastructure.
If you really want to use bash script, you can use AWS Cli commands in your bash script.
aws apigateway create-rest-api --name my-api
API=bs8fqo6bp0 aws apigateway get-resources --rest-api-id $API
aws apigateway create-resource --rest-api-id $API --path-part test \\ --parent-id e8kitthgdb
here is an example from AWS docs, https://docs.aws.amazon.com/lambda/latest/dg/with-on-demand-https-example.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.