Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29250

Custodian policy to stop ec2 at particular time

$
0
0

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?


Viewing all articles
Browse latest Browse all 29250

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>