@SuppressWarnings("static-access") @Test public void fetchTrusterdAdvisorsChecksTest() throws Exception { mockStatic(AWSSupportClientBuilder.class); AWSSupport awsSupportClient = PowerMockito.mock(AWSSupport.class); AWSSupportClientBuilder awsSupportClientBuilder = PowerMockito.mock(AWSSupportClientBuilder.class); AWSStaticCredentialsProvider awsStaticCredentialsProvider = PowerMockito.mock(AWSStaticCredentialsProvider.class); PowerMockito.whenNew(AWSStaticCredentialsProvider.class).withAnyArguments().thenReturn(awsStaticCredentialsProvider); when(awsSupportClientBuilder.standard()).thenReturn(awsSupportClientBuilder); when(awsSupportClientBuilder.withCredentials(anyObject())).thenReturn(awsSupportClientBuilder); when(awsSupportClientBuilder.withRegion(anyString())).thenReturn(awsSupportClientBuilder); when(awsSupportClientBuilder.build()).thenReturn(awsSupportClient); DescribeTrustedAdvisorChecksResult describeTrustedAdvisorChecksResult = new DescribeTrustedAdvisorChecksResult(); List<TrustedAdvisorCheckDescription> trstdAdvsrList = new ArrayList<>(); TrustedAdvisorCheckDescription trustedAdvisorCheckDescription = new TrustedAdvisorCheckDescription(); trustedAdvisorCheckDescription.setId("id"); List<String> metadata = new ArrayList<>(); metadata.add("metaData"); trustedAdvisorCheckDescription.setMetadata(metadata); trstdAdvsrList.add(trustedAdvisorCheckDescription); describeTrustedAdvisorChecksResult.setChecks(trstdAdvsrList); when(awsSupportClient.describeTrustedAdvisorChecks(anyObject())).thenReturn(describeTrustedAdvisorChecksResult); DescribeTrustedAdvisorCheckResultResult result = new DescribeTrustedAdvisorCheckResultResult(); TrustedAdvisorCheckResult trustedAdvisorCheckResult = new TrustedAdvisorCheckResult(); trustedAdvisorCheckResult.setStatus("not ok"); List<TrustedAdvisorResourceDetail> flaggedResources = new ArrayList<>(); TrustedAdvisorResourceDetail trustedAdvisorResourceDetail = new TrustedAdvisorResourceDetail(); trustedAdvisorResourceDetail.setResourceId("id"); trustedAdvisorResourceDetail.setMetadata(metadata); flaggedResources.add(trustedAdvisorResourceDetail); trustedAdvisorCheckResult.setFlaggedResources(flaggedResources ); result.setResult(trustedAdvisorCheckResult); when(awsSupportClient.describeTrustedAdvisorCheckResult(anyObject())).thenReturn(result ); when(awsSupportClient.refreshTrustedAdvisorCheck(anyObject())).thenReturn(new RefreshTrustedAdvisorCheckResult()); assertThat(inventoryUtil.fetchTrusterdAdvisorsChecks(new BasicSessionCredentials("awsAccessKey", "awsSecretKey", "sessionToken"), "account","accountName").size(), is(1)); }
public static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ) { Map<String,List<CheckVH>> checkMap = new HashMap<>(); List<CheckVH> checkList = new ArrayList<>(); AWSSupport awsSupportClient = AWSSupportClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-east-1").build(); String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource\" ,\"type\": \"Trusted Advisor Check\"" ; List<String> checkids = new ArrayList<>(); try{ DescribeTrustedAdvisorChecksResult rslt = awsSupportClient.describeTrustedAdvisorChecks(new DescribeTrustedAdvisorChecksRequest().withLanguage("en")); List<TrustedAdvisorCheckDescription> trstdAdvsrList = rslt.getChecks(); for(TrustedAdvisorCheckDescription check : trstdAdvsrList){ try{ checkids.add(check.getId()); DescribeTrustedAdvisorCheckResultResult result = awsSupportClient.describeTrustedAdvisorCheckResult(new DescribeTrustedAdvisorCheckResultRequest().withCheckId(check.getId())); List<String> metadata = check.getMetadata(); if(!"OK".equalsIgnoreCase(result.getResult().getStatus())){ CheckVH checkVH = new CheckVH(check,result.getResult().getStatus()); List<Resource> resources = new ArrayList<>(); checkVH.setResources(resources); if( ("ePs02jT06w".equalsIgnoreCase(check.getId()) || "rSs93HQwa1".equalsIgnoreCase(check.getId())) && !result.getResult().getFlaggedResources().isEmpty() ){ int dataSize = result.getResult().getFlaggedResources().get(0).getMetadata().size() ; if(dataSize == metadata.size()+1 && !metadata.contains("Status")){ metadata.add(0, "Status"); } } result.getResult().getFlaggedResources().forEach( rsrc -> { List<String> data = rsrc.getMetadata(); StringBuilder resounceInfo = new StringBuilder("{"); if(data.size() == metadata.size() ){ for(int i=0;i<metadata.size();i++){ resounceInfo.append("\""+metadata.get(i)+"\":\""+data.get(i)+"\","); } resounceInfo.deleteCharAt(resounceInfo.length()-1); } resounceInfo.append("}"); resources.add(new Resource(check.getId(),rsrc.getResourceId(),rsrc.getStatus(),resounceInfo.toString())); } ); checkList.add(checkVH); } }catch(Exception e){ log.debug("Erro fetching Advisor Check ",e); } } }catch(Exception e){ log.error(expPrefix +", \"cause\":\"" +e.getMessage()+"\"}"); ErrorManageUtil.uploadError(accountId,"","checks",e.getMessage()); } log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Trusted Advisor Check " +checkList.size()); for(String checkId : checkids){ try{ awsSupportClient.refreshTrustedAdvisorCheck(new RefreshTrustedAdvisorCheckRequest().withCheckId(checkId)); }catch(Exception e){ log.info(e.getMessage()); } } if(!checkList.isEmpty()){ checkMap.put(accountId+delimiter+accountName, checkList); } return checkMap; }
InventoryUtil { public static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ) { Map<String,List<CheckVH>> checkMap = new HashMap<>(); List<CheckVH> checkList = new ArrayList<>(); AWSSupport awsSupportClient = AWSSupportClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-east-1").build(); String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource\" ,\"type\": \"Trusted Advisor Check\"" ; List<String> checkids = new ArrayList<>(); try{ DescribeTrustedAdvisorChecksResult rslt = awsSupportClient.describeTrustedAdvisorChecks(new DescribeTrustedAdvisorChecksRequest().withLanguage("en")); List<TrustedAdvisorCheckDescription> trstdAdvsrList = rslt.getChecks(); for(TrustedAdvisorCheckDescription check : trstdAdvsrList){ try{ checkids.add(check.getId()); DescribeTrustedAdvisorCheckResultResult result = awsSupportClient.describeTrustedAdvisorCheckResult(new DescribeTrustedAdvisorCheckResultRequest().withCheckId(check.getId())); List<String> metadata = check.getMetadata(); if(!"OK".equalsIgnoreCase(result.getResult().getStatus())){ CheckVH checkVH = new CheckVH(check,result.getResult().getStatus()); List<Resource> resources = new ArrayList<>(); checkVH.setResources(resources); if( ("ePs02jT06w".equalsIgnoreCase(check.getId()) || "rSs93HQwa1".equalsIgnoreCase(check.getId())) && !result.getResult().getFlaggedResources().isEmpty() ){ int dataSize = result.getResult().getFlaggedResources().get(0).getMetadata().size() ; if(dataSize == metadata.size()+1 && !metadata.contains("Status")){ metadata.add(0, "Status"); } } result.getResult().getFlaggedResources().forEach( rsrc -> { List<String> data = rsrc.getMetadata(); StringBuilder resounceInfo = new StringBuilder("{"); if(data.size() == metadata.size() ){ for(int i=0;i<metadata.size();i++){ resounceInfo.append("\""+metadata.get(i)+"\":\""+data.get(i)+"\","); } resounceInfo.deleteCharAt(resounceInfo.length()-1); } resounceInfo.append("}"); resources.add(new Resource(check.getId(),rsrc.getResourceId(),rsrc.getStatus(),resounceInfo.toString())); } ); checkList.add(checkVH); } }catch(Exception e){ log.debug("Erro fetching Advisor Check ",e); } } }catch(Exception e){ log.error(expPrefix +", \"cause\":\"" +e.getMessage()+"\"}"); ErrorManageUtil.uploadError(accountId,"","checks",e.getMessage()); } log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Trusted Advisor Check " +checkList.size()); for(String checkId : checkids){ try{ awsSupportClient.refreshTrustedAdvisorCheck(new RefreshTrustedAdvisorCheckRequest().withCheckId(checkId)); }catch(Exception e){ log.info(e.getMessage()); } } if(!checkList.isEmpty()){ checkMap.put(accountId+delimiter+accountName, checkList); } return checkMap; } }
InventoryUtil { public static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ) { Map<String,List<CheckVH>> checkMap = new HashMap<>(); List<CheckVH> checkList = new ArrayList<>(); AWSSupport awsSupportClient = AWSSupportClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-east-1").build(); String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource\" ,\"type\": \"Trusted Advisor Check\"" ; List<String> checkids = new ArrayList<>(); try{ DescribeTrustedAdvisorChecksResult rslt = awsSupportClient.describeTrustedAdvisorChecks(new DescribeTrustedAdvisorChecksRequest().withLanguage("en")); List<TrustedAdvisorCheckDescription> trstdAdvsrList = rslt.getChecks(); for(TrustedAdvisorCheckDescription check : trstdAdvsrList){ try{ checkids.add(check.getId()); DescribeTrustedAdvisorCheckResultResult result = awsSupportClient.describeTrustedAdvisorCheckResult(new DescribeTrustedAdvisorCheckResultRequest().withCheckId(check.getId())); List<String> metadata = check.getMetadata(); if(!"OK".equalsIgnoreCase(result.getResult().getStatus())){ CheckVH checkVH = new CheckVH(check,result.getResult().getStatus()); List<Resource> resources = new ArrayList<>(); checkVH.setResources(resources); if( ("ePs02jT06w".equalsIgnoreCase(check.getId()) || "rSs93HQwa1".equalsIgnoreCase(check.getId())) && !result.getResult().getFlaggedResources().isEmpty() ){ int dataSize = result.getResult().getFlaggedResources().get(0).getMetadata().size() ; if(dataSize == metadata.size()+1 && !metadata.contains("Status")){ metadata.add(0, "Status"); } } result.getResult().getFlaggedResources().forEach( rsrc -> { List<String> data = rsrc.getMetadata(); StringBuilder resounceInfo = new StringBuilder("{"); if(data.size() == metadata.size() ){ for(int i=0;i<metadata.size();i++){ resounceInfo.append("\""+metadata.get(i)+"\":\""+data.get(i)+"\","); } resounceInfo.deleteCharAt(resounceInfo.length()-1); } resounceInfo.append("}"); resources.add(new Resource(check.getId(),rsrc.getResourceId(),rsrc.getStatus(),resounceInfo.toString())); } ); checkList.add(checkVH); } }catch(Exception e){ log.debug("Erro fetching Advisor Check ",e); } } }catch(Exception e){ log.error(expPrefix +", \"cause\":\"" +e.getMessage()+"\"}"); ErrorManageUtil.uploadError(accountId,"","checks",e.getMessage()); } log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Trusted Advisor Check " +checkList.size()); for(String checkId : checkids){ try{ awsSupportClient.refreshTrustedAdvisorCheck(new RefreshTrustedAdvisorCheckRequest().withCheckId(checkId)); }catch(Exception e){ log.info(e.getMessage()); } } if(!checkList.isEmpty()){ checkMap.put(accountId+delimiter+accountName, checkList); } return checkMap; } private  InventoryUtil(); }
InventoryUtil { public static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ) { Map<String,List<CheckVH>> checkMap = new HashMap<>(); List<CheckVH> checkList = new ArrayList<>(); AWSSupport awsSupportClient = AWSSupportClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-east-1").build(); String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource\" ,\"type\": \"Trusted Advisor Check\"" ; List<String> checkids = new ArrayList<>(); try{ DescribeTrustedAdvisorChecksResult rslt = awsSupportClient.describeTrustedAdvisorChecks(new DescribeTrustedAdvisorChecksRequest().withLanguage("en")); List<TrustedAdvisorCheckDescription> trstdAdvsrList = rslt.getChecks(); for(TrustedAdvisorCheckDescription check : trstdAdvsrList){ try{ checkids.add(check.getId()); DescribeTrustedAdvisorCheckResultResult result = awsSupportClient.describeTrustedAdvisorCheckResult(new DescribeTrustedAdvisorCheckResultRequest().withCheckId(check.getId())); List<String> metadata = check.getMetadata(); if(!"OK".equalsIgnoreCase(result.getResult().getStatus())){ CheckVH checkVH = new CheckVH(check,result.getResult().getStatus()); List<Resource> resources = new ArrayList<>(); checkVH.setResources(resources); if( ("ePs02jT06w".equalsIgnoreCase(check.getId()) || "rSs93HQwa1".equalsIgnoreCase(check.getId())) && !result.getResult().getFlaggedResources().isEmpty() ){ int dataSize = result.getResult().getFlaggedResources().get(0).getMetadata().size() ; if(dataSize == metadata.size()+1 && !metadata.contains("Status")){ metadata.add(0, "Status"); } } result.getResult().getFlaggedResources().forEach( rsrc -> { List<String> data = rsrc.getMetadata(); StringBuilder resounceInfo = new StringBuilder("{"); if(data.size() == metadata.size() ){ for(int i=0;i<metadata.size();i++){ resounceInfo.append("\""+metadata.get(i)+"\":\""+data.get(i)+"\","); } resounceInfo.deleteCharAt(resounceInfo.length()-1); } resounceInfo.append("}"); resources.add(new Resource(check.getId(),rsrc.getResourceId(),rsrc.getStatus(),resounceInfo.toString())); } ); checkList.add(checkVH); } }catch(Exception e){ log.debug("Erro fetching Advisor Check ",e); } } }catch(Exception e){ log.error(expPrefix +", \"cause\":\"" +e.getMessage()+"\"}"); ErrorManageUtil.uploadError(accountId,"","checks",e.getMessage()); } log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Trusted Advisor Check " +checkList.size()); for(String checkId : checkids){ try{ awsSupportClient.refreshTrustedAdvisorCheck(new RefreshTrustedAdvisorCheckRequest().withCheckId(checkId)); }catch(Exception e){ log.info(e.getMessage()); } } if(!checkList.isEmpty()){ checkMap.put(accountId+delimiter+accountName, checkList); } return checkMap; } private  InventoryUtil(); static Map<String,List<Instance>> fetchInstances(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName,String ec2Filters); static Map<String,List<NetworkInterface>> fetchNetworkIntefaces(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<SecurityGroup>> fetchSecurityGroups(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<AutoScalingGroup>> fetchAsg(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Stack>> fetchCloudFormationStack(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DynamoVH>> fetchDynamoDBTables(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<EfsVH>> fetchEFSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Cluster>> fetchEMRInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<LambdaVH>> fetchLambdaInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<ClassicELBVH>> fetchClassicElbInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<LoadBalancerVH>> fetchElbInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<TargetGroupVH>> fetchTargetGroups(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<NatGateway>> fetchNATGatewayInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DBClusterVH>> fetchRDSClusterInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DBInstanceVH>> fetchRDSInstanceInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<BucketVH>> fetchS3Info(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Subnet>> fetchSubnets(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ); static Map<String,List<RedshiftVH>> fetchRedshiftInfo(BasicSessionCredentials temporaryCredentials,String skipRegions,String accountId,String accountName); static Map<String,List<Volume>> fetchVolumetInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Snapshot>> fetchSnapshots(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); @SuppressWarnings("rawtypes") static Map<String,List<VpcVH>> fetchVpcInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<RestApi>> fetchApiGateways(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<UserVH>> fetchIAMUsers(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<Role>> fetchIAMRoles(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<DBSnapshot>> fetchRDSDBSnapshots(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<KMSKeyVH>> fetchKMSKeys(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<CloudFrontVH>> fetchCloudFrontInfo(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<EbsVH>> fetchEBSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<PhdVH>> fetchPHDInfo(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<SQSVH>> fetchSQSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<SSLCertificateVH>> fetchACMCertficateInfo(BasicSessionCredentials temporaryCredentials, String skipRegions, String account, String accountName); static Map<String,List<IAMCertificateVH>> fetchIAMCertificateInfo(BasicSessionCredentials temporaryCredentials, String skipRegions, String account, String accountName); static Map<String,List<AccountVH>> fetchAccountsInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,
			String account, String accountName); static Map<String,List<GroupVH>> fetchIAMGroups(BasicSessionCredentials temporaryCredentials,String account, String accountName); static Map<String,List<Trail>> fetchCloudTrails(BasicSessionCredentials temporaryCredentials, String skipRegions,String account, String accountName); }
InventoryUtil { public static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ) { Map<String,List<CheckVH>> checkMap = new HashMap<>(); List<CheckVH> checkList = new ArrayList<>(); AWSSupport awsSupportClient = AWSSupportClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion("us-east-1").build(); String expPrefix = InventoryConstants.ERROR_PREFIX_CODE+accountId + "\",\"Message\": \"Exception in fetching info for resource\" ,\"type\": \"Trusted Advisor Check\"" ; List<String> checkids = new ArrayList<>(); try{ DescribeTrustedAdvisorChecksResult rslt = awsSupportClient.describeTrustedAdvisorChecks(new DescribeTrustedAdvisorChecksRequest().withLanguage("en")); List<TrustedAdvisorCheckDescription> trstdAdvsrList = rslt.getChecks(); for(TrustedAdvisorCheckDescription check : trstdAdvsrList){ try{ checkids.add(check.getId()); DescribeTrustedAdvisorCheckResultResult result = awsSupportClient.describeTrustedAdvisorCheckResult(new DescribeTrustedAdvisorCheckResultRequest().withCheckId(check.getId())); List<String> metadata = check.getMetadata(); if(!"OK".equalsIgnoreCase(result.getResult().getStatus())){ CheckVH checkVH = new CheckVH(check,result.getResult().getStatus()); List<Resource> resources = new ArrayList<>(); checkVH.setResources(resources); if( ("ePs02jT06w".equalsIgnoreCase(check.getId()) || "rSs93HQwa1".equalsIgnoreCase(check.getId())) && !result.getResult().getFlaggedResources().isEmpty() ){ int dataSize = result.getResult().getFlaggedResources().get(0).getMetadata().size() ; if(dataSize == metadata.size()+1 && !metadata.contains("Status")){ metadata.add(0, "Status"); } } result.getResult().getFlaggedResources().forEach( rsrc -> { List<String> data = rsrc.getMetadata(); StringBuilder resounceInfo = new StringBuilder("{"); if(data.size() == metadata.size() ){ for(int i=0;i<metadata.size();i++){ resounceInfo.append("\""+metadata.get(i)+"\":\""+data.get(i)+"\","); } resounceInfo.deleteCharAt(resounceInfo.length()-1); } resounceInfo.append("}"); resources.add(new Resource(check.getId(),rsrc.getResourceId(),rsrc.getStatus(),resounceInfo.toString())); } ); checkList.add(checkVH); } }catch(Exception e){ log.debug("Erro fetching Advisor Check ",e); } } }catch(Exception e){ log.error(expPrefix +", \"cause\":\"" +e.getMessage()+"\"}"); ErrorManageUtil.uploadError(accountId,"","checks",e.getMessage()); } log.debug(InventoryConstants.ACCOUNT + accountId + " Type : Trusted Advisor Check " +checkList.size()); for(String checkId : checkids){ try{ awsSupportClient.refreshTrustedAdvisorCheck(new RefreshTrustedAdvisorCheckRequest().withCheckId(checkId)); }catch(Exception e){ log.info(e.getMessage()); } } if(!checkList.isEmpty()){ checkMap.put(accountId+delimiter+accountName, checkList); } return checkMap; } private  InventoryUtil(); static Map<String,List<Instance>> fetchInstances(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName,String ec2Filters); static Map<String,List<NetworkInterface>> fetchNetworkIntefaces(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<SecurityGroup>> fetchSecurityGroups(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<AutoScalingGroup>> fetchAsg(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Stack>> fetchCloudFormationStack(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DynamoVH>> fetchDynamoDBTables(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<EfsVH>> fetchEFSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Cluster>> fetchEMRInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<LambdaVH>> fetchLambdaInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<ClassicELBVH>> fetchClassicElbInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<LoadBalancerVH>> fetchElbInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<TargetGroupVH>> fetchTargetGroups(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<NatGateway>> fetchNATGatewayInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DBClusterVH>> fetchRDSClusterInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<DBInstanceVH>> fetchRDSInstanceInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<BucketVH>> fetchS3Info(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Subnet>> fetchSubnets(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<CheckVH>> fetchTrusterdAdvisorsChecks(BasicSessionCredentials temporaryCredentials,String accountId,String accountName ); static Map<String,List<RedshiftVH>> fetchRedshiftInfo(BasicSessionCredentials temporaryCredentials,String skipRegions,String accountId,String accountName); static Map<String,List<Volume>> fetchVolumetInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<Snapshot>> fetchSnapshots(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); @SuppressWarnings("rawtypes") static Map<String,List<VpcVH>> fetchVpcInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<RestApi>> fetchApiGateways(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<UserVH>> fetchIAMUsers(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<Role>> fetchIAMRoles(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<DBSnapshot>> fetchRDSDBSnapshots(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<KMSKeyVH>> fetchKMSKeys(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<CloudFrontVH>> fetchCloudFrontInfo(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<EbsVH>> fetchEBSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<PhdVH>> fetchPHDInfo(BasicSessionCredentials temporaryCredentials,String accountId,String accountName); static Map<String,List<SQSVH>> fetchSQSInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,String accountId,String accountName); static Map<String,List<SSLCertificateVH>> fetchACMCertficateInfo(BasicSessionCredentials temporaryCredentials, String skipRegions, String account, String accountName); static Map<String,List<IAMCertificateVH>> fetchIAMCertificateInfo(BasicSessionCredentials temporaryCredentials, String skipRegions, String account, String accountName); static Map<String,List<AccountVH>> fetchAccountsInfo(BasicSessionCredentials temporaryCredentials, String skipRegions,
			String account, String accountName); static Map<String,List<GroupVH>> fetchIAMGroups(BasicSessionCredentials temporaryCredentials,String account, String accountName); static Map<String,List<Trail>> fetchCloudTrails(BasicSessionCredentials temporaryCredentials, String skipRegions,String account, String accountName);  }