Closed5
AWS Amplify x React チュートリアルのつまずき
こちらの記事をやっていく
日本語だと「Set up CI/CD of the front end and backend 」の部分がないので英語で読んだ方が良い。
(当然、この章を行わないとエラーになる)
Backend のビルドでエラーが発生
File project: data should NOT have additional properties: 'graphqltransformer'
詳細なログ
# Starting phase: build
2021-09-20T07:59:17.114Z [INFO]: File project: data should NOT have additional properties: 'graphqltransformer'
2021-09-20T07:59:17.114Z [INFO]: JSONValidationError: File project: data should NOT have additional properties: 'graphqltransformer'
at validator (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/feature-flags/featureFlags.js:136:27)
at featureFlagsValidator (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/feature-flags/featureFlags.js:140:17)
at FeatureFlags.validateFlags (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/feature-flags/featureFlags.js:146:17)
at FeatureFlags.loadValues (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/feature-flags/featureFlags.js:204:18)
at async Function.FeatureFlags.initialize (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-cli-core/lib/feature-flags/featureFlags.js:267:5)
at async Object.run (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/lib/index.js:73:9)
2021-09-20T07:59:17.119Z [ERROR]: !!! Build failed
2021-09-20T07:59:17.119Z [ERROR]: !!! Non-Zero Exit Code detected
2021-09-20T07:59:17.119Z [INFO]: # Starting environment caching...
2021-09-20T07:59:17.120Z [INFO]: # Uploading environment cache artifact...
2021-09-20T07:59:17.230Z [INFO]: # Environment caching completed
Terminating logging...
ローカルの Amplify CLI のバージョンが合致していないことが原因。
下記の手順で設定を行う
- サイドバーから App settings → Build settings
- Build image settings → Edit
- App package version override
- Amplify CLI を選択
- Version は latest
- Save
redeploy を行うと Backend のビルドで別のエラーが発生
Your app does not have a role and you're attempting to interact with AWS resources
In order for you to interact with AWS resources you need to attach a role to your app. This can be done in the General Settings page in the console
role が設定されていないようなので、設定する
- サイドバーから App settings → General
- App details → Edit
- Service role に設定
- role を作成していない場合は、 I AM より設定を行う
- AdministratorAccess-Amplify の Policy などで良いと思う
- Save
このスクラップは2022/02/14にクローズされました