awslabs / amplify-video

An open source Category Plugin for the AWS Amplify-CLI that makes it easy to deploy live and file based streaming video services and integrate them into your Amplify applications.
https://www.npmjs.com/package/amplify-category-video
Apache License 2.0
267 stars 56 forks source link

Adding amplify video with a Signed URL option fails because of permissions (even with an IAM user with Admin access) #341

Open prajendra-is opened 2 years ago

prajendra-is commented 2 years ago

Describe the bug Adding amplify video with amplify video add fails because of a permissions error

Preconditions: `. I have an IAM account with Admin Access:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "*",
            "Resource": "*"
        }
    ]
}
  1. I have an existing Amplify App;
  2. I have the Amplify CLI installed;
  3. Installed amplify-video with yarn global add amplify-category-video in a Create React App.

To Reproduce Steps to reproduce the behavior:

  1. Run amplify video add
  2. Choose Video-on-Demand
  3. Choose Default HLS+DASH Adaptive Bitrate
  4. n for notifications
  5. y for production environment
  6. y for signed URLs
  7. n for GraphQL
  8. It will say All resources built. Then I enter amplify push.
  9. An error is returned:
    
    Following resources failed

Resource Name: rCloudFrontPublicKeystagingatqghjwg (AWS::CloudFront::PublicKey) Event Type: create Reason: Resource handler returned message: "Access denied for operation 'AWS::CloudFront::PublicKey'."



**Expected behavior**
Expect the command to succeed without an error.

**Desktop (please complete the following information):**
 - OS: [macOS 11.6.4]
 - Version [amplify CLI 7.6.25]

**Additional context**
If I try without requesting signed URLs, it will succeed*.

*Up until I wrote this post, this would also fail with an error message. What I ended up doing is taking the policy linked here https://github.com/awslabs/amplify-video/issues/175 for `Video on Demand`, and adding it as an inline-policy to the user pool referenced in the error message, in `IAM --> Roles `. After I did that and ran`amplify push` again, and I was able to create the VOD. I'm still not sure why it started wroking, but the only thing I can think of is I upgraded to the latest version of the Amplify CLI with `amplify upgrade`.