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)
if !found {
fmt.Println("New instance found:", newService.CloudID)
config.MTD.Services = append(config.MTD.Services, newService)
state.SaveConf(ConfigPath, config)
}

View File

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