I would like to reference a resource’s ARN in my iamRoleStatements. Currently, this is only possible if the CognitoUserPool resource is deployed first.
provider:
name: aws
runtime: nodejs8.10
iamRoleStatements:
- Effect: Allow
Action:
- cognito-idp:AdminGetUser
Resource:
- Fn::GetAtt: ["CognitoUserPoolMyUserPool", "Arn"]
resources:
Resources:
CognitoUserPoolMyUserPool:
Type: AWS::Cognito::UserPool
Properties:
AutoVerifiedAttributes:
- email
I have seen solutions where the CognitoUserPool resource would be defined elsewhere (another CFN stack, etc). Then, I can reference the <stack_name.output> in my iamRoleStatements.
Unfortunately, the above will not work for me because I am also trying to override an existing Cognito User Pool (https://serverless.com/framework/docs/providers/aws/events/cognito-user-pool#overriding-a-generated-user-pool)
Therefore, I need the CognitoUserPool resource to be in the same serverless.yml
as my iamRoleStatements.