Skip to content

aws_apigatewayv2_integration integration_method not working as described #42391

Open
@ralbear

Description

@ralbear

Documentation Link(s)

https://registry.terraform.io/providers/hashicorp/aws/5.96.0/docs/resources/apigatewayv2_integration#integration_method-3

Description

On current terraform registry documentation says:

integration_method - (Optional) Integration's HTTP method. Must be specified if integration_type is not MOCK.

On AWS says

IntegrationMethod
Specifies the integration's HTTP method type. For WebSocket APIs, if you use a Lambda integration, you must set the integration method to POST.

Required: Conditional

Type: String

Update requires: No interruption

My scenario:

I being stuck on this for a bit, as was using setting a integration_method different than POST and facing this error:

BadRequestException: HttpMethod must be POST for AWS_PROXY IntegrationType

This was a part of the scenario I face this error:

resource "aws_apigatewayv2_api" "this" {
  name               = var.gateway_name
  protocol_type = "HTTP"
}

resource "aws_apigatewayv2_integration" "this" {
  api_id                   = aws_apigatewayv2_api.this.id
  integration_type = "AWS_PROXY"

  # integration_method = "POST"
  integration_uri  = aws_lambda_function.this.invoke_arn
}

Once I remove the integration_method bit (commented on the example), all works fine

References

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-integration.html

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationIntroduces or discusses updates to documentation.needs-triageWaiting for first response or review from a maintainer.service/apigatewayv2Issues and PRs that pertain to the apigatewayv2 service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions