public static List consolidateTags()

in activity/src/main/java/com/amazonaws/stepfunctions/cloudformation/activity/TaggingHelper.java [24:46]


    public static List<Tag> consolidateTags(ResourceHandlerRequest<ResourceModel> request) {
        Map<String, String> systemTags = request.getSystemTags();
        List<TagsEntry> customerTags = request.getDesiredResourceState().getTags();
        Map<String, String> resourceTags = request.getDesiredResourceTags();

        Map<String, String> tags = new HashMap<>();

        if (resourceTags != null) {
            tags.putAll(resourceTags);
        }

        if (systemTags != null) {
            tags.putAll(systemTags);
        }

        if (customerTags != null) {
            for (TagsEntry e : customerTags) {
                tags.put(e.getKey(), e.getValue());
            }
        }

        return tags.entrySet().stream().map(e -> new Tag().withKey(e.getKey()).withValue(e.getValue())).collect(Collectors.toList());
    }