Deleting an Inline Policy
You can delete an inline policy embedded in a user or a group at any time to remove the permissions it grants to this user or group.
Deleting an Inline Policy Using OSC CLI
Deleting an Inline Policy Embedded in a User
See the DeleteUserPolicy command sample in the documentation of the EIM API. |
Deleting an Inline Policy Embedded in a Group
The DeleteUserGroupPolicy command deletes a specified inline policy from a specific group.
$ osc-cli api DeleteUserGroupPolicy --profile "default" \
--PolicyName "example-usergroup-policy" \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
PolicyName
: The name of the policy document you want to delete. -
UserGroupName
: The name of the group. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
).
The DeleteUserGroupPolicy command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Deleting an Inline Policy Using oapi-cli
Deleting an Inline Policy Embedded in a Group
The DeleteUserGroupPolicy command deletes a specified inline policy from a specific group.
$ oapi-cli --profile "default" DeleteUserGroupPolicy \
--PolicyName "example-usergroup-policy" \
--UserGroupName "example-usergroup" \
--UserGroupPath "/example/"
This command contains the following attributes that you need to specify:
-
DryRun
: (optional) If true, checks whether you have the required permissions to perform the action. -
PolicyName
: The name of the policy document you want to delete. -
UserGroupName
: The name of the group. -
UserGroupPath
: (optional) The path to the group. If not specified, it is set to a slash (/
).
The DeleteUserGroupPolicy command returns the following elements:
-
ResponseContext
: Information about the context of the response.-
RequestId
: The ID of the request.
-
{
"ResponseContext": {
"RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
}
}
Deleting an Inline Policy Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
Deleting an Inline Policy Embedded in a User
To delete an inline policy embedded in a user, use the delete-user-policy command following this syntax:
$ aws iam delete-user-policy \
--profile YOUR_PROFILE \
--user-name Jane \
--policy-name DevAccess \
--endpoint https://eim.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
user-name
: The name of the user. -
policy-name
: The name of the policy. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The specified inline policy is deleted and the corresponding permissions are removed for the user.
Deleting an Inline Policy Embedded in a Group
To delete an inline policy embedded in a group, use the delete-group-policy command following this syntax:
$ aws iam delete-group-policy \
--profile YOUR_PROFILE \
--group-name Dev \
--policy-name DevAccess \
--endpoint https://eim.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
-
(optional)
profile
: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI. -
group-name
: The name of the group. -
policy-name
: The name of the policy. -
endpoint
: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.
The specified inline policy is deleted and the corresponding permissions are removed for the users belonging to the group.
Related Pages
Corresponding API Methods
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.