-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay adding the lambda to cognito user pool until after provisioners have run #9358
Comments
I have run into a second use case that requires the lambdas to be configured after the pool is initially created:
I can't achieve the above because it creates a dependency cycle (see also: hashicorp/terraform#27188). This cycle issue would be solved using the option 2 design proposed by @nikvaessen. |
Option 2 would also fix our use case. We have the following three resources:
|
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
I'm struggling with finding a good way to add users to a (newly created) cognito user pool.
The only way right now (as far as I'm aware) is to add a provision block which executes a script using one of the cognito SDK's.
However, if you have added a
pre_sign_up
lambda which restricts users from signing up, the provisioning script method could fail. If the lambda's would be added after provisioning, this would not be the case.One solution would be to have the option to explicitly add users to a user pool, as requested in #4542.
Another solution would be to have an
aws_cognito_user_pool_lambda
resource, similar toaws_cognito_user_group
. As this would (implicitly) depend on theaws_cognito_user_pool
the provisioning step would execute before the lambda is added.A third solution would be to have an optional argument to the
aws_cognito_user_pool
which delays adding the lambda until after provisioning has run. Not sure if this is possible the way terraform works internally.New or Affected Resource(s)
Potential Terraform Configuration
option 1
option 2
option 3
References
The text was updated successfully, but these errors were encountered: