question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support minutes in mark-for-op actions

See original GitHub issue

Is your feature request related to a problem? Please describe. mark-for-op just supports days and hours. These units are too big for some use cases.

Describe the solution you’d like mark-for-op should also support minutes and maybe the other units supported by datetime.timedelta: seconds, microseconds, milliseconds, and weeks. https://docs.python.org/3/library/datetime.html#datetime.timedelta

Describe alternatives you’ve considered mark-for-op could also accept a float as hours, but this would be more complicated to implement and less reliable.

Additional context

policies:
- name: ec2-mark-stop
  resource: ec2
  filters:
    - type: image-age
      op: ge
      minutes: 90
  actions:
    - type: mark-for-op
      tag: custodian_cleanup
      op: terminate
      minutes: 4

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kapiltcommented, Jul 15, 2020

I’m game to support numbers here in the schema for hours.

1reaction
tjstansellcommented, Jul 15, 2020

oh, that’s curious… I am using it for the asg resource and figured it was all the same. Sure enough, asg is an override of TagDelayedAction and changes the schema from integer to number. We should just change the default TagDelayedAction schema to numbers instead of integers. Up to @kapilt if also adding minutes is reasonable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Common Actions — Cloud Custodian documentation
Real world delay may be several minutes, with worst case into hours[0]. ... 90 actions: - type: mark-for-op tag: custodian_cleanup op: terminate days:...
Read more >
mark-for-op action is not working in cloud custodian
"State.Name": stopped mode: schedule: "rate(15 minutes)" type: periodic role: arn:aws:iam::xxxxxxxxxxxx:role/cloud-custodian-role actions: type: ...
Read more >
cloud-custodian/cloud-custodian - Gitter
Hey, does url property in value_from filter support File format, we need to whitelist accounts from file which ... custodian schema ec2.actions.mark-for-op.
Read more >
C7n Community Meeting Minutes - HackMD
C7n Community Meeting Minutes # May 24th 2022 :::info - **URL:** ... Support Needed; #7240: mark-for-op support for aws.cfn resource ...
Read more >
Cloud Custodian Architecture, Deployment and Policy ...
The Lambda function processes this queue every five minutes, ... Ensure that any policies with mark-for-op actions also filter out resources ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found