0

I have this api gateway in my main stack:

api_gateway = _api_gw.LambdaRestApi(
    self,
    f"{construct_id}-gw-api",
    handler=lambda_hello,
    rest_api_name=f"gw-api{env_ext}",
    default_cors_preflight_options=_api_gw.CorsOptions(
        allow_headers=[
            "Content-Type",
            "X-Amz-Date",
            "Authorization",
            "X-Api-Key",
            "X-Amz-Security-Token",
        ],
        allow_origins=_api_gw.Cors.ALL_ORIGINS,
        allow_methods=_api_gw.Cors.ALL_METHODS,
    ),
    proxy=False,
    deploy_options=None,
)

passing the api_gateway to the nested stack is not working, and also using fromRestApiAttributes in the nested stack is not working (git issue). I tried to create a separate api_gateway but I can't use the same authorizer and I don't want to authorize the user twice.

Any idea how I can add more methods to the original api gateway in a nested stack, so I can avoid the 500 resources limit?

1
  • What do you mean by "not working"? Please edit your question and clarify what the desired behavior is, what you are doing, and what the error message / observed behavior is. Do you want to create an API in the parent stack, but place the methods in a nested stack? Refer to stackoverflow.com/help/how-to-ask Commented Nov 10 at 10:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.