code: func (r *ResourceAddress) String() string {
  	var result []string
  	for _, p := range r.Path {
  		result = append(result, "module", p)
  	}
  
  	switch r.Mode {
  	case config.ManagedResourceMode:
  		// nothing to do
  	case config.DataResourceMode:
  		result = append(result, "data")
  	default:
  		panic(fmt.Errorf("unsupported resource mode %s", r.Mode))
  	}
  
  	if r.Type != "" {
  		result = append(result, r.Type)
  	}
  
  	if r.Name != "" {
  		name := r.Name
  		if r.InstanceTypeSet {
  			switch r.InstanceType {
  			case TypePrimary:
  				name += ".primary"
  			case TypeDeposed:
  				name += ".deposed"
  			case TypeTainted:
  				name += ".tainted"
  			}
  		}
  
  		if r.Index >= 0 {
  			name += fmt.Sprintf("[%d]", r.Index)
  		}
  		result = append(result, name)
  	}
  
  	return strings.Join(result, ".")
  }
docs: // String outputs the address that parses into this address.