Skip to content

Fix misleading getDesiredResourceTags behavior #366

Open
@diaojinggang

Description

@diaojinggang

* resource. User-defined tags
*
* @param request The request object contains the new set of tags to be applied
* at a Stack level. These will be overridden with any resource-level
* tags which are specified as a direct resource property.
* @return a Map of Tag names to Tag values
*/
@VisibleForTesting
protected Map<String, String> getDesiredResourceTags(final HandlerRequest<ResourceT, CallbackT> request) {
Map<String, String> desiredResourceTags = new HashMap<>();
JSONObject object;
if (request != null && request.getRequestData() != null) {
replaceInMap(desiredResourceTags, request.getRequestData().getStackTags());

Here we claim getDesiredResourceTags return User-defined tags. Intuitively readers would assume it's for user tags only.

However, I have noticed system tags such as aws:cloudformation:stackid is being added in the returned results while testing my CFN stack. Given we already have request.getRequestData().getSystemTags() method for system tags, please consider to either update the code comments explaining why these non User-defined tags are here, or provide another method that will only return user tags to avoid confusions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions