amazon-web-services - 如何从 AWS CLI 创建 Amplify React 应用程序
问题描述
我想在 CI 管道中创建 AWS Amplify React 应用程序时遇到问题。如何从 AWS CLI 创建 Amplify 应用程序?文件应该来自 S3。在这种情况下,Git 不是一个选项。
aws --profile master amplify create-app --name appName
此命令创建放大应用程序,但我如何让它使用 S3 文件,压缩与否。
解决方案
执行以下 aws-cli 命令;也可以有不同的命令组合。
第 1 步:创建名称为 appName 的应用程序。aws amplify create-app --name appName --region eu-west-1
第二步:创建分支。aws amplify create-branch --region eu-west-1 --app-id "{appId from Step 1 here}" --branch-name "master"
. 还有其他方法可以创建分支。
第三步:部署。aws amplify start-deployment --region eu-west-1 --app-id "{appId from Step 1 here}" --branch-name "master" --source-url "s3://{s3-bucket-name}/app_src_package.zip"
第 4 步:要验证部署状态,aws amplify get-job --region eu-west-1 --app-id "{appId from Step 1 here}" --branch-name "master" --job-id "{jobId from Step 3 here}"
注意:确保您的 IAM 用户/角色需要放大和 s3 策略。
推荐阅读
- math - 按频率标准化分数
- android - Firebase facebook 身份验证对我来说无法正常工作
- qt - cc1plus.exe:分配 536875007 个字节的内存不足
- difference - Ab Initio 和 Data Stage 的比较
- java - 循环播放 2 个视频
- java - Cassandra drop keyspace 在为 executeAsync 指定的超时之前抛出 timeoutexception
- javascript - Angular2+ 中的 DOM 访问行为不一致
- python - 试图了解 CBV,但是用多个模型组织单个页面的好方法是什么?
- angular - NativeScript 与 Angular 但可能没有路由器?
- c# - 使用 [==] 运算符 & .Equals() 的 Int、Char、Object 数据类型