code: func (c *Cloud) buildSelfAWSInstance() (*awsInstance, error) {
  	if c.selfAWSInstance != nil {
  		panic("do not call buildSelfAWSInstance directly")
  	}
  	instanceID, err := c.metadata.GetMetadata("instance-id")
  	if err != nil {
  		return nil, fmt.Errorf("error fetching instance-id from ec2 metadata service: %q", err)
  	}
  
  	// We want to fetch the hostname via the EC2 metadata service
  	// (`GetMetadata("local-hostname")`): But see #11543 - we need to use
  	// the EC2 API to get the privateDnsName in case of a private DNS zone
  	// e.g. mydomain.io, because the metadata service returns the wrong
  	// hostname.  Once we're doing that, we might as well get all our
  	// information from the instance returned by the EC2 API - it is a
  	// single API call to get all the information, and it means we don't
  	// have two code paths.
  	instance, err := c.getInstanceByID(instanceID)
  	if err != nil {
  		return nil, fmt.Errorf("error finding instance %s: %q", instanceID, err)
  	}
  	return newAWSInstance(c.ec2, instance), nil
  }
docs: // Builds the awsInstance for the EC2 instance on which we are running.
  // This is called when the AWSCloud is initialized, and should not be called otherwise (because the awsInstance for the local instance is a singleton with drive mapping state)