Allow AWS Access Based on Date and Time

Jan 19, 2022

0

Share this article

{{ }} Substitute variables

Adjust the variable values according to your preference.

Policy Code

1{
2    "Version": "2012-10-17",
3    "Statement": [
4        {
5            "Effect": "Allow",
6            "Action": "{{servicePrefix}}:{{actionName}}",
7            "Resource": "*",
8            "Condition": {
9                "DateGreaterThan": {"aws:CurrentTime": "{{startDate}}"},
10                "DateLessThan": {"aws:CurrentTime": "{{endDate}}"}
11            }
12        }
13    ]
14}
DOC

Specify the action you wish to allow by modifying the servicePrefix and actionName variables. Then choose a start and end date in UTC format.

    img

    Related Policies

    POLICY

    SCP: Prevent users from deleting Amazon VPC flow logs

    This policy prevents principals from deleting EC2 flow logs or CloudWatch log gr...

    Aug 09, 2022

    0
    POLICY

    SCP: Require a tag on specified created resources

    This policy prevents principals from creating certain resource types if the requ...

    Aug 09, 2022

    0
    POLICY

    SCP: Prevent users from disabling Amazon GuardDuty

    This policy prevents principals from disabling GuardDuty or altering its configu...

    Aug 09, 2022

    0
    img

    Join the beta waitlist

    Enter your email to get notified when our product becomes available to try.

    Sign Up for the community

    Create your member profile to get involved with our content, programs, and events.