Skip to main content

One post tagged with "poc"

View All Tags

DRAFT POC Time limited Terraform resource implementation

· One min read
Aurelian Shuttleworth
Aurelian Shuttleworth
Site Reliability Engineer

Input design

Timestamps

Terraform has reliable support for RFC3339 2020-02-12T06:36:13Z in order to decrease complexity this will be the only supported timestamp format.

Input variable

In order to allow the user to easily specify the start, end and a resource id a simple Terraform object variable can be made to fit most use cases.

variable "time_resource" {
description = "A map containing time limited resources."
type = map(
object({
start = string
end = string
})
)
default = {}
}

Logic

Utilizing the time_rotating resource is key to making this work, unlike the timestamp() it can be determined during the terraform plan stage.