-
Notifications
You must be signed in to change notification settings - Fork 127
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
scaleway_instance_private_nic : resource (instance) server not found #1151
Comments
Seems to work on fr-par-1. |
Hello, could you try with the private network syntax: https://registry.terraform.io/providers/scaleway/scaleway/latest/docs/resources/instance_server#with-private-network. We want to deprecate NIC as it is an implementation detail and focus on the private network abstraction. |
Hi @remyleone , and thanks for your answer. From there, though, I still can't figure out how to find the private IP that have been given by the Gateway DHCP, to pass on resource "scaleway_instance_server" "this" {
name = "gitlab-runner"
type = var.instance_type
image = var.image
zone = "fr-par-1"
tags = concat(var.tags, ["gitlab-runner"])
root_volume {
size_in_gb = var.size_dd_in_gb
}
private_network {
pn_id = scaleway_vpc_private_network.vpc-runners.id
}
security_group_id = scaleway_instance_security_group.this.id
}
output "instance_ip_addr" {
value = data.scaleway_instance_server.this.private_ip
}
resource "scaleway_vpc_public_gateway_pat_rule" "runner" {
gateway_id = scaleway_vpc_public_gateway.gw-runners.id
#private_ip = scaleway_vpc_public_gateway_dhcp.dhcp-runners.address
#private_ip = scaleway_instance_private_nic.pnic01
#private_ip = data.scaleway_instance_ip.instance_ip.address
private_ip = data.instance_ip_addr.value
private_port = 2223
public_port = 22
protocol = "both"
zone = "fr-par-1"
depends_on = [scaleway_vpc_gateway_network.main, scaleway_vpc_private_network.vpc-runners]
}
With error output: │ Error: Reference to undeclared resource
│
│ on main.tf line 82, in output "instance_ip_addr":
│ 82: value = data.scaleway_instance_server.this.private_ip
│
│ A data resource "scaleway_instance_server" "this" has not been declared in
│ the root module.
╵
╷
│ Error: Reference to undeclared resource
│
│ on main.tf line 90, in resource "scaleway_vpc_public_gateway_pat_rule" "runner":
│ 90: private_ip = data.instance_ip_addr.value
│
│ A data resource "instance_ip_addr" "value" has not been declared in the
│ root module.
╵
ERRO[0001] 1 error occurred:
* exit status 1
Either I do something dumb... but anyway, thanks for help :) |
Hello @tisc0, You use explicitly not declare scaleway_vpc_public_gateway_dhcp_reservation in order to keep fully automated DHCP attribution.
You can check your entries with Also you want use the type
You use our data source Let me know if it is more clear for you. I will as for more documentation about this also. |
Hello @tisc0, regarding the error you encountered with the "scaleway_instance_private_nic" resource, when creating it, only the server_id and private_network_id arguments were entered, what was missing here was the "zone" argument which allows you to specify the availability zone of the resource. By default, if no zone argument is entered, the availability zone of fr-par-1 is assigned, hence the error, the following fixes it: resource "scaleway_instance_private_nic" "pnic01" { The resource documentation omitted to mention the need for the zone argument, it's fixed now. Feel free to comment and reopen the issue if needed. |
Community Note
Terraform Version
Terraform v1.1.7 on linux_amd64
Affected Resource(s)
scaleway_instance_private_nic
Terraform Configuration Files
Debug Output
https://gist.github.com/tisc0/027c247c76b1fda68c0a4725db13a44a
=> the instance with the ID in this log is properly created.
Expected Behavior
The instance should be found, and the private nic added to the instance.
Actual Behavior
The instance is not found.
Steps to Reproduce
terraform apply
References
Realized I did follow the same advice given here #1040 but without success
Thanks for helping !
The text was updated successfully, but these errors were encountered: