Creating a Policy
Create IAM policies to manage access to OCI resources.
Open the navigation menu and click Identity & Security. Under Identity, click Policies.
A list of the policies in the compartment you're viewing is displayed.
- Click Create Policy.
Enter the following information:
- Name: A unique name for the policy. The name must be unique across all policies in the tenancy. You can't change this later. Avoid entering confidential information.
- Description: A friendly description. You can change this later.
- Compartment: If you want to attach the policy to a compartment other than the one you're viewing, select it from list. Where the policy is attached controls who can later modify or delete it (see Policy Attachment).
Enter the policy statements using the policy builder. Use the basic option if you want to choose from common policy templates, which you can also customize. Select Show manual editor if you already know how to write the statements you need and you want to enter them in a text box.
To use the policy builder basic option:
To use the Show manual editor option:
- Select from the Policy use cases menu to filter the list of policy templates. If you're not sure which use case to choose, you can browse all the templates in the Common policy templates list.
- Select the template that best matches your requirements from the Common policy templates list.
The policy builder displays the description of the chosen policy and lists the policy statements that it includes.
- Select the identity domain that contains the group to which you want to apply this policy.
- Select the group that this policy applies to.
- Select a location. The location is the compartment that this policy grants access to. The compartment you choose here must be either the compartment you chose to attach the policy to in Step 3, or a compartment within the hierarchy of that compartment.
- If you need to modify the policy statements, click Show manual editor.
- Click Show manual editor.
- Enter or edit policy statements by using the format described in Policy Syntax, entering one statement per line.
To add tags to this policy, click Show advanced options.
If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
- If you want to create another policy, select Create another policy.
- Click Create.
Your changes go into effect typically within 10 seconds.