create_curation_policy
async
¶
create_curation_policy(
name: ResourceName,
policy_document: PolicyText,
*,
config_overrides: Optional[AsyncContextClientConfig] = None,
client_token: Optional[ClientToken] = None,
description: Optional[UserDefinedString] = None,
auto_reject_after_seconds: Optional[AutoRejectAfterSeconds] = None,
tags: Optional[TagMap] = None,
) -> CreateCurationPolicyResponse
Creates a curation policy, which decides which changes to an agent context are held for review as curation proposals instead of applied automatically. The policy starts as an unpublished draft. The agent contexts associated with it enforce it once CreateCurationPolicyVersion publishes it.
Parameters:
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier that you provide to make the request idempotent. A retry with the same token and the same parameters returns the curation policy that the first request created. If you don't specify one, the AWS SDKs generate one.
-
name(ResourceName) –The name of the curation policy. 3 to 63 characters: it must start with a letter and can contain only ASCII letters, digits, and hyphens.
-
description(Optional[UserDefinedString], default:None) –A description of the curation policy. Up to 1,024 characters, with no control characters.
-
policy_document(PolicyText) –The policy's rules, as a Cedar policy document.
-
auto_reject_after_seconds(Optional[AutoRejectAfterSeconds], default:None) –The number of seconds that a curation proposal held for review under this policy can wait for a decision before it is rejected automatically. Valid range: 86,400 (1 day) to 15,552,000 (180 days). If you omit it, proposals held under this policy are never rejected automatically.
-
tags(Optional[TagMap], default:None) –Tags to add to the curation policy when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with
aws:. To add tags, you also needcontext:TagResourcepermission on the new curation policy. If you specify more than 50 user tags, the request fails withServiceQuotaExceededException, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails withValidationException.
Raises:
-
AccessDeniedException–You don't have sufficient access to perform this operation. Verify that you have permission to perform the operation on the resource.
-
InternalServerException–The request failed because of an internal error. Retry the request.
-
ThrottlingException–The request was denied because it exceeded a request rate quota. Wait, then retry the request.
-
ValidationException–The input fails to satisfy the constraints of the operation. Correct the input before you retry the request.
-
ConflictException–The request conflicts with the current state of the resource. Check the resource's current state before you retry the request.
-
ServiceQuotaExceededException–The request would exceed a service quota. Check the quota that
quotaCodenames, reduce your usage, and then retry the request. -
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create a curation policy The following example creates a curation policy that holds change sets that trace analysis generates for review, and rejects a held proposal after 7 days without a decision.
>>> await client.create_curation_policy(name='hold-trace-analysis-changes', description='Holds changes that trace analysis generates for review before they are applied.', policy_document='forbid (\n principal,\n action == AWS::Context::Action::"PublishChangeSet",\n resource is AWS::Context::ChangeSet\n)\nwhen { resource has generatedBy && resource.generatedBy == AWS::Context::Activity::"TRACE_ANALYSIS" };', auto_reject_after_seconds=604800, tags={'team': 'sales-analytics'})
Source code in docs_src/capo_context/_services/async_context.py
1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 | |