diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index d0f67665b01..e4eee847a7c 100644 --- a/pkg/cloudprovider/aws/aws.go +++ b/pkg/cloudprovider/aws/aws.go @@ -438,7 +438,13 @@ func (aws *AWSCloud) ExternalID(name string) (string, error) { // InstanceID returns the cloud provider ID of the specified instance. func (aws *AWSCloud) InstanceID(name string) (string, error) { - return "", nil + inst, err := aws.getInstancesByDnsName(name) + if err != nil { + return "", err + } + // In the future it is possible to also return an endpoint as: + // // + return "/" + *inst.Placement.AvailabilityZone + "/" + *inst.InstanceID, nil } // Return the instances matching the relevant private dns name.