feat: display ec2 instance name when tag name exist
parent
bcff002e50
commit
62f6f997b7
|
@ -1,6 +1,10 @@
|
|||
package aws
|
||||
|
||||
import "github.com/cloudskiff/driftctl/pkg/resource"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/cloudskiff/driftctl/pkg/resource"
|
||||
)
|
||||
|
||||
func (r *AwsInstance) NormalizeForState() (resource.Resource, error) {
|
||||
if r.RootBlockDevice != nil && len(*r.RootBlockDevice) == 0 {
|
||||
|
@ -21,3 +25,10 @@ func (r *AwsInstance) NormalizeForProvider() (resource.Resource, error) {
|
|||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
func (r *AwsInstance) String() string {
|
||||
if name, ok := r.Tags["Name"]; ok {
|
||||
return fmt.Sprintf("%s (Name: %s)", r.TerraformId(), name)
|
||||
}
|
||||
return r.TerraformId()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue