Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix misleading getDesiredResourceTags behavior #366

Open
diaojinggang opened this issue Apr 15, 2021 · 0 comments
Open

Fix misleading getDesiredResourceTags behavior #366

diaojinggang opened this issue Apr 15, 2021 · 0 comments

Comments

@diaojinggang
Copy link

* 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant