Terraform v0.13.5
resource "aws_apigatewayv2_integration" "passbase_webhook" {
api_id = aws_apigatewayv2_api.passbase_webhook.id
description = "Convert Passbase webhook to SQS events"
credentials_arn = aws_iam_role.gogaille_api_gateway_passbase_webhook.arn
integration_type = "AWS_PROXY"
integration_subtype = "SQS-SendMessage"
request_parameters = {
"QueueUrl" = module.consumer_passbase.sqs_queue.id
"MessageGroupId" = "$request.body.authentication_key"
"MessageBody" = "$request.body"
}
}
I don't have the debug output as it was running on our ci and manually fixed since because of an emergency.
However, here's the terraform plan:
https://gist.github.com/shouze/c7ca21c6dbbcfc310f3ee28817698144
Here's the result of the apply:
aws_apigatewayv2_integration.passbase_webhook: Modifying... [id=ttltots]
Error: error updating API Gateway v2 integration: BadRequestException: Invalid integration URI specified
Error: Process completed with exit code 1.
The QueueUrl should have been renamed into the api gateway v2 integration.
The QueueUrl should have not been renamed into the api gateway v2 integration. However the state was updated whith the new queue url (when I terraform state show the resource I effectively have the new name after the failed apply). And on subsequent applies after this failure, I still encounter the same failure.
Nothing to mention.
@shouze Thanks for raising this issue.
I can reproduce with an updated acceptance test:
$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration -timeout 120m
=== RUN TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== PAUSE TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
=== CONT TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration
resource_aws_apigatewayv2_integration_test.go:414: Step 2/3 error: Error running apply: 2020/10/28 11:42:03 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.10.0
Error: error updating API Gateway v2 integration: BadRequestException: Invalid integration URI specified
--- FAIL: TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration (24.44s)
FAIL
FAIL github.com/terraform-providers/terraform-provider-aws/aws 24.494s
FAIL
GNUmakefile:27: recipe for target 'testacc' failed
make: *** [testacc] Error 1
It seems like the integration type, integration subtype and all required request parameters must be specified on update even if they don't change.
$ aws --region us-west-2 apigatewayv2 update-integration --api-id msgieufude --integration-id kwfjxsa --request-parameters QueueUrl=https://sqs.us-west-2.amazonaws.com/123456789012/issue-15861-1,MessageBody=\$request.body --integration-type AWS_PROXY --integration-subtype SQS-SendMessage
{
"ConnectionType": "INTERNET",
"CredentialsArn": "arn:aws:iam::123456789012:role/issue-15861",
"Description": "Test SQS send",
"IntegrationId": "kwfjxsa",
"IntegrationSubtype": "SQS-SendMessage",
"IntegrationType": "AWS_PROXY",
"PayloadFormatVersion": "1.0",
"RequestParameters": {
"QueueUrl": "https://sqs.us-west-2.amazonaws.com/123456789012/issue-15861-1",
"MessageBody": "$request.body"
},
"TimeoutInMillis": 29000
}
It seems like the integration type, integration subtype and all required request parameters must be specified on update even if they don't change.
Makes sense about the error message which is returned directly by aws SDK I guess: BadRequestException: Invalid integration URI specified
This has been released in version 3.13.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!
Most helpful comment
@shouze Thanks for raising this issue.
I can reproduce with an updated acceptance test: