Creates a service-linked analyzer managed by an Amazon Web Services service. This operation can only be invoked by authorized Amazon Web Services services. Direct customer invocation returns AccessDeniedException.
Service-linked analyzers enable Amazon Web Services services to create and manage analyzers on behalf of customers. The lifecycle of these analyzers is managed by the calling service.
Parameters:
-
type
(Type)
–
The type of analyzer to create. Valid values are ACCOUNT_UNUSED_ACCESS and ORGANIZATION_UNUSED_ACCESS.
-
archive_rules
(Optional[InlineArchiveRulesList], default:
None
)
–
Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.
-
client_token
(Optional[str], default:
None
)
–
-
configuration
(Optional[AnalyzerConfiguration], default:
None
)
–
Specifies the configuration of the analyzer. The specified scope of unused access is used for the configuration.
Raises:
Source code in docs_src/capo_accessanalyzer/_services/access_analyzer.py
| def create_service_linked_analyzer(
self,
type: "capo_accessanalyzer.types.type.Type",
*,
config_overrides: Optional[AccessAnalyzerClientConfig] = None,
archive_rules: Optional[
"capo_accessanalyzer.types.inline_archive_rules_list.InlineArchiveRulesList"
] = None,
client_token: Optional[str] = None,
configuration: Optional[
"capo_accessanalyzer.types.analyzer_configuration.AnalyzerConfiguration"
] = None,
) -> "capo_accessanalyzer.types.create_service_linked_analyzer_response.CreateServiceLinkedAnalyzerResponse":
"""<p>Creates a service-linked analyzer managed by an Amazon Web Services service. This operation can only be invoked by authorized Amazon Web Services services. Direct customer invocation returns <code>AccessDeniedException</code>.</p> <p>Service-linked analyzers enable Amazon Web Services services to create and manage analyzers on behalf of customers. The lifecycle of these analyzers is managed by the calling service.</p>
Args:
type: <p>The type of analyzer to create. Valid values are <code>ACCOUNT_UNUSED_ACCESS</code> and <code>ORGANIZATION_UNUSED_ACCESS</code>.</p>
archive_rules: <p>Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.</p>
client_token: <p>A client token.</p>
configuration: <p>Specifies the configuration of the analyzer. The specified scope of unused access is used for the configuration.</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.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_service_linked_analyzer_request.CreateServiceLinkedAnalyzerRequest]",
) -> OperationResponse[
"capo_accessanalyzer.types.create_service_linked_analyzer_response.CreateServiceLinkedAnalyzerResponse"
]:
import capo_accessanalyzer._operations.access_analyzer.create_service_linked_analyzer
output, http_response = (
capo_accessanalyzer._operations.access_analyzer.create_service_linked_analyzer.create_service_linked_analyzer(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateServiceLinkedAnalyzer")
)
input_: capo_accessanalyzer.types.create_service_linked_analyzer_request.CreateServiceLinkedAnalyzerRequest = {
"type": type
}
if archive_rules is not None:
input_["archive_rules"] = archive_rules
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
if configuration is not None:
input_["configuration"] = configuration
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|