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#
| Resource | Behavior | Use Case |
|---|---|---|
| Static | Captures timestamp once, unchanging | Creation time tracking |
| Offset | Calculates future/past time | Expiration dates |
| Rotating | Changes on schedule | Automatic rotation triggers |
| Sleep | Adds delays | Waiting 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