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?