Secondary ip addresses on network interfaces not showing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
goamz |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If I create an instance in a region with a default-vpc, and use the AssignPrivateIP
The code below illustrates the problem. It creates the instance and adds the ip address. It sleeps 30 seconds so you can manually confirm that the new address is showing in the dashboard (and to rule out "eventual consistency" as the cause of the bug). It then fetches an updated version of the instance and prints out the network interface.
I would expect the "PrivateIPs" field to contain the new address.
package main
import (
"fmt"
"time"
)
func setupServer() {
ec2srv, err := ec2test.NewServer()
if err != nil {
}
config := &s3test.Config{}
s3srv, err := s3test.
if err != nil {
}
}
})
}
func main() {
// region := aws.Regions["test"]
region := aws.APSoutheast2 // our region with default-vpc
auth, err := aws.EnvAuth()
if err != nil {
}
e := ec2.New(auth, region)
options := &ec2.RunInstances{
resp, err := e.RunInstances(
if err != nil {
}
// display the network interface
instanceId := resp.Instances[
netId := resp.Instances[
// response is useless here
aResp, err := e.AssignPrivate
if err != nil {
}
iResp, err := e.Instances(
// display the updated network interface
}
It turns out that the response from ec2 includes the network interface but does *not* include the secondary ip address information. So this bug is invalid. Use "NetworkInterfaces" (which does include it).