Setting the Default Version of a Managed Policy
You can choose which policy version you want to apply to the EIM identities (users or groups) the policy is attached to. You can set another policy version as the default one at any time.
Setting the Default Version of a Managed Policy Using OSC CLI
The SetDefaultPolicyVersion command sets a specified version of a managed policy as the default (operative) one.
You can modify the default version of a policy at any time.
$ osc-cli api SetDefaultPolicyVersion --profile "default" \
--PolicyOrn "orn:ows:idauth::012345678910:policy/example/example-user-policy" \
--VersionId "v1"
This command contains the following attributes that you need to specify:
-
PolicyOrn
: The OUTSCALE Resource Name (ORN) of the policy. For more information, see Resource Identifiers. -
VersionId
: The ID of the version.
The SetDefaultPolicyVersion 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"
}
}
Setting the Default Version of a Managed Policy Using oapi-cli
The SetDefaultPolicyVersion command sets a specified version of a managed policy as the default (operative) one.
You can modify the default version of a policy at any time.
$ oapi-cli --profile "default" SetDefaultPolicyVersion \
--PolicyOrn "orn:ows:idauth::012345678910:policy/example/example-user-policy" \
--VersionId "v1"
This command contains the following attributes that you need to specify:
-
PolicyOrn
: The OUTSCALE Resource Name (ORN) of the policy. For more information, see Resource Identifiers. -
VersionId
: The ID of the version.
The SetDefaultPolicyVersion 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"
}
}
Setting the Default Version of a Managed Policy Using AWS CLI
Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI. |
To set the default version of a managed policy, use the set-default-policy-version command following this syntax:
$ aws iam set-default-policy-version \
--profile YOUR_PROFILE \
--policy-arn arn:aws:iam::123456789012:policy/my-policy \
--version-id v2 \
--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. -
policy-arn
: The OUTSCALE Resource Name (ORN) of the policy. -
version-id
: The ID of the policy version you want to set as default. -
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 policy version is set as the default one and is applied to the EIM identities the policy is attached to.
Related Pages
Corresponding API Method
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.