`aws_apigatewayv2_integration`: removing an entry from `request_parameters` fails during in-place update

Author: cooperaaCreated Sep 17, 2026Updated Sep 17, 2026
Labelsbugservice/apigatewayv2needs-triage

Terraform and AWS Provider Version

bash
Terraform v1.15.6
hashicorp/aws v6.65.0
Windows amd64

Affected Resource(s) or Data Source(s)

  • aws_apigatewayv2_integration
    • Specifically removal of entries from request_parameters

Expected Behavior

Terraform should remove DelaySeconds while updating the existing integration, or replace the integration if API Gateway cannot perform this operation in place.

Actual Behavior

Terraform plans an in-place update:

~ request_parameters = {
    - "DelaySeconds" = "0" -> null
      # (3 unchanged elements hidden)
  }

Plan: 0 to add, 1 to change, 0 to destroy.

The apply fails:

Error: updating API Gateway v2 Integration: operation error ApiGatewayV2:
UpdateIntegration, https response error StatusCode: 400,
BadRequestException: Invalid selection expression specified:
Validation Result: warnings : [], errors :
[Mapping expression missing source or destination]

Relevant Error/Panic Output

The provider sends the removed parameter as an empty-string tombstone and includes the unchanged required parameters:

bash
{
  "integrationSubtype": "SQS-SendMessage",
  "integrationType": "AWS_PROXY",
  "requestParameters": {
    "QueueUrl": "https://sqs.ca-central-1.amazonaws.com/ACCOUNT/QUEUE",
    "MessageBody": "$request.body",
    "Region": "ca-central-1",
    "DelaySeconds": ""
  }
}

API Gateway responds with HTTP 400 and:

{
  "message": "Invalid selection expression specified: Validation Result: warnings : [], errors : [Mapping expression missing source or destination]"
}

Sample Terraform Configuration

hcl
resource "aws_apigatewayv2_integration" "repro" {
  api_id                 = aws_apigatewayv2_api.repro.id
  integration_type       = "AWS_PROXY"
  integration_subtype    = "SQS-SendMessage"
  credentials_arn        = aws_iam_role.repro.arn
  payload_format_version = "1.0"

  request_parameters = {
    QueueUrl    = aws_sqs_queue.repro.url
    MessageBody = "$request.body"
    Region      = "ca-central-1"
    DelaySeconds = "0"
  }
}

Steps to Reproduce

  1. Apply the configuration.
  2. Remove DelaySeconds from the request_parameters
  3. Apply and produce error

Debug Logging

No response

GenAI / LLM Assisted Development

Github Copilot

Important Facts and References

Looks like it could be related to https://github.com/hashicorp/terraform-provider-aws/issues/22647

Would you like to implement a fix?

No

Source: hashicorp/terraform-provider-aws