Why are AuthRole and UnauthRole required for hosting?
** Which Category is your question related to? **
init and hosting
** What AWS Services are you utilizing? **
s3 and cloudfront
** Provide additional details e.g. code snippets **
I'd like to use AWS Amplify only for hosting (at least for now) and would like to avoid unnecessary extra resources getting created. I noticed that the generated cloudformation templates and the config files generated by init refer to AuthRole and UnauthRole, which refer to Cognito, which I'm not using. I attempted to remove them manually from the cloudformation file, but when running amplify publish, they get re-created. Is there a good way to remove them entirely, or a particular reason why they're needed? Thanks!
Hi @ncknuna , You are right, the hosting category does not using the two roles. The CLI adds those two roles during init, and keep them there, because they are used by other categories that manage aws resources to be consumed by the Amplify library, such as storage, api and analytics. Currently, the CLI does not provide tools to remove them.
@UnleashedMind Thanks for the quick reply! In that case, can this ticket turn into a feature request to only create those roles when adding a category that requires them?
@ncknuna Almost all categories need this auth and unauth role for managin permissions except "Hosting" I beleive, so as an opinionated approach we decided to provision the auth and unauth role (which users are not charged for), during initialization so that all the common categories could share it whenever required or whenever added. We took this decision based on the 80/20 rule, considering the fact that majority of our users would be using at least one of the categories other than hosting that would require auth/unauth roles for authentication.
If you have an app which just requires hosting, then I beleive these roles are redundant but if you add any other category in the future, these roles would be utlized to provide auth/unauth access to your app. That being said, we're looking it ways as to how we can optimize for use-cases like yours and have a plan for it in our roadmap.
@kaustavghosh06 I understand, and I very well may have done the same thing if I was in your shoes :)
In my case, I'm using Auth0 as a third party auth provider (largely because of a lot of the limitations specified here). Until generic OIDC providers are supported, I likely won't be adding any other categories via Amplify, and instead following tutorials like this one to integrate with appsync or other services.
Glad to hear that there is a plan in the roadmap somewhere (even if it's not soon), and thanks for being so responsive!
Hi guys im using only API module of Amplify, but the process create this roles, UnauthRole and authRole, i explored this roles and they dont have any policy attached... this is normal? If i add other service as Auth with cognito this files change?
Thanks!!
I also have a question for creating both AuthRole & UnauthRole. I want to use amplify with import auth which means I already have created those 2 roles manually using terraform. So this doesn't make any sense on my project right?
Hey @ncknuna :wave: is this feature request something you're still looking for?
We moved off of Amplify a while back, so no, we don't need this anymore. I still think it's a useful feature, but not one that I need personally