Closed
Description
Describe the bug
When trying to import a Cognito UserPool to be used in an AppSync Graphql domain, the UserPool is configured with the region of the stack that is being deployed and disregards the region supplied in the ARN.
Expected Behavior
Using the construct below and assuming that this.stack
is created in us-west-2
:
return new GraphqlApi(this.stack, `api`, {
name: `TheAPI`,
schema: Schema.fromAsset('schema.graphql'),
authorizationConfig: {
defaultAuthorization: {
authorizationType: AuthorizationType.USER_POOL,
userPoolConfig: {
userPool: UserPool.fromUserPoolArn(this.stack, 'CognitoUserPool', `arn:aws:cognito-idp:us-east-1:${this.awsAccountId}:userpool/${userPoolId}`),
defaultAction: UserPoolDefaultAction.ALLOW
}
}
},
logConfig: {
excludeVerboseContent: false,
fieldLogLevel: FieldLogLevel.ALL
},
xrayEnabled: true
});
I expected the UserPool to be linked to the UserPool created in us-east-1
per the ARN provided.
"TheApi": {
"Type": "AWS::AppSync::GraphQLApi",
"Properties": {
"AuthenticationType": "AMAZON_COGNITO_USER_POOLS",
"Name": "TheApi",
"UserPoolConfig": {
"AwsRegion": "us-east-1",
"DefaultAction": "ALLOW",
"UserPoolId": {
"Ref": "SomeId"
}
...
}
Current Behavior
However, the generated output shows us-west-2
as the region:
"TheApi": {
"Type": "AWS::AppSync::GraphQLApi",
"Properties": {
"AuthenticationType": "AMAZON_COGNITO_USER_POOLS",
"Name": "TheApi",
"UserPoolConfig": {
"AwsRegion": "us-west-2",
"DefaultAction": "ALLOW",
"UserPoolId": {
"Ref": "SomeId"
}
...
}
Reproduction Steps
build a new graphQl API with a UserPool from a different region
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
1.152.0
Framework Version
No response
Node.js Version
v16.10.0
OS
MacOS Monterey 12.3
Language
Typescript
Language Version
No response
Other information
No response
Activity
ryanvaloris commentedon May 3, 2022
related #13691
fix(appsync): incorrect region used for imported Cognito user pool (#…
github-actions commentedon May 5, 2022
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
fix(appsync): incorrect region used for imported Cognito user pool (a…