- Newest
- Most votes
- Most comments
Hello.
Since Cognito is a regional resource, I think that applications in the same region can use the same user pool even if the applications are in separate VPCs.
Also, Cognito is not a service that runs within a VPC, so it can be used regardless of whether the VPC is separate or not.
https://docs.aws.amazon.com/cognito/latest/developerguide/application-client-based-multi-tenancy.html
Also should I create another IAC for this VPC? or can I use the same IAC I have?
If it's a completely different application, I think it's okay to split the stack.
https://docs.aws.amazon.com/cdk/v2/guide/stack_how_to_create_multiple_stacks.html
Hi,
Sharing a Cognito user pool between VPCs is definitely possible, as the user pool is not tied to a specific VPC configuration and can be utilized across multiple VPCs or AWS accounts.
You can use the same CDK app to provision resources for multiple VPCs.
But, in case you want to create a separate CDK app for the second VPC since you are deploying it for a totally different service, then you can import the previously created Cognito User pool into your CDK code. [1]
References:
[1] https://repost.aws/questions/QU6sXRXAzXQze9wWNJz1TUAw/reference-resources-between-cdk-stacks
Thanks,
Atul
Thanks man! Really appreciate the help
Relevant content
- Accepted Answerasked a month ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 6 months ago
I see, about this, Also should I create another IAC for this VPC? or can I use the same IAC I have? Is going to be a part of the main application but a diferent service. Should still be separated?
It is possible to define new AWS resources without splitting the stack. If the VPC configuration or AWS services used to host the application are different, I think it would be better to separate the CDK stack to improve the readability of the code.
Personally, I split my CDK stack by application. Since the same Cognito user pool will be used, I think that dividing only the stack without dividing the CDK project will improve the readability of the code and make it easier to manage. https://docs.aws.amazon.com/cdk/v2/guide/resources.html#resource_stack