aws / chalice

Python Serverless Microframework for AWS
Apache License 2.0
10.65k stars 1.01k forks source link

Use api_gateway_stage for managing APIGW stages with Terraform instead of api_gateway_deployment stage_name #1838

Open jrbeilke opened 2 years ago

jrbeilke commented 2 years ago

Attempting to enhance some of the features/functionality of Chalice with Terraform during our deploys, but we're limited because Chalice does not expose the API Gateway stage (ie. for associating a WAF ACL with APIGW stage)

The AWS provider for Terraform has been updated and also no longer recommends using stage_name in api_gateway_deployment to manage API Gateway stages as Chalice does today.

jrbeilke commented 2 years ago

Came up with a workaround for now by wrapping the chalice.tf.json with some additional Terraform that can grab the stage-name and generate an ARN for the APIGW stage ie.

"${aws_api_gateway_rest_api.rest_api.arn}/stages/${aws_api_gateway_deployment.rest_api.stage_name}"