-
Notifications
You must be signed in to change notification settings - Fork 48
Add getPreviousResourceTags method #300
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
Add getPreviousResourceTags method #300
Conversation
Description of changes: This change adds getPreviousResourceTags method which returns previous tags that were applied to a resource. The tags come from previousStackTags and previousResourceDefinedTags By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
LGTM. Let's verify this change with one of the resources e.g. R53 HostedZone. Once we confirm it works (Update handler can get the previousResourceTags), will approve it. |
|
||
if (request != null && request.getRequestData() != null) { | ||
replaceInMap(previousResourceTags, request.getRequestData().getPreviousStackTags()); | ||
replaceInMap(previousResourceTags, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getPreviousResourceProperties()
is null for CREATE/DELETE/READ, and not all provideResourceDefinedTags
handles the null resource model. let's have a null check here.
if (request.getRequestData().getPreviousResourceProperties() != null) {
replaceInMap(previousResourceTags,provideResourceDefinedTags(request.getRequestData().getPreviousResourceProperties()));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with HostedZone resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backward compatibility concern change.
Issue #, if available: #292
Description of changes: This change adds getPreviousResourceTags method which returns previous tags that were applied to a resource. The tags come from previousStackTags and previousResourceDefinedTags
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.