-
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.
Answered by
artysed
Feb 6, 2024
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.
0 replies
Answer selected by
artysed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was basically solved by removing those lines:
CDK can resolve it on its own by providerArns