Help with policy to identify stopped instances and tag them / warn owners via e-mail.
I'm trying to develop a policy to identify instances that have been stopped with certain time ranges, and notify users about how long it's been stopped, and ultimately terminate the instance if it's been stopped a long time.
Determining the stopped instances that fall within a certain age range is straightforward. Where I'm having trouble is with the escalation that is to tag / notify (and maybe terminate) the instance.
Using an age range that is expected to identify 2 instances I can see a policy incident is created for 2 resources. When I review the Incident Details I see the expected resources listed, the Action Log only tells me the escalation has completed.
Is there a way I can debug / get log details about what is happening when the escalation is running.
I have tried adding calls to rs_cm.audit_entries.create - but have not been able to locate any output. Can you advise where I should expect to see the output?
I have attached the simple policy, manage-stopped.pt, as reference. Any advice or input you have is appreciated.
Hi @douglaswth ,
Thanks for your response - unfortunately when I examined the Audit Entries for the project / account I was working with I did not see any output related to my activity.
I took some time to come back to this as ideally we would like to use Flexera policies if at all possible - so as a next step I took one of the existing Flexera templates and cut out all the 'fluff' - so I just wanted to add a new tag to an existing instance. No audit entries were recorded and the new tag was not applied to the instance.
I took flexera-policies/cost/rightlink_rightsize/rightlink-rightsize-add-tags.pt as a starting point, and stripped it down as much as possible - so I would just have instances to apply a tag to. Instances were identified to be tagged - but no tags were applied.
Would someone be able to review the attached file and point out what I'm missing?
(Note: I changed the file extension from 'pt' to 'txt' so I could attach it)