You can configure the bucket policy to limit the time when objects in a bucket are accessible. In the following example, the access time window is from 2019-03-26T12:00:00Z to 2019-03-26T15:00:00Z.
Parameter |
Value |
---|---|
Policy Mode |
Customized |
Effect |
Allow |
Principal |
|
Resources |
NOTE:
In this example, the policy configures permissions only for resources in the bucket. If you need to configure permissions for the entire bucket (for example, the permission to list objects in the bucket), you need to create another custom bucket policy for the entire bucket. |
Actions |
NOTE:
Selecting all action permissions may cause resources to be deleted. To avoid this risk, you are advised to set the action name to Get*, indicating all read permissions. |
Conditions |
|
Conditions |
|
The preceding two conditions must be configured in the same bucket policy.
During the specified time period, any user can access the specified resources in the bucket. Outside the specified time period, only the bucket owner can access the bucket.