AWS ASG offhour & onhour policy not working

58 views
Skip to first unread message

Jaswindder Kummar

unread,
Sep 13, 2022, 1:26:41 PM9/13/22
to cloud-custodian
Hi,

I am trying to create the offhour and onhour policy for AWS asg using custodian but it is not filtering any of the ASG with specific tag.

This is the policy I am using:

policies:
  - name: cloud-custodian-asg-offhours
    resource: asg
    filters:
      - type: offhour
        default_tz: utc
        tag: custodian
        opt-out: false
        offhour: 18
    actions:
      - suspend

This is the output:

/usr/local/bin/custodian run --region=us-east-1 --dry-run -c asg.yaml -s logs -v
2022-09-13 16:59:36,264: custodian.commands:DEBUG Loaded file asg.yaml. Contains 1 policies
2022-09-13 16:59:36,395: custodian.output:DEBUG Storing output with <LogFile file://logs/cloud-custodian-asg-offhours/custodian-run.log>
2022-09-13 16:59:36,407: custodian.policy:DEBUG Running policy:cloud-custodian-asg-offhours resource:asg region:us-east-1 c7n:0.9.18
2022-09-13 16:59:36,408: custodian.cache:DEBUG Using cache file /root/.cache/cloud-custodian.cache
2022-09-13 16:59:36,408: custodian.resources.asg:DEBUG Using cached c7n.resources.asg.ASG: 4
2022-09-13 16:59:36,409: custodian.resources.asg:DEBUG Filtered from 4 to 0 asg
2022-09-13 16:59:36,409: custodian.policy:INFO policy:cloud-custodian-asg-offhours resource:asg region:us-east-1 count:0 time:0.00
2022-09-13 16:59:36,410: custodian.output:DEBUG metric:ResourceCount Count:0 policy:cloud-custodian-asg-offhours restype:asg scope:policy
2022-09-13 16:59:36,410: custodian.output:DEBUG metric:ApiCalls Count:0 policy:cloud-custodian-asg-offhours restype:asg

Similar issue is for EC2 instances.

Any kind of support is highly appreciated.

Thanks,
Jas
Reply all
Reply to author
Forward
0 new messages