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

Terraform / scaleway_vpc_gateway_network / internal server error #2441

Closed
cm-intranet opened this issue Mar 9, 2024 · 4 comments
Closed

Comments

@cm-intranet
Copy link

Hello,
I am unable to create a VPC/Public Gateway/Network with Terraform.
Terraform init & plan are OK, but when i apply the code it ends with a "error 500 Internal Server Error".

Here is what i do:

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 v1.7.4
on linux_amd64

  • provider registry.terraform.io/scaleway/scaleway v2.37.0

Affected Resource(s)

"scaleway_vpc_gateway_network"

Terraform Configuration Files

I just copy/paste code from this scaleway terraform example: https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/vpc_public_gateway_pat_rule

With this configuration:

cat terraform.tf
terraform {
required_providers {
scaleway = {
source = "scaleway/scaleway"
version = ">= 2.37"
}
}
required_version = ">= 0.13"
}

cat provider.tf
provider "scaleway" {
zone = "fr-par-2"
region = "fr-par"
}

Debug Output

https://gist.github.com/cm-intranet/a890a81d483eebe98836c9a10368a401

Expected Behavior

A public gateway attached to a private network should have been created.

Actual Behavior

Here, after applying the plan, i have ''4'' VPC created and one with a private network attached (!)
I also have a public gateway, but not attached to the private network and in "IPAM" mode, even if a DHCP Id has been provided.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

@GuiTeK
Copy link

GuiTeK commented Mar 10, 2024

Hi,

I have the exact same issues as @cm-intranet:

  • Four VPCs get created (never asked for four)
  • Then at the end of the terraform apply, I get an error 500
  • Gateway shows "IPAM" mode instead of DHCP in the Scaleway web UI

Additionally, when destroying the deployment (terraform destroy), the four created VPCs are not destroyed ⚠️ although the command completes successfully, without warning or error.

I copy/pasted the code from How to use Scaleway VPC SSH Bastion config. Here's my complete Terraform code:

terraform {
  required_version = ">= 1.7"

  required_providers {
    scaleway = {
      source = "scaleway/scaleway"
      version = "~> 2.37"
    }
  }
}

provider "scaleway" {
    zone = "fr-par-1"
}

variable "machine_count" {
  description = "Number of virtual machines in private network"
  default = 3
}

# SCALEWAY VPC PRIVATE NETWORK
resource scaleway_vpc_private_network "pn" {
  name = "myprivatenetwork"
}

# SCALEWAY VPC VIRTUAL MACHINES
resource scaleway_instance_server "servers" {
  count    = var.machine_count
  name     = "machine${count.index}"
  image = "ubuntu_focal"
  type  = "DEV1-S"
}

# SCALEWAY INSTANCES PRIVATE NETWORK CONNECTION
resource scaleway_instance_private_nic "nic" {
  count              = length(scaleway_instance_server.servers)
  private_network_id = scaleway_vpc_private_network.pn.id
  server_id          = scaleway_instance_server.servers[count.index].id
}

# SCALEWAY PUBLIC GATEWAY IP
resource scaleway_vpc_public_gateway_ip "pgw_ip" {
}

resource scaleway_vpc_public_gateway "pgw" {
  type = "VPC-GW-S"
  bastion_enabled = true
  ip_id = scaleway_vpc_public_gateway_ip.pgw_ip.id
}

resource scaleway_vpc_public_gateway_dhcp "dhcp" {
  subnet = "192.168.1.0/24"
  dns_local_name = scaleway_vpc_private_network.pn.name
}

resource scaleway_vpc_gateway_network "gn" {
  gateway_id          = scaleway_vpc_public_gateway.pgw.id
  private_network_id  = scaleway_vpc_private_network.pn.id
  dhcp_id             = scaleway_vpc_public_gateway_dhcp.dhcp.id
  enable_dhcp         = true
}

I'm creating a support ticket to report this as well as it seems to be a critical issue.

@GuiTeK
Copy link

GuiTeK commented Mar 10, 2024

Customer support told me ~45mn ago that they are "immediately passing on this critical flaw report to our product team so that they can investigate it and patch our problem source code".

🤞🏻

@mnennon
Copy link

mnennon commented Mar 11, 2024

Hello,

On friday, I noticed that behaviour also.

I used version 2.36.0 of scaleway provider and version 1.6.6 of terraform.

Updated today to version 2.38.0 of provider, nothing changed.

On Wednesday 6th, all worked fine

@Codelax
Copy link
Member

Codelax commented Mar 12, 2024

Hello, this is not an issue with terraform provider but with the API.
It is fixed so I will close this for now.

@Codelax Codelax closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants