I'm creating AWS Cloudformation template for my environment and I try to enable CORS for API Gateway method. Answer to question #40292888 link to question #40292888 partially answered my question. Solution works great when API return code 200 but I still receive CORS header “Access-Control-Allow-Origin” missing when testing the API without providing the api-key which return code 403 Forbidden. I know that if you check DEFAULT 4XX/5XX when enabling CORS from the console it works, how would I simulate that in my cloudformation template?
DEFAULT 4XX/5XX Api Gateway Console
Thank you,