Hi there,
Terraform v0.11.1
Please list the resources as a list, for example:
resource "aws_api_gateway_method" "enable_head_request" {
provider = "aws.default"
rest_api_id = "${aws_api_gateway_rest_api.petshop.id}"
resource_id = "${aws_api_gateway_rest_api.petshop.root_resource_id}"
http_method = "HEAD"
authorization = "NONE"
# api_key_required = "False"
}
resource "aws_api_gateway_integration" "enable_head_request" {
provider = "aws.default"
rest_api_id = "${aws_api_gateway_rest_api.petshop.id}"
resource_id = "${aws_api_gateway_rest_api.petshop.root_resource_id}"
http_method = "${aws_api_gateway_method.enable_head_request.http_method}"
integration_http_method = "POST"
type = "AWS_PROXY"
uri = "${aws_lambda_function.petshop.invoke_arn}"
}
resource "aws_api_gateway_method_response" "200_for_head_request" {
provider = "aws.default"
rest_api_id = "${aws_api_gateway_rest_api.petshop.id}"
resource_id = "${aws_api_gateway_rest_api.petshop.root_resource_id}"
http_method = "${aws_api_gateway_method.enable_head_request.http_method}"
status_code = "200"
}
I should be able to make HEAD requests to my API Gateway endpoint.
After deploying on trying to make a HEAD request I get
curl --head https://test.com
HTTP/1.1 403 Forbidden
Date: Thu, 01 Mar 2018 18:47:07 GMT
Content-Type: application/json
Content-Length: 42
Connection: keep-alive
x-amzn-RequestId: f1811ce9-1d80-11e8-b15c-cf44af523470
x-amzn-ErrorType: MissingAuthenticationTokenException
The issue is that the deployment does not get redeployed. Here's how to trigger a redeployment whenever there's a change in the contents of the apigateway.tf file
resource "aws_api_gateway_deployment" "petshop" {
provider = "aws.default"
stage_description = "${md5(file("apigateway.tf"))}"
rest_api_id = "${aws_api_gateway_rest_api.petshop.id}"
stage_name = "prod"
}
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
The issue is that the deployment does not get redeployed. Here's how to trigger a redeployment whenever there's a change in the contents of the
apigateway.tffile