This commit is contained in:
schulze 2023-03-22 15:46:58 +01:00
parent 377dc47eac
commit 83383a4156
2 changed files with 2 additions and 2 deletions

View File

@ -38,6 +38,7 @@ func indexInstances(config state.Config) state.Config {
} }
newService, found := indexInstance(config, cloudID, ip) newService, found := indexInstance(config, cloudID, ip)
if !found { if !found {
fmt.Println("New instance found:", newService.CloudID)
config.MTD.Services = append(config.MTD.Services, newService) config.MTD.Services = append(config.MTD.Services, newService)
state.SaveConf(ConfigPath, config) state.SaveConf(ConfigPath, config)
} }

View File

@ -46,8 +46,6 @@ func GetInstances(config state.Config) []AwsInstance {
fmt.Println("Error listing instances:", err) fmt.Println("Error listing instances:", err)
continue continue
} }
//fmt.Println("Listing instances in region:", region)
for _, instance := range instances { for _, instance := range instances {
var publicAddr string var publicAddr string
if instance.PublicIpAddress != nil { if instance.PublicIpAddress != nil {
@ -66,6 +64,7 @@ func GetInstances(config state.Config) []AwsInstance {
// PrintInstanceInfo prints info about a specific instance in a region // PrintInstanceInfo prints info about a specific instance in a region
func PrintInstanceInfo(instance *types.Instance) { func PrintInstanceInfo(instance *types.Instance) {
fmt.Println("\tInstance ID:", aws.ToString(instance.InstanceId)) fmt.Println("\tInstance ID:", aws.ToString(instance.InstanceId))
fmt.Println("\t\tInstance DNS name:", aws.ToString(instance.PublicDnsName))
fmt.Println("\t\tInstance Type:", string(instance.InstanceType)) fmt.Println("\t\tInstance Type:", string(instance.InstanceType))
fmt.Println("\t\tAMI ID:", aws.ToString(instance.ImageId)) fmt.Println("\t\tAMI ID:", aws.ToString(instance.ImageId))
fmt.Println("\t\tState:", string(instance.State.Name)) fmt.Println("\t\tState:", string(instance.State.Name))