String() returns a string representation of an AbsProviderConfig in a format like the following examples: - provider["example.com/namespace/name"] - provider["example.com/namespace/name"].alias - module.module-name.provider["example.com/namespace/name"] - module.module-name.provider["example.com/na
()
| 450 | // - module.module-name.provider["example.com/namespace/name"] |
| 451 | // - module.module-name.provider["example.com/namespace/name"].alias |
| 452 | func (pc AbsProviderConfig) String() string { |
| 453 | var parts []string |
| 454 | if len(pc.Module) > 0 { |
| 455 | parts = append(parts, pc.Module.String()) |
| 456 | } |
| 457 | |
| 458 | parts = append(parts, fmt.Sprintf("provider[%q]", pc.Provider)) |
| 459 | |
| 460 | if pc.Alias != "" { |
| 461 | parts = append(parts, pc.Alias) |
| 462 | } |
| 463 | |
| 464 | return strings.Join(parts, ".") |
| 465 | } |
| 466 | |
| 467 | func (pc AbsProviderConfig) InstanceString(key InstanceKey) string { |
| 468 | if key == NoKey { |