Skip to content

Instantly share code, notes, and snippets.

@emibcn
emibcn / time_to_utc.tf
Created April 6, 2023 15:53
Terraform module to change a timestamp's timezone
# This module transforms the time variable into an
# RFC 3339 formated date in UTC timezone
locals {
time_ZZZZZ = formatdate(
"YYYY-MM-DD'T'hh:mm:ssZZZZZ",
var.time)
time_zoneless = formatdate(
"YYYY-MM-DD'T'hh:mm:ss",
var.time)
time_zone_sign = substr(