From 185d0e19d5aca20e614da0a4a6fbe2c80f4c927b Mon Sep 17 00:00:00 2001 From: Federico Simoncelli Date: Mon, 18 May 2015 10:43:08 -0400 Subject: [PATCH] cloudprovider: aws InstanceID implementation Signed-off-by: Federico Simoncelli --- pkg/cloudprovider/aws/aws.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/aws/aws.go b/pkg/cloudprovider/aws/aws.go index d0f67665b0..e4eee847a7 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.