-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataModel.go
144 lines (130 loc) · 3.35 KB
/
dataModel.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// Copyright 2021 Stigian Consulting - reference license in top level of project
package main
import (
"sync"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/sts"
)
type RegionData struct {
VPCs map[string]VPC
}
type VPC struct {
Id *string
IsDefault bool
CidrBlock *string
IPv6CidrBlock *string
Name *string
RawVPC *ec2.Vpc
Gateways []string
Subnets map[string]Subnet
Peers map[string]VPCPeer
}
type Subnet struct {
Id *string
CidrBlock *string
AvailabilityZone *string
AvailabilityZoneId *string
Public bool
Name *string
RawSubnet *ec2.Subnet
RouteTable *RouteTable
Instances map[string]Instance
NatGateways map[string]NatGateway
TGWs map[string]TGWAttachment
ENIs map[string]NetworkInterface
InterfaceEndpoints map[string]InterfaceEndpoint
GatewayEndpoints map[string]GatewayEndpoint
}
type Instance struct {
Id *string
Type *string
SubnetId *string
VpcId *string
State *string
PublicIP *string
PrivateIP *string
Name *string
InstanceStatus *string
SystemStatus *string
Volumes map[string]Volume
Interfaces map[string]NetworkInterface
RawEc2 *ec2.Instance
}
type NetworkInterface struct {
Id *string
PrivateIp *string
MAC *string
DNS *string
Type *string
Description *string
PublicIp *string
Name *string
RawNetworkInterface *ec2.NetworkInterface
}
type Volume struct {
Id *string
DeviceName *string
Size *int64
VolumeType *string
Name *string
RawVolume *ec2.Volume
}
type NatGateway struct {
Id *string
PrivateIP *string
PublicIP *string
State *string
Type *string
Name *string
RawNatGateway *ec2.NatGateway
}
type RouteTable struct {
Id *string
Default *string
RawRoute *ec2.RouteTable
}
type TGWAttachment struct {
AttachmentId *string
TransitGatewayId *string
Name *string
RawAttachment *ec2.TransitGatewayVpcAttachment
}
type VPCPeer struct {
Id *string
Requester *string
Accepter *string
Name *string
RawPeer *ec2.VpcPeeringConnection
}
type InterfaceEndpoint struct {
Id *string
ServiceName *string
Name *string
RawEndpoint *ec2.VpcEndpoint
}
type GatewayEndpoint struct {
Id *string
ServiceName *string
Name *string
RawEndpoint *ec2.VpcEndpoint
}
type RecievedData struct {
wg sync.WaitGroup
mu sync.Mutex
Identity *sts.GetCallerIdentityOutput
Vpcs []*ec2.Vpc
Subnets []*ec2.Subnet
Instances []*ec2.Reservation
InstanceStatuses []*ec2.InstanceStatus
NatGateways []*ec2.NatGateway
RouteTables []*ec2.RouteTable
InternetGateways []*ec2.InternetGateway
EOInternetGateways []*ec2.EgressOnlyInternetGateway
VPNGateways []*ec2.VpnGateway
TransitGateways []*ec2.TransitGatewayVpcAttachment
PeeringConnections []*ec2.VpcPeeringConnection
NetworkInterfaces []*ec2.NetworkInterface
VPCEndpoints []*ec2.VpcEndpoint
Volumes []*ec2.Volume
Error error
}