Update Policy
| verifiedpermissions_update_policy | R Documentation |
Modifies a Cedar static policy in the specified policy store¶
Description¶
Modifies a Cedar static policy in the specified policy store. You can
change only certain elements of the
UpdatePolicyDefinition
parameter. You can directly update only static policies. To change a
template-linked policy, you must update the template instead, using
update_policy_template.
-
If policy validation is enabled in the policy store, then updating a static policy causes Verified Permissions to validate the policy against the schema in the policy store. If the updated static policy doesn't pass validation, the operation fails and the update isn't stored.
-
When you edit a static policy, you can change only certain elements of a static policy:
-
The action referenced by the policy.
-
A condition clause, such as when and unless.
You can't change these elements of a static policy:
-
Changing a policy from a static policy to a template-linked policy.
-
Changing the effect of a static policy from permit or forbid.
-
The principal referenced by a static policy.
-
The resource referenced by a static policy.
-
To update a template-linked policy, you must update the template instead.
Verified Permissions is eventually consistent . It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.
Usage¶
verifiedpermissions_update_policy(policyStoreId, policyId, definition,
name)
Arguments¶
policyStoreId |
[required] Specifies the ID of the policy store that contains the policy that you want to update. To specify a policy store, use its ID or alias name. When using an
alias name, prefix it with
To view aliases, use |
policyId |
[required] Specifies the ID of the policy that you want to
update. To find this value, you can use You can use the policy name in place of the policy ID. When using a
name, prefix it with
|
definition |
Specifies the updated policy content that you want to replace on the specified policy. The content must be valid Cedar policy language text. If you don't specify this parameter, the existing policy definition remains unchanged. You can change only the following elements from the policy definition:
You can't change the following elements:
|
name |
Specifies a name for the policy that is unique among all policies
within the policy store. You can use the name in place of the policy ID
in API operations that reference the policy. The name must be prefixed
with If you don't include the name in an update request, the existing name
is unchanged. To remove a name, set it to an empty string
( If you specify a name that is already associated with another policy
in the policy store, you receive a |
Value¶
A list with the following syntax:
list(
policyStoreId = "string",
policyId = "string",
policyType = "STATIC"|"TEMPLATE_LINKED",
principal = list(
entityType = "string",
entityId = "string"
),
resource = list(
entityType = "string",
entityId = "string"
),
actions = list(
list(
actionType = "string",
actionId = "string"
)
),
createdDate = as.POSIXct(
"2015-01-01"
),
lastUpdatedDate = as.POSIXct(
"2015-01-01"
),
effect = "Permit"|"Forbid"
)
Request syntax¶
svc$update_policy(
policyStoreId = "string",
policyId = "string",
definition = list(
static = list(
description = "string",
statement = "string"
)
),
name = "string"
)