All Tools View Categories About Contact Privacy

Time-Based Access Policy Generator

Build an IAM statement restricted to a date/time window (aws:CurrentTime) — either side can be left open-ended.

Runs entirely in your browser — nothing you enter is uploaded. Times are submitted to AWS as UTC (a trailing Z is appended to whatever you pick).
-
start (UTC)
-
end (UTC)
-
structurally valid

  

About Time-Based Access Policy Generator

Restricting when an IAM statement is allowed to apply — not just who or what, but during what window of time — is expressed through a global AWS condition key, aws:CurrentTime, compared against a fixed timestamp using the standard date operators DateGreaterThan and DateLessThan. Time-Based Access Policy Generator builds exactly this condition block from two ordinary datetime pickers, handling the ISO 8601 formatting AWS requires and the open-ended-window case that a hand-written condition often gets wrong.

You pick a start and an end using standard datetime-local inputs — the same native browser date/time picker used across countless forms — and the tool converts each one into the full ISO 8601 timestamp with a trailing Z that aws:CurrentTime expects, pairing the start with DateGreaterThan and the end with DateLessThan. Because either side of the window is frequently meant to be open-ended in practice — "access starts now, no fixed end" or "access must end by this date, no restriction on when it started" — leaving either the start or end field blank simply omits that half of the condition rather than forcing a placeholder timestamp into the JSON; only the entries that actually have a value are assembled into the final Condition block, and leaving both blank produces a statement with no time restriction at all.

One detail worth being explicit about, because it is a common source of confusion with this specific condition key: AWS evaluates aws:CurrentTime in UTC, and this tool's conversion takes the digits you select in the local datetime picker and appends Z to mark them as UTC directly — it does not read or apply your browser's local time zone offset. If you intend the window to line up with a specific wall-clock time in a non-UTC time zone, you need to do that offset conversion yourself before entering the values, the same care you would need with a hand-written aws:CurrentTime condition.

What this condition key genuinely cannot express, and what this tool does not attempt to fake, is a recurring schedule — "every weekday from 9 to 5," for instance. aws:CurrentTime compared with DateGreaterThan/DateLessThan only describes a single absolute start-and-end window; IAM has no native condition operator for day-of-week or time-of-day-only recurrence. A genuinely recurring access window requires an external mechanism outside a static policy document — something that periodically attaches, detaches, or updates the policy on a schedule — which is a different kind of system than a one-time JSON statement can express, and this tool is honest that it only builds the absolute-window form.

Beyond the time window itself, this is a standard statement builder: multi-line actions and resources, an optional Sid, and the same structural validator used across this tool category confirming the assembled document has a recognized Effect, Action, and Resource. The result is a ready-to-use time-scoped Allow statement — built and converted entirely in your browser, with nothing you enter sent anywhere.

Features

  • Native datetime pickers for start and end, converted to the exact ISO 8601 format aws:CurrentTime requires.
  • Real open-ended-window support — leaving either side blank omits only that half of the condition, not a placeholder value.
  • DateGreaterThan / DateLessThan pairing assembled automatically from the two pickers.
  • Multi-line actions and resources.
  • Structural validation of the assembled statement and document.
  • Pretty-printed JSON output with Copy and Download .json.
  • Honest documentation of what this condition key cannot do — no recurring/day-of-week windows.
  • Sample business-hours-window scenario pre-filled.
  • One-click clear.
  • 100% client-side — nothing is uploaded.

How to Use

  1. Pick a start date/time, or leave it blank for no start limit.
  2. Pick an end date/time, or leave it blank for no end limit.
  3. List the actions the time window should govern.
  4. List the resources it applies to.
  5. Optionally set a Sid.
  6. Click Build time-window statement and check the structural validation result.
  7. Copy or download the JSON.

Examples

Example 1 — full business-hours window. Start 2026-08-21T09:00, end 2026-08-21T17:00, actions * — produces both DateGreaterThan and DateLessThan entries for that single day's window.

Example 2 — access starting now, no end. Start filled in, end left blank — only a DateGreaterThan condition is produced.

Example 3 — temporary access expiring by a deadline. Start left blank, end 2026-09-30T23:59 — only a DateLessThan condition is produced, useful for a time-boxed contractor grant.

Example 4 — no time restriction. Both start and end left blank — the statement has no Condition block, equivalent to not using this tool's time feature at all.

Example 5 — a maintenance-window Allow. Start 2026-10-01T02:00, end 2026-10-01T04:00, resources scoped to a specific maintenance-related ARN — grants access only during that two-hour maintenance window.

Benefits

  • Gets the ISO 8601 / UTC timestamp format right automatically, avoiding a malformed aws:CurrentTime value.
  • Correctly supports open-ended windows on either side, instead of forcing a placeholder date.
  • Honest about the UTC/local-time boundary and about the lack of recurring-schedule support.
  • Structural validation before you attach the statement.
  • Copy or download straight into the IAM console, CLI, or IaC.
  • Private — nothing entered ever leaves your browser.

Frequently Asked Questions

What condition key actually enforces the time window?
<code>aws:CurrentTime</code>, a global AWS condition key that evaluates to the current date and time of the request, compared using <code>DateGreaterThan</code> for "no earlier than this start" and <code>DateLessThan</code> for "no later than this end." Both are standard IAM date-comparison operators; this tool assembles them for you from the two datetime pickers.
What time zone does the window use?
The datetime picker captures a local date and time in your browser, and this tool converts it to a full ISO 8601 timestamp with a trailing <code>Z</code>, meaning it is submitted to AWS as UTC. It does <strong>not</strong> apply your browser's time zone offset when building the string — the digits you pick in the local picker become the same digits in the UTC string. Double-check this matches your intent: if you pick 9:00 AM intending your local time zone but need it evaluated as 9:00 AM UTC, adjust the picker values accordingly, since AWS evaluates <code>aws:CurrentTime</code> in UTC.
Can I leave the start or end blank?
Yes — either side of the window can be left empty, producing an open-ended window: leaving the end blank means "starting at this time, with no cutoff," and leaving the start blank means "up until this time, with no beginning limit." Only the condition entries with an actual value are included; a blank field is not rendered as an empty or null condition.
What happens if I leave both blank?
No time restriction is applied at all — the statement has no <code>Condition</code> block, since there is nothing to restrict.
Does this account for recurring windows, like "every weekday 9-5"?
No — <code>aws:CurrentTime</code> with <code>DateGreaterThan</code>/<code>DateLessThan</code> only expresses a single absolute start and end timestamp, not a recurring daily or weekly pattern. AWS IAM does not natively support recurring time-of-day windows through this condition key; a genuinely recurring schedule requires an external mechanism (e.g., a scheduled Lambda that attaches/detaches a policy, or EventBridge Scheduler toggling something) outside what a static IAM condition can express.
Can I combine this with other conditions, like MFA or IP restriction?
Not directly in this tool's output — it produces exactly the DateGreaterThan/DateLessThan condition block. To combine it with, say, an MFA requirement, build both statements separately (this tool and the MFA-Required Policy Condition Generator) and merge their <code>Condition</code> blocks by hand, or use the general IAM Policy Generator, which supports full multi-condition editing on one statement.
Does it validate that the end time is after the start time?
No — this tool builds whatever window you specify. An end time before the start time would produce a condition that can never be satisfied (a real IAM policy footgun), so double-check the two values make sense together before attaching the result.
Is anything I enter sent anywhere?
No — the datetime conversion and statement assembly both happen entirely in your browser.