Skip to content

shils/terraform-duration-conversions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

An output-only module for converting between units of time, with the intent of producing more readable and less error-prone duration configurations.

Usage

Without this module:

resource "dns_a_record_set" "www" {
  zone = "example.com."
  name = "www"
  addresses = [
    "192.168.0.1"
  ]
  ttl = 43200
}

With this module:

module "durations" {
  source = "github.com/shils/terraform-duration-conversions"
}

resource "dns_a_record_set" "www" {
  zone = "example.com."
  name = "www"
  addresses = [
    "192.168.0.1"
  ]
  ttl = 12 * module.durations.hours_to_seconds
}

Future

This module won't be necessary once one of the following proposals are implemented:

Outputs

Name Description
days_to_hours The number of hours in a day
days_to_millis The number of milliseconds in a day
days_to_minutes The number of minutes in a day
days_to_seconds The number of seconds in a day
hours_to_millis The number of milliseconds in an hour
hours_to_minutes The number of minutes in an hour
hours_to_seconds The number of seconds in an hour
minutes_to_millis The number of milliseconds in a minute
minutes_to_seconds The number of seconds in a minute
seconds_to_millis The number of milliseconds in a second
weeks_to_days The number of days in a week
weeks_to_hours The number of hours in a week
weeks_to_millis The number of milliseconds in a week
weeks_to_minutes The number of minutes in a week
weeks_to_seconds The number of seconds in a week

About

Output-only terraform module for time unit conversions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages