Open warrenstephens opened 4 years ago
@warrenstephens Thanks for raising this issue.
It may be worth trying only attributes of aws_apigatewayv2_integration.armadillo_integration
that change as triggers rather than the resource as a whole.
I had the same issue and the suggestion to only include the integration resources worked. I had to keep the routes as a depends_on reference though, so everything deployed nicely:
Not working with inconsistent final plan during deployments:
resource "aws_apigatewayv2_deployment" "deployment_http" {
api_id = aws_apigatewayv2_api.apigw_http.id
triggers = {
redeployment = sha1(join(",", tolist([
jsonencode(aws_apigatewayv2_api.apigw_http),
jsonencode(aws_apigatewayv2_route.gateway_route_post),
jsonencode(aws_apigatewayv2_integration.integration_mylambda),
])))
}
depends_on = [
aws_apigatewayv2_api.apigw_http,
aws_apigatewayv2_route.gateway_route_post,
aws_apigatewayv2_integration.integration_mylambda,
]
lifecycle {
create_before_destroy = true
}
}
Working:
resource "aws_apigatewayv2_deployment" "deployment_http" {
api_id = aws_apigatewayv2_api.apigw_http.id
triggers = {
redeployment = sha1(join(",", tolist([
jsonencode(aws_apigatewayv2_integration.integration_mylambda),
])))
}
depends_on = [
aws_apigatewayv2_api.apigw_http,
aws_apigatewayv2_route.gateway_route_post,
aws_apigatewayv2_integration.integration_mylambda,
]
lifecycle {
create_before_destroy = true
}
}
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
This issue is also occurring on both v5.22 and v5.52.
@KevinD-87 I tried that exact solution as well but it didn't fix the issue for me:
resource "aws_apigatewayv2_deployment" "alb_connection" {
api_id = data.aws_apigatewayv2_api.gateway.id
description = "Deployment of ${var.api_gateway_name} for ${local.full_name}"
triggers = {
redeployment = sha1(join(",", tolist([
jsonencode(aws_apigatewayv2_integration.alb_connection),
])))
}
lifecycle {
create_before_destroy = true
}
depends_on = [
aws_apigatewayv2_integration.alb_connection,
aws_apigatewayv2_route.alb_connection,
aws_apigatewayv2_authorizer.alb_connection,
]
}
This implies that the problem is related to the resources that changed as I had an integration change as well.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
I had just added this chunk to a previously working set of terraform files. However, I am new to apigateway2.
Debug Output
Panic Output
Expected Behavior
Actual Behavior
Output from terraform:
Steps to Reproduce
terraform apply
Important Factoids
provider 2.70.0
References
0000