[go: nahoru, domu]

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

bug: panic when enable_vpn_gateway is enabled on terraform vpc module #9995

Open
1 task done
moodwrench opened this issue Jan 4, 2024 · 2 comments
Open
1 task done
Assignees
Labels
area: integration/terraform Issues related to HashiCorp Terraform aws:ec2 Amazon Elastic Compute Cloud status: resolved/fixed Resolved via a fix or an implementation type: bug Bug report

Comments

@moodwrench
Copy link
moodwrench commented Jan 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

when using enable_vpn_gateway set to true on the vpc module (https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest), latest version (5.4.0), the terraform apply fails with:
Stack trace from the terraform-provider-aws_v5.31.0_x5 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x10 pc=0x1012734c0]

goroutine 324 [running]:
github.com/hashicorp/terraform-provider-aws/internal/tags.(*TagData).ValueString(...)
	github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:671
github.com/hashicorp/terraform-provider-aws/internal/tags.KeyValueTags.ResolveDuplicates(0x14002acd580?, {0x10ec62ce0, 0x14002fc6720}, 0x0, 0x0?, {0x120640b60, 0x140028ead80})
	github.com/hashicorp/terraform-provider-aws/internal/tags/key_value_tags.go:780 +0x110
github.com/hashicorp/terraform-provider-aws/internal/provider.tagsResourceInterceptor.run({0x14001296940?, 0x10eb02bf0?, 0x10eb02be8?}, {0x10ec62ce0, 0x14002fc6720}, {0x10ec73028, 0x140028ead80}, {0x10eaa23e0?, 0x14000ab20f0?}, 0x2, ...)
	github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:353 +0x724
github.com/hashicorp/terraform-provider-aws/internal/provider.interceptedHandler[...].func1(0x0?, {0x10eaa23e0?, 0x14000ab20f0?})
	github.com/hashicorp/terraform-provider-aws/internal/provider/intercept.go:120 +0x354
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x10ec62ce0?, {0x10ec62ce0?, 0x14002fa78f0?}, 0xd?, {0x10eaa23e0?, 0x14000ab20f0?})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/resource.go:773 +0x64
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0x1400137cfc0, {0x10ec62ce0, 0x14002fa78f0}, 0x14002f97ba0, 0x140028eac00, {0x10eaa23e0, 0x14000ab20f0})
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/resource.go:909 +0x8a0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0x14000aa9938, {0x10ec62ce0?, 0x14002fa77d0?}, 0x140028db130)
	github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/grpc_provider.go:1072 +0xb78
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.(*muxServer).ApplyResourceChange(0x10ec62c38?, {0x10ec62ce0?, 0x14002fa74a0?}, 0x140028db130)
	github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf5muxserver/mux_server_ApplyResourceChange.go:36 +0x188
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0x14000cf7860, {0x10ec62ce0?, 0x14002fa6c90?}, 0x140028e0e70)
	github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov5/tf5server/server.go:859 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x10e8083a0?, 0x14000cf7860}, {0x10ec62ce0, 0x14002fa6c90}, 0x140028ea980, 0x0)
	github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:467 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000afa1e0, {0x10ec62ce0, 0x140028e5dd0}, {0x10ec750c0, 0x140028061a0}, 0x140028fdd40, 0x1400279a5d0, 0x1155088d8, 0x0)
	google.golang.org/grpc@v1.59.0/server.go:1343 +0xc6c
google.golang.org/grpc.(*Server).handleStream(0x14000afa1e0, {0x10ec750c0, 0x140028061a0}, 0x140028fdd40)
	google.golang.org/grpc@v1.59.0/server.go:1737 +0x9f0
google.golang.org/grpc.(*Server).serveStreams.func1.1()
	google.golang.org/grpc@v1.59.0/server.go:986 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1
	google.golang.org/grpc@v1.59.0/server.go:997 +0x174

Error: The terraform-provider-aws_v5.31.0_x5 plugin crashed!

Expected Behavior

successful creation of a vpc

How are you starting LocalStack?

Custom (please describe below)

Steps To Reproduce

I've created a custom provider in my terraform code to overwrite the endpoint:

provider "aws" {
  region = var.use_localstack ? "af-south-1" : var.region

  access_key = var.use_localstack ? "mock_access_key" : null
  secret_key = var.use_localstack ? "mock_secret_key" : null

  skip_credentials_validation = var.use_localstack
  skip_metadata_api_check     = var.use_localstack
  skip_requesting_account_id  = var.use_localstack

  endpoints {
    ec2 = var.use_localstack ? "http://localhost:4566" : null
    s3  = var.use_localstack ? "http://localhost:4566" : null
    sts = var.use_localstack ? "http://localhost:4566" : null
    acm = var.use_localstack ? "http://localhost:4566" : null
    iam = var.use_localstack ? "http://localhost:4566" : null
  }
}

Environment

- OS:
			"AWS_ACCESS_KEY_ID":     "mock_access_key",
			"AWS_SECRET_ACCESS_KEY": "mock_secret_key",
			"AWS_ENDPOINT_URL":      "http://localhost:4566",
			"AWS_S3_ENDPOINT":       "http://localhost:4566",
			"AWS_EC2_ENDPOINT":      "http://localhost:4566",
- LocalStack:

Anything else?

No response

@moodwrench moodwrench added status: triage needed Requires evaluation by maintainers type: bug Bug report labels Jan 4, 2024
@localstack-bot
Copy link
Collaborator

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide.

@sannya-singal sannya-singal added area: integration/terraform Issues related to HashiCorp Terraform status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels Jan 9, 2024
@viren-nadkarni viren-nadkarni self-assigned this Jan 10, 2024
@viren-nadkarni viren-nadkarni added the aws:ec2 Amazon Elastic Compute Cloud label Jan 10, 2024
@MarcelStranak
Copy link

Hi @moodwrench,

Please ensure you have updated to the latest versions of Terraform, the AWS provider, and the VPC module, and have pulled the latest LocalStack Docker image. The issue should now be resolved, as the deployment of the provided sample at terraform-aws-modules/vpc is possible.

@MarcelStranak MarcelStranak added status: resolved/fixed Resolved via a fix or an implementation and removed status: backlog Triaged but not yet being worked on labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: integration/terraform Issues related to HashiCorp Terraform aws:ec2 Amazon Elastic Compute Cloud status: resolved/fixed Resolved via a fix or an implementation type: bug Bug report
Projects
None yet
Development

No branches or pull requests

5 participants