-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathmain.go
50 lines (46 loc) · 1.69 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"github.com/BishopFox/smogcloud/service"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/remeh/sizedwaitgroup"
)
func main() {
swg := sizedwaitgroup.New(5)
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
// call global services
swg.Add()
go service.GetCloudFront(sess, "global", &swg)
swg.Add()
go service.GetRoute53(sess, "global", &swg)
swg.Add()
go service.GetS3(sess, "global", &swg)
// loop through regions
regions := []string{"us-east-1", "us-east-2", "us-west-1", "us-west-2", "ap-east-1", "ap-south-1", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", "ca-central-1", "cn-north-1", "cn-northwest-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "eu-north-1", "me-south-1", "sa-east-1"}
for _, region := range regions {
swg.Add()
go service.GetAPIGateway(sess, region, &swg)
swg.Add()
go service.GetEc2(sess, region, &swg)
swg.Add()
go service.GetEks(sess, region, &swg)
swg.Add()
go service.GetElasticBeanstalk(sess, region, &swg)
swg.Add()
go service.GetElasticSearch(sess, region, &swg)
swg.Add()
go service.GetElb(sess, region, &swg)
swg.Add()
go service.GetLightsail(sess, region, &swg)
swg.Add()
go service.GetMediaStore(sess, region, &swg)
swg.Add()
go service.GetRds(sess, region, &swg)
swg.Add()
go service.GetRedshift(sess, region, &swg)
swg.Add()
go service.GetIoT(sess, region, &swg)
}
swg.Wait()
}