Creating an Inline Policy
You can create inline policies embedded in a user or a group. Inline policies are then applied to this user or to all the users that are in this group.
Creating an Inline Policy Using OSC CLI
Creating an Inline Policy for a User
See the PutUserPolicy command sample in the documentation of the EIM API. |
Creating an Inline Policy for a Group
See the PutGroupPolicy command sample in the documentation of the EIM API. |
Creating an Inline Policy Using AWS CLI
Creating an Inline Policy for a User
To create a new inline policy associated with a user, use the put-user-policy command following this syntax:
$ aws iam put-user-policy \
--profile YOUR_PROFILE \
--user-name Jane \
--policy-name AdminAccess \
--policy-document file://policy \
--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. -
policy-document
: The policy document, corresponding to a JSON string that contains the policy. For more information, see EIM Reference Information. -
endpoint
: The endpoint corresponding to the Region you want to send the request to.
The new inline policy is created for the specified user.
Creating an Inline Policy for a Group
To create a new inline policy associated with a group, use the put-group-policy command following this syntax:
$ aws iam put-group-policy \
--profile YOUR_PROFILE \
--group-name Admin \
--policy-name AdminAccess \
--policy-document file://policy \
--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. -
policy-document
: The policy document, corresponding to a JSON string that contains the policy. For more information, see EIM Reference Information. -
endpoint
: The endpoint corresponding to the Region you want to send the request to.
The new inline policy is created for the specified 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.