I’m in the process of reorganizing our API project that relies on Cognito for authentication to take advantage of base path mapping to better organize our endpoints. We’re planning on 3 different deployments/stacks:
/auth for authentication endpoints. This stack will also hold the actual Cognito user pool.
/v1 for our first version of the API
/v2 for our second version of the API
Both /v1 and /v2 will need access to the user pool in the /auth stack. I believe I’m exporting things correctly from /auth because when I look in CloudFormation for that stack, I can see the exported names (See CognitoExports.jpg attachment).
This is how I’m trying to import the Cognito pool in the Resources section:
When I go to deploy this setup, I get the following error.
The CloudFormation template is invalid: Invalid template resource property ‘Fn::ImportValue’
I’m having trouble finding an example on-line of just what I’m trying to do. Is there something simple I’m doing wrong? What should I be adding as the “resource property” for the user pool and the user pool client for the imports to work? Should I be creating an identity pool to point to the main user pool instead??
I got some guidance from AWS support, but it’s still not quite right yet. As you can see from the attachment, it looks like the export is created successfully. Here’s where I try to us Fn::ImportValue to import the CognitoUserPool:
this really helps me. thank you Larry a lot! i really appreciate it. i was just wondering if you can help me with something when i would have questions? (as i can feel that i will have some)