CDK SpecRestApi with CognitoUserPoolsAuthorizer with multiple User Pools for OpenAPI 3.0.x API

0

Hello,

In my CDK (Python) stack, I'm trying to use OpenAPI to define my APIs that were previously written directly in CDK. I've exported the current setup to OpenAPI JSON and it looks like this:

  "components" : {
    "securitySchemes" : {
      "MyUserPoolAuthorizer" : {
        "type" : "apiKey",
        "name" : "Authorization",
        "in" : "header",
        "x-amazon-apigateway-authtype" : "cognito_user_pools",
        "x-amazon-apigateway-authorizer" : {
          "type" : "cognito_user_pools",
          "providerARNs" : [ "arn:aws:cognito-idp:us-east-1:xxxxxxxxx:userpool/us-east-1_T1LjPI6Vc", "arn:aws:cognito-idp:us-east-1:xxxxxxxxx:userpool/us-east-1_abc", "arn:aws:cognito-idp:us-east-1:xxxxxxxxx:userpool/us-east-1_def", "arn:aws:cognito-idp:us-east-1:xxxxxxxxx:userpool/us-east-1_ghi", "arn:aws:cognito-idp:us-east-1:xxxxxxxxx:userpool/us-east-1_jkl" ]
        }
      }
    }
  }

The list of providerARNs is based on user pools set up in the CDK definition. How can I convert this to a CDK definition (without hard-coded values like the user pool ARN)? I've looked at CfnParameters, but I am having trouble because the values aren't known at runtime. I am thinking something like Fn::Join ["", [${MyListResource]] might work, but I've had no luck with this. I see in this link how to do some basic substitution, but not how to pass a list around.

Any suggestions would be appreciated! Cheers, Jonathan

没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则