Skip to main content

Static Resource

Capture a static timestamp at resource creation time
2 min read

The time.Static resource captures a timestamp when the resource is created and keeps it unchanged until the resource is recreated.

Example Usage#

Basic Timestamp#

With Triggers#

Resource Tagging#

Argument Reference#

Optional Arguments#

  • rfc3339 (string): Base timestamp in RFC3339 format. Defaults to current time.
  • triggers (map): Arbitrary map that causes new timestamp when values change.

Attribute Reference#

  • day (number): Day of the timestamp (1-31).
  • hour (number): Hour of the timestamp (0-23).
  • id (string): Unique identifier (same as unix timestamp).
  • minute (number): Minute of the timestamp (0-59).
  • month (number): Month of the timestamp (1-12).
  • rfc3339 (string): Timestamp in RFC3339 format.
  • second (number): Second of the timestamp (0-59).
  • unix (number): Unix timestamp (seconds since epoch).
  • year (number): Year of the timestamp.

Use Cases#

Deployment Tracking#

Resource Lifecycle Tracking#

Version Tracking#

Audit Trail#

Configuration Snapshot#

Comparison with Other Time Resources#

ResourceBehaviorUse Case
StaticCaptures timestamp once, unchangingCreation time tracking
OffsetCalculates future/past timeExpiration dates
RotatingChanges on scheduleAutomatic rotation triggers
SleepAdds delaysWaiting for resources

Example: Complete Metadata System#

Best Practices#

Use for Immutable Timestamps#

Combine with Triggers#

Export for Visibility#

Import#

Time static resources cannot be imported as they represent point-in-time captures rather than existing infrastructure.

Notes#

  • Timestamp is captured at resource creation
  • Unchanging unless resource is recreated
  • Use triggers to force new timestamp
  • All times are in UTC
  • Useful for audit trails and metadata