Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.
To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the IAM User Guide.
Parameters:
Raises:
Source code in docs_src/capo_accessanalyzer/_services/access_analyzer.py
| def create_archive_rule(
self,
analyzer_name: "capo_accessanalyzer.types.analyzer_name.AnalyzerName",
rule_name: "capo_accessanalyzer.types.name.Name",
filter: "capo_accessanalyzer.types.filter_criteria_map.FilterCriteriaMap",
*,
config_overrides: Optional[AccessAnalyzerClientConfig] = None,
client_token: Optional[str] = None,
) -> None:
"""<p>Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.</p> <p>To learn about filter keys that you can use to create an archive rule, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">IAM Access Analyzer filter keys</a> in the <b>IAM User Guide</b>.</p>
Args:
analyzer_name: <p>The name of the created analyzer.</p>
rule_name: <p>The name of the rule to create.</p>
filter: <p>The criteria for the rule.</p>
client_token: <p>A client token.</p>
Raises:
capo_accessanalyzer.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_accessanalyzer.errors.conflict_exception.ConflictException: <p>A conflict exception error.</p>
capo_accessanalyzer.errors.internal_server_exception.InternalServerException: <p>Internal server error.</p>
capo_accessanalyzer.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
capo_accessanalyzer.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Service quote met error.</p>
capo_accessanalyzer.errors.throttling_exception.ThrottlingException: <p>Throttling limit exceeded error.</p>
capo_accessanalyzer.errors.validation_exception.ValidationException: <p>Validation exception error.</p>
capo_accessanalyzer.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_accessanalyzer.types.create_archive_rule_request.CreateArchiveRuleRequest]",
) -> OperationResponse[None]:
import capo_accessanalyzer._operations.access_analyzer.create_archive_rule
output, http_response = (
capo_accessanalyzer._operations.access_analyzer.create_archive_rule.create_archive_rule(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateArchiveRule")
)
input_: capo_accessanalyzer.types.create_archive_rule_request.CreateArchiveRuleRequest = {
"analyzer_name": analyzer_name,
"rule_name": rule_name,
"filter": filter,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|