api_gateway (terraform)

Reference


Example

# 'create_before_destroy' needed for avoiding 'VPC Link' destroy issue
resource "aws_api_gateway_deployment" "deployment_myapp" {

  depends_on = [

  aws_api_gateway_method.method_http_myapp,

  aws_api_gateway_integration.integration_proxy_myapp,

  aws_api_gateway_integration.integration_proxy_myapp_rest

]

  lifecycle {

    create_before_destroy = true

  }


  rest_api_id = aws_api_gateway_rest_api.apigateway-myapp.id

  stage_name  = var.env

  variables = {

    deployed_at = "${timestamp()}"

  }

}