UserPool props option to disable creation of SMS role #6730
Labels
@aws-cdk/aws-cognito
Related to Amazon Cognito
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
good first issue
Related to contributions. See CONTRIBUTING.md
Currently,
UserPool
creates an IAM role for SMS communication (using SNS) if a role is not supplied via thesmsRole
property in the props. I propose adding a way to prevent the creation of that role without supplying a role.Use Case
The UserPool I maintain does not store a phone number and so does not provide SMS messaging. Our security posture is very conservative, so that autogenerated roles and policies are not allowed. This requires the security team to create and document an empty role, for my UserPool to reference. Needless to say this is a frowned upon practice. Adding this feature would remove this workaround.
Proposed Solution
I propose that the
smsRole
be of typestring | IRole
.smsRole === "DEFAULT"
, then theUserPool
is generated as it is today whensmsRole
is undefined and a role is created.smsRole
is of typeIRole
, then theUserPool
is generated as it is today when a role is provided throughsmsRole
, where no role is created and the provided role is referenced in the templatesSmsConfiguration
.smsRole === NONE
, then theUserPool
is generated without the following properties in the template:SmsConfiguration
,SmsVerificationMessage
,VerificationMessageTemplate.SmsMessage
Additionally, an enum could be created for these smsRole values.
Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: