Skip to content

Commit

Permalink
Separate stage configuration
Browse files Browse the repository at this point in the history
It's recommended to have a [separate definition for the stage and deployment.](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_deployment#stage_name)
  • Loading branch information
sihugh committed Oct 17, 2024
1 parent 8d5589c commit e92032a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ resource "aws_api_gateway_integration" "search_lb_integration" {
# Create a deployment for the API Gateway
resource "aws_api_gateway_deployment" "search_deployment" {
rest_api_id = aws_api_gateway_rest_api.search_rest_api.id
stage_name = "v0_1" # Version embedded in the published URL
}

resource "aws_api_gateway_stage" "search_v0_1" {
deployment_id = aws_api_gateway_deployment.search_deployment.id
rest_api_id = aws_api_gateway_rest_api.search_rest_api.id
stage_name = "v0_1" # Version embedded in the published URL
}

# Map API Gateway stages to custom domain
Expand Down

0 comments on commit e92032a

Please sign in to comment.