Iam new to custodian and trying to write an offhours policy to stop ec2 instances irrespective of tags. The policy is deployed as lambda and triggered by cloudwatch event(runs every hour).
policies: - name: offhours-policy mode: type: periodic schedule: rate(1 hour) # Run every hour at one minute past the hour role: arn:aws:iam::XXXXX:role/Custodian_role resource: ec2 filters: - type: offhour default_tz: utc # set this to your timezone offhour: 11 # the hour when instances will be shut down actions: - stop
The above mentioned policy is running fine but not stopping the instance. Not sure whats the issue.can somebody say whats the issue, if its timezone or policy related issue?