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

Updating connection_arn on aws_cloudwatch_event_api_destination crashes terraform cli #19628

Closed
timo-reymann opened this issue Jun 2, 2021 · 3 comments · Fixed by #19654
Closed
Assignees
Labels
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.
Milestone

Comments

@timo-reymann
Copy link

timo-reymann commented Jun 2, 2021

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 CLI and Terraform AWS Provider Version

$ terraform -v
Terraform v0.14.7
+ provider registry.terraform.io/hashicorp/aws v3.43.0

Affected Resource(s)

  • aws_cloudwatch_event_api_destination

Terraform Configuration Files

resource "aws_cloudwatch_event_connection" "basic_auth_foo" {
  name               = "http-basic-auth-connection"
  description        = "Basic http bin integration"
  authorization_type = "BASIC"

  auth_parameters {
    basic {
      username = "foo"
      password = "bar"
    }
  }
}

resource "aws_cloudwatch_event_connection" "basic_auth_bar" {
  name               = "http-basic-auth-connection"
  description        = "Basic http bin integration"
  authorization_type = "BASIC"

  auth_parameters {
    basic {
      username = "bar"
      password = "foo"
    }
  }
}

resource "aws_cloudwatch_event_api_destination" "http_webhook" {
  name                             = "http-webhook-test"
  description                      = "An webhook Destination"
  invocation_endpoint              = var.webhook_url
  http_method                      = "POST"
  invocation_rate_limit_per_second = 20
  connection_arn                   = aws_cloudwatch_event_connection.basic_auth_bar.arn
}

Trace Output

https://gist.github.com/timo-reymann/67985bee8ca086a09ea0ad54b0eb1755#file-crash-output-on-loglevel-trace

Expected Behavior

It should recreate the resource or update the connection_arn

Actual Behavior

Terraform crashes

Steps to Reproduce

  1. terraform apply
  2. Change connection_arn to aws_cloudwatch_event_connection.basic_auth_foo.arn
  3. Run terraform apply
  4. Plugin crashes after approving changes

Important Factoids

none

Workaround

As a workaround you can taint the resource, so it gets recreated.

@timo-reymann timo-reymann changed the title Updating connection_arn on aws_cloudwatch_event_api_destination crashes terraform Updating connection_arn on aws_cloudwatch_event_api_destination crashes terraform cli Jun 2, 2021
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/cloudwatchevents labels Jun 2, 2021
@ewbankkit
Copy link
Contributor

panic: interface conversion: interface {} is int, not int64

goroutine 92 [running]:
github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsCloudWatchEventApiDestinationUpdate(0xc001942180, 0x6e443a0, 0xc002267200, 0x0, 0xffffffffffffffff)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/src/github.com/hashicorp/terraform-provider-aws/aws/resource_aws_cloudwatch_event_api_destination.go:151 +0x7b9
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000878a80, 0x8752568, 0xc0019222c0, 0xc001942180, 0x6e443a0, 0xc002267200, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/resource.go:352 +0x1ee
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000878a80, 0x8752568, 0xc0019222c0, 0xc00043bb20, 0xc0010f4ac0, 0x6e443a0, 0xc002267200, 0x0, 0x0, 0x0, ...)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/resource.go:464 +0x390
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc00012a810, 0x8752568, 0xc0019222c0, 0xc0018a5b80, 0xc0019222c0, 0x7a040e0, 0xc0018fbc00)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.6.1/helper/schema/grpc_provider.go:955 +0x8ef
github.com/hashicorp/terraform-plugin-go/tfprotov5/server.(*server).ApplyResourceChange(0xc00211ac00, 0x8752610, 0xc0019222c0, 0xc00043b8f0, 0xc00211ac00, 0xc0018fbc80, 0xc0005fcba0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/server/server.go:332 +0xb5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x7a040e0, 0xc00211ac00, 0x8752610, 0xc0018fbc80, 0xc001918a80, 0x0, 0x8752610, 0xc0018fbc80, 0xc001934000, 0x4d3)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.3.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:380 +0x214
google.golang.org/grpc.(*Server).processUnaryRPC(0xc000911340, 0x8773cb8, 0xc002138780, 0xc0018ff100, 0xc001499b90, 0xbe677a0, 0x0, 0x0, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1194 +0x52b
google.golang.org/grpc.(*Server).handleStream(0xc000911340, 0x8773cb8, 0xc002138780, 0xc0018ff100, 0x0)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:1517 +0xd0c
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc00148e900, 0xc000911340, 0x8773cb8, 0xc002138780, 0xc0018ff100)
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:859 +0xab
created by google.golang.org/grpc.(*Server).serveStreams.func1
        /opt/teamcity-agent/work/5d79fe75d4460a2f/pkg/mod/google.golang.org/grpc@v1.32.0/server.go:857 +0x1fd

if invocationRateLimitPerSecond, ok := d.GetOk("invocation_rate_limit_per_second"); ok {
input.InvocationRateLimitPerSecond = aws.Int64(invocationRateLimitPerSecond.(int64))
}

Related:

@ewbankkit ewbankkit added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 2, 2021
@ewbankkit ewbankkit self-assigned this Jun 3, 2021
@github-actions github-actions bot added this to the v3.44.0 milestone Jun 3, 2021
@ghost
Copy link

ghost commented Jun 3, 2021

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

@github-actions
Copy link

github-actions bot commented Jul 4, 2021

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 4, 2021
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. crash Results from or addresses a Terraform crash or kernel panic.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants