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

resource check on redeployments #190

Open THOM-AwS opened 3 years ago

THOM-AwS commented 3 years ago

My feature request is related to stack redeployment problems. I have been having issues with my stack updates, things are attempted to be recreated where they already exist, (my buckets, this caused me a lot of lost time trying to work out why my stack is trying to recreate or overwrite a resource that does not allow that),

I have noticed a lot of issues with amplify in general, but specifically with the vod sample I have followed I have hit a lot of potholes. this main one for resource recreation errors does not seem to be caught or checked to see if the resource already exists. also, I have for some reason issues with the buckets missing their bucket events to trigger the lambda to transcode the video into the output bucket. they just went missing and it would not start a transcode job. I had to copy them in from my dev branch and recreate them by hand to get the system to run the transcode service. Can you add in some resource checks to see if the required resource attributes are still available, and recreate conditionally if they are missing. There is limited documentation on customising the vod project unicornflix. having to go spend weeks learning how the interfaces between each part of the project has become pretty cumbersome considering how easy this was made out to be. it feels like sometimes any amount of deviation from the path of the sample code leads to errors that are hard to trace out.

The only other option here seems to be to just recreate them by hand, but you have to know exactly how it was before to get it to work. that is a real problem.

the unicorn flix project is mostly well done, but any deviation from the tutorial and you can get lost right away. The documentation is factually good, but offers very little in terms of how it works in terms of what does what, how with what, and how to customise it for your own purpose. There is virtually no walk through for production deployments, and what the feature differences are for prod vs anything else when it asks you if it is a prod environment. What does this mean for me?

I had to dig through a lot of documentation to make headway to bring this anywhere near being prod ready, and some pointers or walkthroughs on how to use the project with R53 and cloudfront would be helpful. there is virtually no info I could find, on how to deal with the cors issues I am up against now, for which I have tickets in with support to try to get it working. Some more detailed docs on how to bring this into prod would be really really useful.

I understand that some of this wont affect the amplify-video team, but I am trying to be a bit holistic with my experience in the hope that will be helpful for the next guy.

smp commented 3 years ago

Hi @HaterMonestary we really appreciate you taking the time to provide your feedback. Can you help us identify any reproductions of the issues you call out specifically? It looks like there are two main issues we need to track down along with a handful of documentation improvements that could help future users:

THOM-AwS commented 3 years ago

@smp thanks for the really prompt response.

I came across this bucket redeployment failure a few times and I think this could have been solved at some recent update, as I dont have this at the moment, I did also come across at least a few other people with this specific issue. https://github.com/awslabs/amplify-video/issues/141. this seems to also have the same problem with the missing bucket triggers. I am not sure what exactly caused it to lose its triggers, or exactly when it happened. I am sure a conditional create on the resource with the condition being that it already exists would be sufficient. could the two be related, im not sure. Ill create another ticket for the event triggers as you asked.

I found the unicorn flix sample code some months back and it seems to be what I was looking for. I was not aware of the wiki, and after a cursory glance, I wish I had have seen it much earlier. It would have been nice to see a link to this resource perhaps in the unicornflix walkthrough. https://github.com/awslabs/unicornflix/blob/master/documentation/Backend.md. specifics, sure. again, you requested another ticket, Ill make one and add something there.

point four, customisation, we had a lot of problems trying to work out how to use the react router/single page app with amplify and it was not immediately apparent or in the sample code, at least that I noticed, that there needed to be specific allowances made for it. again, that may not be a video problem, but an implementation of our project problem for sure. The documentation was pretty light on how to setup specifics of cognito and SES. the unicornflix example shows one method of doing everything for a specific use case, it does not really offer any other ways to skin the cat, so to speak.

Branches is not exactly clear to me on how we should manage them. We are supposed to amplify env checkout prod then git checkout master vs amplify env checkout dev then git checkout dev? is that the correct workflow here? do you have any pointers on branch management and merging between dev and prod where there is cloudfront on prod only etc?

at the bottom of this page, https://github.com/awslabs/unicornflix/blob/master/documentation/UserView.md, there is some more options like the wiki, and perhaps this would be a good spot to have more information on how to setup R53 hosted zones, custom domains and a walkthrough on how to setup the custom domain in amplify. Please, How does this project need to be configured to work with CORS in both the S3 bucket and in Cloudfront, and what options or customisations are allowed/encouraged? ie, step one, log into the root account and generate cf keys.

Ill make some time to create some tickets as requested above shortly. Thanks for your help. I personally normally work with aws infrastructure, however ive not been at it too long. I have nothing to do with front end magic. I really would like some more specifics on point four here: https://github.com/awslabs/amplify-video/issues/121, if you have time. 🤣

gvasquez95 commented 1 year ago

I just had the issue with the input/output buckets already existing, so stack update failed for that reason