tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/SSLCertificateService.java
private void deleteAwsRoleOnCertificateDelete(String certificateName, String token, JsonParser jsonParser,
			JsonObject object) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "deleteAwsRoleOnCertificateDelete")
				.put(LogMessage.MESSAGE,
						String.format("Trying to delete AwsRole On Certificate [%s] delete", certificateName))
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		Map<String, String> awsParams = new HashMap<>();
		if (object.get(SSLCertificateConstants.AWS_ROLES) != null) {
			JsonObject awsObj = ((JsonObject) jsonParser.parse(object.get(SSLCertificateConstants.AWS_ROLES).toString()));
			awsParams = new Gson().fromJson(awsObj.toString(), Map.class);
			if (!awsParams.isEmpty()) {
				for (Map.Entry<String, String> entry : awsParams.entrySet()) {
					Response response = reqProcessor.process("/auth/aws/roles/delete",
							"{\"role\":\"" + entry.getKey() + "\"}", token);
					if (response.getHttpstatus().equals(HttpStatus.NO_CONTENT)) {
						log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
								.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, "deleteAwsRoleOn CertificateDelete")
								.put(LogMessage.MESSAGE,
										String.format("%s, AWS Role is deleted as part of deleting certificate.",
												entry.getKey()))
								.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
					} else {
						log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
								.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, "deleteAwsRoleOnCertificateDelete")
								.put(LogMessage.MESSAGE,
										String.format("%s, AWS Role deletion as part of deleting certificate failed.",
												entry.getKey()))
								.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
					}
				}
			}
		}
	}
/**
	 * Aws role deletion as part of certificate delete
	 *
	 * @param svcAccName
	 * @param acessInfo
	 * @param token
	 */
Aws role deletion as part of certificate delete
@param svcAccName
@param acessInfo
@param token
Aws role deletion as part of certificate delete @param svcAccName @param acessInfo @param token
private void deleteAwsRoleOnCertificateDelete(String certificateName, String token, JsonParser jsonParser,
			JsonObject object) {
		log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
				.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
				.put(LogMessage.ACTION, "deleteAwsRoleOnCertificateDelete")
				.put(LogMessage.MESSAGE,
						String.format("Trying to delete AwsRole On Certificate [%s] delete", certificateName))
				.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build()));
		Map<String, String> awsParams = new HashMap<>();
		if (object.get(SSLCertificateConstants.AWS_ROLES) != null) {
			JsonObject awsObj = ((JsonObject) jsonParser.parse(object.get(SSLCertificateConstants.AWS_ROLES).toString()));
			awsParams = new Gson().fromJson(awsObj.toString(), Map.class);
			if (!awsParams.isEmpty()) {
				for (Map.Entry<String, String> entry : awsParams.entrySet()) {
					Response response = reqProcessor.process("/auth/aws/roles/delete",
							"{\"role\":\"" + entry.getKey() + "\"}", token);
					if (response.getHttpstatus().equals(HttpStatus.NO_CONTENT)) {
						log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
								.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, "deleteAwsRoleOn CertificateDelete")
								.put(LogMessage.MESSAGE,
										String.format("%s, AWS Role is deleted as part of deleting certificate.",
												entry.getKey()))
								.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
					} else {
						log.error(JSONUtil.getJSON(ImmutableMap.<String, String>builder()
								.put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER))
								.put(LogMessage.ACTION, "deleteAwsRoleOnCertificateDelete")
								.put(LogMessage.MESSAGE,
										String.format("%s, AWS Role deletion as part of deleting certificate failed.",
												entry.getKey()))
								.put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL))
								.build()));
					}
				}
			}
		}
	}
private void deleteAwsRoleOnCertificateDelete ( String certificateName , String token , JsonParser jsonParser , JsonObject object ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteAwsRoleOnCertificateDelete" ) . put ( LogMessage . MESSAGE , String . format ( "Trying to delete AwsRole On Certificate [%s] delete" , certificateName ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; Map < String , String > awsParams = new HashMap < > ( ) ; if ( object . get ( SSLCertificateConstants . AWS_ROLES ) != null ) { JsonObject awsObj = ( ( JsonObject ) jsonParser . parse ( object . get ( SSLCertificateConstants . AWS_ROLES ) . toString ( ) ) ) ; awsParams = new Gson ( ) . fromJson ( awsObj . toString ( ) , Map . class ) ; if ( ! awsParams . isEmpty ( ) ) { for ( Map . Entry < String , String > entry : awsParams . entrySet ( ) ) { Response response = reqProcessor . process ( "/auth/aws/roles/delete" , "{\"role\":\"" + entry . getKey ( ) + "\"}" , token ) ; if ( response . getHttpstatus ( ) . equals ( HttpStatus . NO_CONTENT ) ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteAwsRoleOn CertificateDelete" ) . put ( LogMessage . MESSAGE , String . format ( "%s, AWS Role is deleted as part of deleting certificate." , entry . getKey ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } else { log . error ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , "deleteAwsRoleOnCertificateDelete" ) . put ( LogMessage . MESSAGE , String . format ( "%s, AWS Role deletion as part of deleting certificate failed." , entry . getKey ( ) ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; } } } } }
Aws role deletion as part of certificate delete
 @param svcAccName
 @param acessInfo
 @param token
Aws role deletion as part of certificate delete @param svcAccName @param acessInfo @param token