You can add prefixes to a policy to limit its scope to objects with key names that start with a specific string. A prefix represents the leading part of an object’s full key name, helping you control which resources the policy applies to.
When adding a prefix to an expiration lifecycle policy, you must first enable at least one action on the policy.
To add a prefix to a policy:
- From the navigation pane, select S3 > Buckets.
- Click a bucket's name or its View button to select it.
- Click the Properties tab.
- Click the edit icon for your selected policy.
- Click Filter objects.
- Click Add Tag.
- In the Prefix field, enter your prefix.
- When finished, click Save.
A message confirms the changes and you are returned to the Expiration Lifecycle page. Your new prefixes appear in the Prefix column of the Rules table.