Skip to content

Commit 538cdef

Browse files
committed
add more services
1 parent e7de89f commit 538cdef

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,23 @@ var (
3030
awsRegion *string
3131
tagName *string
3232
tagValue *string
33+
services *string
3334
)
3435

3536
func init() {
3637

3738
const (
3839
cmdDesc = "Look the IP addresses and instance IDs by their tag name in AWS"
3940
versionFlagDesc = "Displays the version of aws-find"
41+
servicesArgDesc = "Provide service(s) to be queried. Ex: ec2,alb,rds,sg. Default: ec2"
4042
awsRegionDesc = "Provide AWS Region. Default is us-east-1"
4143
tagNameDesc = "Provide AWS Tag name"
4244
tagValueDesc = "Provide AWS Tag value"
4345
)
4446

4547
versionFlag = kingpin.Flag("version", versionFlagDesc).Short('v').Bool()
4648
awsRegion = kingpin.Flag("region", awsRegionDesc).Short('r').String()
49+
services = kingpin.Arg("services", servicesArgDesc).String()
4750
tagName = kingpin.Flag("tag", tagNameDesc).Short('T').String()
4851
tagValue = kingpin.Flag("value", tagValueDesc).Short('V').String()
4952

@@ -55,11 +58,7 @@ func main() {
5558

5659
config := &aws.Config{Region: aws.String(*awsRegion)}
5760

58-
//sess, err := session.NewSession(config)
59-
6061
session := session.Must(session.NewSession(config))
61-
//svc := ssm.New(session)
62-
//lib.CheckError("Can't create aws session", err)
6362

6463
t := &modal.InstanceProfile{
6564
TagName: *tagName,
@@ -70,6 +69,9 @@ func main() {
7069

7170
if *versionFlag {
7271
fmt.Printf("\nVersion: %v\n", version)
72+
} else if *services != "" {
73+
fmt.Println("Printing services")
74+
7375
} else {
7476
go lib.FindEC2(session, t, ch)
7577
<-ch

0 commit comments

Comments
 (0)