mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
terraform: ResourceAddress should output instance type if set
This commit is contained in:
parent
4faa6b37e4
commit
407be65cc8
@ -52,11 +52,15 @@ func (r *ResourceAddress) String() string {
|
||||
|
||||
if r.Name != "" {
|
||||
name := r.Name
|
||||
switch r.InstanceType {
|
||||
case TypeDeposed:
|
||||
name += ".deposed"
|
||||
case TypeTainted:
|
||||
name += ".tainted"
|
||||
if r.InstanceTypeSet {
|
||||
switch r.InstanceType {
|
||||
case TypePrimary:
|
||||
name += ".primary"
|
||||
case TypeDeposed:
|
||||
name += ".deposed"
|
||||
case TypeTainted:
|
||||
name += ".tainted"
|
||||
}
|
||||
}
|
||||
|
||||
if r.Index >= 0 {
|
||||
|
@ -50,7 +50,7 @@ func TestParseResourceAddress(t *testing.T) {
|
||||
InstanceTypeSet: true,
|
||||
Index: 2,
|
||||
},
|
||||
"aws_instance.foo[2]",
|
||||
"",
|
||||
},
|
||||
"tainted": {
|
||||
"aws_instance.foo.tainted",
|
||||
|
Loading…
Reference in New Issue
Block a user