Creating a Custom Policy

Custom policies can be created to supplement the system-defined policies of DAS. For the actions that can be added to custom policies, see DRS Actions.

You can create custom policies in either of the following ways:

  • Visual editor: Select cloud services, actions, resources, and request conditions. This does not require knowledge of policy syntax.
  • JSON: Edit JSON policies from scratch or based on an existing policy.

For details, Creating a Custom Policy. The following describes examples of common DRS custom policies.

Example Custom Policies

  • Example 1: Allowing users to create DRS instances
    {
    	"Version": "1.1",
    	"Statement": [{
                    "Action": ["drs:instance:create"],
    		"Effect": "Allow"
    	}]
    }
  • Example 2: Denying DRS instance deletion

    A deny policy must be used together with other policies. If the permissions assigned to a user contain both "Allow" and "Deny", the "Deny" permissions take precedence over the "Allow" permissions.

    The following method can be used if you need to assign permissions of the DRS FullAccess policy to a user but you want to prevent the user from deleting DRS instances. Create a custom policy for denying DRS instance deletion, and attach both policies to the group to which the user belongs. Then, the user can perform all operations on DRS instances except deleting DRS instances. The following is an example of the deny policy:

    {
    	"Version": "1.1",
    	"Statement": [{
    		"Action": ["drs:instance:delete"],
    		"Effect": "Deny"
    	}]
    }