You can use terraform timeadd() function to add two times in terraform. timeadd() adds duration to a timestamp, returning a new timestamp.
Syntax: timeadd(timestamp, duration)
Examples:
1 2 3 4 5 6 7 8 9 10 11 |
## Open terraform console terraform console formatdate("YYYY-MM-DD hh:mm:ss",timeadd("2022-05-13T13:10:10Z", "10s")) ## returns "2022-05-13 13:10:20" timeadd("2022-05-13T13:10:10Z", "10m") ## returns "2022-05-13T13:20:10Z" timeadd("2022-05-13T13:10:10Z", "10h") ## returns "2022-05-13T23:10:10Z" |