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

回答なし

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ