(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Endpoint)
| 1245 | } |
| 1246 | |
| 1247 | func (m *EndpointsModule) getRdsClustersPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Endpoint) { |
| 1248 | defer func() { |
| 1249 | m.CommandCounter.DecrExecuting() |
| 1250 | m.CommandCounter.IncrComplete() |
| 1251 | wg.Done() |
| 1252 | |
| 1253 | }() |
| 1254 | semaphore <- struct{}{} |
| 1255 | defer func() { |
| 1256 | <-semaphore |
| 1257 | }() |
| 1258 | // m.CommandCounter.IncrTotal() |
| 1259 | m.CommandCounter.DecrPending() |
| 1260 | m.CommandCounter.IncrExecuting() |
| 1261 | |
| 1262 | DBInstances, err := sdk.CachedRDSDescribeDBInstances(m.RDSClient, aws.ToString(m.Caller.Account), r) |
| 1263 | if err != nil { |
| 1264 | if errors.As(err, &oe) { |
| 1265 | m.Errors = append(m.Errors, fmt.Sprintf(" Error: Region: %s, Service: %s, Operation: %s", r, oe.Service(), oe.Operation())) |
| 1266 | } |
| 1267 | m.modLog.Error(err.Error()) |
| 1268 | m.CommandCounter.IncrError() |
| 1269 | return |
| 1270 | } |
| 1271 | |
| 1272 | var public string |
| 1273 | for _, instance := range DBInstances { |
| 1274 | if instance.Endpoint != nil { |
| 1275 | name := aws.ToString(instance.DBInstanceIdentifier) |
| 1276 | port := instance.Endpoint.Port |
| 1277 | endpoint := aws.ToString(instance.Endpoint.Address) |
| 1278 | awsService := "RDS" |
| 1279 | |
| 1280 | if aws.ToBool(instance.PubliclyAccessible) { |
| 1281 | public = "True" |
| 1282 | } else { |
| 1283 | public = "False" |
| 1284 | } |
| 1285 | |
| 1286 | dataReceiver <- Endpoint{ |
| 1287 | AWSService: awsService, |
| 1288 | Region: r, |
| 1289 | Name: name, |
| 1290 | Endpoint: endpoint, |
| 1291 | Port: aws.ToInt32(port), |
| 1292 | Protocol: aws.ToString(instance.Engine), |
| 1293 | Public: public, |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | } |
| 1298 | |
| 1299 | } |
| 1300 | |
| 1301 | func (m *EndpointsModule) getRedshiftEndPointsPerRegion(r string, wg *sync.WaitGroup, semaphore chan struct{}, dataReceiver chan Endpoint) { |
| 1302 | defer func() { |
no test coverage detected