perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

Add @timeout directive that allows users to override resource timeouts #352

Closed beetlebugorg closed 3 years ago

beetlebugorg commented 3 years ago

Currently most provider resources use the Wait class to wait a period of time for a resource to be created, updated, or deleted. Users should be able to override these timeouts in case they notice the defaults are too long or too short or if they know they can be skipped entirely.

Suggested directive syntax:

@timeout 
    action: CREATE
    at-most: 1m
    check-every: 10s
    prompt: true
    skip: true 
@end 

The time values should be provided in ISO_8601 format such as "PT1m" for 1 minute. The shorthand of "1m" should work as well.

This directive should only work inside resource definitions (aka DiffableScope).

action can be CREATE, UPDATE, or DELETE allowing the user to override the different methods with different timeouts.