aws-amplify / aws-amplify/amplify-hosting

Amplify build failing with Resource XXXXX must be in ARN format or "*"

Open
#1,664 7 comments 0 reactions 0 assignees View on GitHub
backend-builds
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Amplify console build is failing with the following error after adding a storage category and creating a trigger for it.

```
2021-03-17T15:26:54.616Z [WARNING]: Error updating cloudformation stack
2021-03-17T15:26:59.620Z [INFO]: Following resources failed
Resource Name: ampli-batc-1OX21FKOVDKP8 (AWS::IAM::Policy)
Event Type: update
Reason: Resource storagebatchJobStateArn must be in ARN format or "*". (Service: AmazonIdentityManagement; Status Code: 400; Error Code: MalformedPolicyDocument; Request ID: fa959ce9-327b-4dd7-bec2-a276456e0133; Proxy: null)
URL: XXXXX
Resource Name: userManager (AWS::Lambda::Function)
Event Type: update
Reason: Resource update cancelled
URL: XXXXX
```

Steps to reproduce the behavior:
1. Add storage
2. Configure trigger
3. push
4. build fails

**Expected behavior**
A clear and concise description of what you expected to happen.
The build should work.

**Desktop (please complete the following information):**
- OS: MacOS
- Browser: Chrome
- Version: Version 89.0.4389.82 (Official Build) (x86_64)

**Additional context**
This issue happened locally first, and I fixed it by adding the storage resource to the 'dependsOn' array in the Trigger definition in the amplify/backend/amplify-meta.json file (as described here: https://github.com/aws-amplify/amplify-cli/issues/5333). I've tried removing the amplify-meta.json file from gitignore and pushing again, but the same results.

Contributor guide

Open the contributing guide

Research direction

Start with the storage trigger configuration and amplify/backend/amplify-meta.json, especially the Trigger definition and its dependsOn array. Reproduce an Amplify build after adding storage and a trigger, then inspect the generated IAM policy and CloudFormation update. Done means the build succeeds without the resource ARN format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
ci-cd, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.