tvaultapi/src/main/java/com/tmobile/cso/vault/api/service/IAMServiceAccountsService.java
private void deleteAwsRoleonOnIAMOffboard(String iamSvcAccName, Map<String,String> acessInfo, String token) {
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
                put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
                put(LogMessage.ACTION, IAMServiceAccountConstants.DELETE_AWSROLE_ASSOCIATION).
                put(LogMessage.MESSAGE, String.format ("Trying to delete AwsRole association on offboarding of IAM Service Account [%s]", iamSvcAccName)).
                put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
                build()));
        if(acessInfo!=null){
            Set<String> roles = acessInfo.keySet();
			for (String role : roles) {
				removeAWSRoleAssociationFromIAMSvcAccForOffboard(iamSvcAccName, token, role);
			}
        }
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
                put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
                put(LogMessage.ACTION, IAMServiceAccountConstants.DELETE_AWSROLE_ASSOCIATION).
                put(LogMessage.MESSAGE, "Successfully removed the AwsRole association On IAM Service Account offboarding").
                put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
                build()));
    }
/**
     * AWS role deletion as part of IAM Service account Off-boarding
     * @param iamSvcAccName
     * @param acessInfo
     * @param token
     */
AWS role deletion as part of IAM Service account Off-boarding
@param iamSvcAccName
@param acessInfo
@param token
AWS role deletion as part of IAM Service account Off - boarding @param iamSvcAccName @param acessInfo @param token
private void deleteAwsRoleonOnIAMOffboard(String iamSvcAccName, Map<String,String> acessInfo, String token) {
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
                put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
                put(LogMessage.ACTION, IAMServiceAccountConstants.DELETE_AWSROLE_ASSOCIATION).
                put(LogMessage.MESSAGE, String.format ("Trying to delete AwsRole association on offboarding of IAM Service Account [%s]", iamSvcAccName)).
                put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
                build()));
        if(acessInfo!=null){
            Set<String> roles = acessInfo.keySet();
			for (String role : roles) {
				removeAWSRoleAssociationFromIAMSvcAccForOffboard(iamSvcAccName, token, role);
			}
        }
        log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder().
                put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)).
                put(LogMessage.ACTION, IAMServiceAccountConstants.DELETE_AWSROLE_ASSOCIATION).
                put(LogMessage.MESSAGE, "Successfully removed the AwsRole association On IAM Service Account offboarding").
                put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).
                build()));
    }
private void deleteAwsRoleonOnIAMOffboard ( String iamSvcAccName , Map < String , String > acessInfo , String token ) { log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , IAMServiceAccountConstants . DELETE_AWSROLE_ASSOCIATION ) . put ( LogMessage . MESSAGE , String . format ( "Trying to delete AwsRole association on offboarding of IAM Service Account [%s]" , iamSvcAccName ) ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; if ( acessInfo != null ) { Set < String > roles = acessInfo . keySet ( ) ; for ( String role : roles ) { removeAWSRoleAssociationFromIAMSvcAccForOffboard ( iamSvcAccName , token , role ) ; } } log . debug ( JSONUtil . getJSON ( ImmutableMap . < String , String > builder ( ) . put ( LogMessage . USER , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . USER ) ) . put ( LogMessage . ACTION , IAMServiceAccountConstants . DELETE_AWSROLE_ASSOCIATION ) . put ( LogMessage . MESSAGE , "Successfully removed the AwsRole association On IAM Service Account offboarding" ) . put ( LogMessage . APIURL , ThreadLocalContext . getCurrentMap ( ) . get ( LogMessage . APIURL ) ) . build ( ) ) ) ; }
AWS role deletion as part of IAM Service account Off-boarding
 @param iamSvcAccName
 @param acessInfo
 @param token
AWS role deletion as part of IAM Service account Off - boarding @param iamSvcAccName @param acessInfo @param token