class AwsIamService {

    String handleTemplateReplacements(String template, Map<String, String> replacements) {
        String replacedTemplate = template;
        if (replacedTemplate != null) {
            for (Entry<String, String> replacement : replacements.entrySet()) {
                String replacementValue = replacement.getValue() != null ? replacement.getValue() : "";
                replacedTemplate = replacedTemplate.replace(replacement.getKey(), replacementValue);
            }
        }
        return replacedTemplate;
    }

}