private static void BuildEnvironmentPage(AWSEnvironment environment) { try { if (!string.IsNullOrEmpty(environment.AccessKeyID) && !string.IsNullOrEmpty(environment.SecretAccessKey)) { foreach (var region in RegionEndpoint.EnumerableAllRegions) { if (string.Equals(region.SystemName, environment.Region)) { var allInstances = new List <AWSInstance>(); var rdsInstances = RDS.GetAllRDSInstances(environment, region); securityGroups = EC2.GetAllSecurityGroups(environment, region); allSubnets = EC2.GetAllAWSSubnets(environment, region); privateSubnets = SplitSubnets(false); publicSubnets = SplitSubnets(true); privateSubnets.Sort((x, y) => string.CompareOrdinal(x.Name, y.Name)); publicSubnets.Sort((x, y) => string.CompareOrdinal(x.Name, y.Name)); var ec2Instances = EC2.GetAllEC2Instances(environment, region); allInstances.AddRange(ec2Instances); allInstances.AddRange(rdsInstances); if (allInstances.Count > 0) { allInstances.Sort((x, y) => string.CompareOrdinal(x.Name, y.Name)); foreach (var server in allInstances) { server.Icon = GetIconFromRole(server.Role); } BuildHTMLPage(environment, region, allInstances); } } } } else { Display.Error("AWS credentials are blank, unable to proceed with " + environment.Name); } } catch (Exception ex) { Logger.Log(LogLevel.Error, ex, "Exception in BuildEnvironmentPage()"); } }