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

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠