Skip to content

Commit

Permalink
tf support: add server_id to private_nic
Browse files Browse the repository at this point in the history
  • Loading branch information
Mia-Cross committed Apr 25, 2024
1 parent 4f6556d commit d984de3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ resource "scaleway_instance_ip" "nodes-fr-par-1-0" {

resource "scaleway_instance_private_nic" "control-plane-fr-par-1-0" {
private_network_id = scaleway_vpc_private_network.scw-minimal-example-com.id
server_id = scaleway_instance_server.control-plane-fr-par-1-0.id
tags = ["noprefix=kops.k8s.io/cluster=scw-minimal.example.com", "noprefix=kops.k8s.io/instance-group=control-plane-fr-par-1"]
}

resource "scaleway_instance_private_nic" "nodes-fr-par-1-0" {
private_network_id = scaleway_vpc_private_network.scw-minimal-example-com.id
server_id = scaleway_instance_server.nodes-fr-par-1-0.id
tags = ["noprefix=kops.k8s.io/cluster=scw-minimal.example.com", "noprefix=kops.k8s.io/instance-group=nodes-fr-par-1"]
}

Expand Down
3 changes: 1 addition & 2 deletions upup/pkg/fi/cloudup/scalewaytasks/private_nic.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,7 @@ func (_ *PrivateNIC) RenderTerraform(t *terraform.TerraformTarget, actual, expec
tfName := strings.ReplaceAll(uniqueName, ".", "-")

tfPNic := terraformPrivateNIC{
//TODO(Mia-Cross): find a way to link server and PNIC before server creation (--> without using ListClusterServers)
//ServerID: expected.Instance.,
ServerID: terraformWriter.LiteralProperty("scaleway_instance_server", tfName, "id"),
PrivateNetworkID: expected.PrivateNetwork.TerraformLink(),
Tags: expected.Tags,
}
Expand Down

0 comments on commit d984de3

Please sign in to comment.