Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"aws_apigatewayv2_integration" updates "passthrough_behavior" on every terraform plan #13893

Closed
lxg opened this issue Jun 23, 2020 · 7 comments
Closed
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Milestone

Comments

@lxg
Copy link

lxg commented Jun 23, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.26

  • provider.aws v2.67.0
  • provider.local v1.4.0
  • provider.null v2.1.2
  • provider.random v2.2.1
  • provider.template v2.1.2

Affected Resource(s)

  • aws_apigatewayv2_integration

Terraform Configuration Files

Here’s the relevant code of our config:

resource "aws_apigatewayv2_integration" "services_gateway" {
  api_id               = aws_apigatewayv2_api.services_gateway.id
  integration_type     = "HTTP_PROXY"
  connection_type      = "VPC_LINK"
  integration_method   = "ANY"
  passthrough_behavior = "WHEN_NO_MATCH"
  connection_id        = aws_apigatewayv2_vpc_link.services_gateway.id
  integration_uri      = module.tf_application_load_balancer.load_balancer_listener_arn
}

Here’s the output of terraform plan

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_apigatewayv2_integration.services_gateway will be updated in-place
  ~ resource "aws_apigatewayv2_integration" "services_gateway" {
        api_id                 = "…"
        connection_id          = "…"
        connection_type        = "VPC_LINK"
        id                     = "…"
        integration_method     = "ANY"
        integration_type       = "HTTP_PROXY"
        integration_uri        = "arn:aws:elasticloadbalancing:…"
      + passthrough_behavior   = "WHEN_NO_MATCH"
        payload_format_version = "1.0"
        request_templates      = {}
        timeout_milliseconds   = 29000
    }

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

Expected Behavior

terraform plan should not schedule any changes. Especially as passthrough_behavior = "WHEN_NO_MATCH" is the default anyway. Removing the explicit setting in the config yields the same behaviour.

Actual Behavior

This keeps happening after every terraform apply, so there is never a “consistent” state.

@ghost ghost added the service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. label Jun 23, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jun 23, 2020
@ewbankkit ewbankkit added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 23, 2020
@ewbankkit
Copy link
Contributor

@lxg Thanks for raising this issue.
It has been noticed previously and a fix submitted in #13062.

@lxg
Copy link
Author

lxg commented Jun 23, 2020

Oops, sorry for the duplicate. Missed that when searching existing issues. :(

@lxg lxg closed this as completed Jun 23, 2020
@ewbankkit
Copy link
Contributor

@lxg Actually, it's not a duplicate as the linked PR didn't have an explicit issue it was closing.
I'll reopen this one and it will be closed when the PR is merged.
Thanks.

@ewbankkit ewbankkit reopened this Jun 23, 2020
@jdcookie
Copy link

jdcookie commented Jun 29, 2020

Seeing the same issue - not defining passthrough_behaviour - it's empty in the terraform.tfstate but it shows up in the plan, adding it in, even though this is an HTTP endpoint and I believe they are only used for websockets?

api_gatewap.tf

resource "aws_apigatewayv2_integration" "AllProxy_integration" {
  api_id           = aws_apigatewayv2_api.config.id
  integration_type = "AWS_PROXY"

  connection_type      = "INTERNET"
  description          = "Lambda Integration"
  integration_method   = "POST"
  integration_uri      = aws_lambda_function.config.invoke_arn
}

terraform.tfstate

{
      "mode": "managed",
      "type": "aws_apigatewayv2_integration",
      "name": "AllProxy_integration",
      "provider": "provider.aws",
      "instances": [
        {
          "schema_version": 0,
          "attributes": {
            "api_id": "...",
            "connection_id": "",
            "connection_type": "INTERNET",
            "content_handling_strategy": "",
            "credentials_arn": "",
            "description": "Lambda Integration",
            "id": "zfcgmh1",
            "integration_method": "POST",
            "integration_response_selection_expression": "",
            "integration_type": "AWS_PROXY",
            "integration_uri": "...",
            "passthrough_behavior": "",
            "payload_format_version": "1.0",
            "request_templates": {},
            "template_selection_expression": "",
            "timeout_milliseconds": 29000
          },
          "private": "bnVsbA==",
          "dependencies": [
            "aws_apigatewayv2_api.config",
            "aws_lambda_function.config"
          ]
        }
      ]
    }

Planned changes

~ resource "aws_apigatewayv2_integration" "AllProxy_integration" {
        api_id                 = "..."
        connection_type        = "INTERNET"
        description            = "Lambda Integration"
        id                     = "..."
        integration_method     = "POST"
        integration_type       = "AWS_PROXY"
        integration_uri        = ...
      + passthrough_behavior   = "WHEN_NO_MATCH"
        payload_format_version = "1.0"
        request_templates      = {}
        timeout_milliseconds   = 29000
    }

@ewbankkit
Copy link
Contributor

Closed via #13062.

@ewbankkit ewbankkit added this to the v3.0.0 milestone Jul 22, 2020
@ghost
Copy link

ghost commented Jul 31, 2020

This has been released in version 3.0.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!

@ghost
Copy link

ghost commented Aug 22, 2020

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!

@ghost ghost locked and limited conversation to collaborators Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service.
Projects
None yet
Development

No branches or pull requests

3 participants