Post completing all the tasks within Cloud (AWS) - Level 4 - Task 6 - Deploying Containerized Applications with AWS ECS, the CodePipeline fails throwing the error - The provided role does not have sufficient permissions to access S3
in the deployment stage and as shown in below screenshot:
What I’ve tried?
I’ve tried providing S3FullAccess permission policy to the role of both CodeBuild and CodePipeline and even after that I’m still getting the S3 permissions related issues. I’ve also changed the S3 bucket from the default one which AWS CodePipeline creates to the one which is hosting the source code of the Python flask App, but no luck.
Please help me as I’m not getting what I’m missing.
Please take a look at this solution – I’ve tried it, and it works. This should guide you to how you solve the task.
hello bro once this task is completely solved please share its solution with me , it would be really helpful it am stuck in this task my pipeline is not working . please share it solution with me 
@MIQDAD
We already have a solution for it. Please check Rob’s message.
thank you so much @raymond.baoly
Another thing which is not good about the error (The provided role does not have sufficient permissions to access S3) which I’m facing is that it is not mentioning the role which doesn’t have required permissions on which S3 bucket. If this error had this information, then it would be easy to debug and solve these type of issues.
@MIQDAD : Please provide me more insights on the S3 permissions issue, as you’re also getting the same issue. It would be helpful to me. Asking for the solution as even after going through the solution provided by @rob_kodekloud, I’ve not got why I’m getting “The provided role does not have sufficient permissions to access S3” error within the deployment stage. The solution provided by @rob_kodekloud seems to be for the different task (where the docker container is built and deployed from local machine), but the task which I’ve mentioned asks to deploy docker container which was pushed to ECR and take that image and create deployment in ECS.
Thanks for replying to my post! The solution which you’ve shared is not the same as building the docker container image using AWS CodePipeline and deploying it to AWS ECS. I’ve already completed the task for which solution which you’ve shared. I’ve also checked the access policies applied on the S3 buckets used, but the lab user doesn’t have permissions to modify it. If you can provide any clue or something, I can check further on that direction.