-
Hi! I'm defining my api from open-api definition. I have something like this: "securitySchemes": {
"CognitoAuthorizer": {
"type": "apiKey",
"name": "Authorization",
"in": "header",
"x-amazon-apigateway-authtype": "cognito_user_pools",
"x-amazon-apigateway-authorizer": {
"type": "cognito_user_pools",
"providerARNs": [
<arn to replace>
]
}
}
} and then I connect it to every path. In my infrastructure, I'm trying to create authorizer linked to ARN from another account: user_pool = cognito.UserPool.from_user_pool_arn(self, "CognitoUserPool", cognito_user_pool_arn)
apigateway.CognitoUserPoolsAuthorizer(
self, "CognitoAuthorizer", cognito_user_pools=[user_pool]
)
api = apigateway.SpecRestApi(
self,
f"name",
api_definition=apigateway.ApiDefinition.from_inline(api_definition), #taken fron json
) but I'm having issues while applying this because CDK is failing. Is there a way to attached it with open-api? Should the property in open-api and AWS has the same name? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It was basically solved by removing those lines: user_pool = cognito.UserPool.from_user_pool_arn(self, "CognitoUserPool", cognito_user_pool_arn)
apigateway.CognitoUserPoolsAuthorizer(
self, "CognitoAuthorizer", cognito_user_pools=[user_pool]
) CDK can resolve it on its own by providerArns |
Beta Was this translation helpful? Give feedback.
It was basically solved by removing those lines:
CDK can resolve it on its own by providerArns