AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the UpdatePolicy operation.
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 UpdatePolicyTemplate.
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.
Namespace: Amazon.VerifiedPermissions.Model
Assembly: AWSSDK.VerifiedPermissions.dll
Version: 3.x.y.z
public class UpdatePolicyRequest : AmazonVerifiedPermissionsRequest IAmazonWebServiceRequest
The UpdatePolicyRequest type exposes the following members
| Name | Description | |
|---|---|---|
|
UpdatePolicyRequest() |
| Name | Type | Description | |
|---|---|---|---|
|
Definition | Amazon.VerifiedPermissions.Model.UpdatePolicyDefinition |
Gets and sets the property 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 | System.String |
Gets and sets the property 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 |
|
PolicyId | System.String |
Gets and sets the property PolicyId. Specifies the ID of the policy that you want to update. To find this value, you can use ListPolicies.
You can use the policy name in place of the policy ID. When using a name, prefix it
with
|
|
PolicyStoreId | System.String |
Gets and sets the property PolicyStoreId. 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 ListPolicyStoreAliases. |
The following example replaces the definition of the specified static policy with a new one.
var client = new AmazonVerifiedPermissionsClient();
var response = client.BatchGetPolicy(new BatchGetPolicyRequest
{
Requests = new List<BatchGetPolicyInputItem> {
new BatchGetPolicyInputItem {
PolicyId = "PWv5M6d5HePx3gVVLKY1nK",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
},
new BatchGetPolicyInputItem {
PolicyId = "LzFn6KgLWvv4Mbegus35jn",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
},
new BatchGetPolicyInputItem {
PolicyId = "77gLjer8H5o3mvrnMGrSL5",
PolicyStoreId = "ERZeDpRc34dkYZeb6FZRVC"
}
}
});
List<BatchGetPolicyErrorItem> errors = response.Errors;
List<BatchGetPolicyOutputItem> results = response.Results;
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5