Skip to content

create_analyzer async

create_analyzer(
    analyzer_name: AnalyzerName,
    type: Type,
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    archive_rules: Optional[InlineArchiveRulesList] = None,
    tags: Optional[TagsMap] = None,
    client_token: Optional[str] = None,
    configuration: Optional[AnalyzerConfiguration] = None,
) -> CreateAnalyzerResponse

Creates an analyzer for your account.

Parameters:

  • analyzer_name (AnalyzerName) –

    The name of the analyzer to create.

  • type (Type) –

    The type of analyzer to create. You can create only one analyzer per account per Region. You can create up to 5 analyzers per organization per Region.

  • 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.

  • tags (Optional[TagsMap], default: None ) –

    An array of key-value pairs to apply to the analyzer. You can use the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.

    For the tag key, you can specify a value that is 1 to 128 characters in length and cannot be prefixed with aws:.

    For the tag value, you can specify a value that is 0 to 256 characters in length.

  • client_token (Optional[str], default: None ) –

    A client token.

  • configuration (Optional[AnalyzerConfiguration], default: None ) –

    Specifies the configuration of the analyzer. If the analyzer is an unused access analyzer, the specified scope of unused access is used for the configuration. If the analyzer is an internal access analyzer, the specified internal access analysis rules are used for the configuration.

Raises:

Source code in docs_src/capo_accessanalyzer/_services/async_access_analyzer.py
async def create_analyzer(
    self,
    analyzer_name: "capo_accessanalyzer.types.analyzer_name.AnalyzerName",
    type: "capo_accessanalyzer.types.type.Type",
    *,
    config_overrides: Optional[AsyncAccessAnalyzerClientConfig] = None,
    archive_rules: Optional[
        "capo_accessanalyzer.types.inline_archive_rules_list.InlineArchiveRulesList"
    ] = None,
    tags: Optional["capo_accessanalyzer.types.tags_map.TagsMap"] = None,
    client_token: Optional[str] = None,
    configuration: Optional[
        "capo_accessanalyzer.types.analyzer_configuration.AnalyzerConfiguration"
    ] = None,
) -> "capo_accessanalyzer.types.create_analyzer_response.CreateAnalyzerResponse":
    """<p>Creates an analyzer for your account.</p>

    Args:
        analyzer_name: <p>The name of the analyzer to create.</p>
        type: <p>The type of analyzer to create. You can create only one analyzer per account per Region. You can create up to 5 analyzers per organization per Region.</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>
        tags: <p>An array of key-value pairs to apply to the analyzer. You can use the set of Unicode letters, digits, whitespace, <code>_</code>, <code>.</code>, <code>/</code>, <code>=</code>, <code>+</code>, and <code>-</code>.</p> <p>For the tag key, you can specify a value that is 1 to 128 characters in length and cannot be prefixed with <code>aws:</code>.</p> <p>For the tag value, you can specify a value that is 0 to 256 characters in length.</p>
        client_token: <p>A client token.</p>
        configuration: <p>Specifies the configuration of the analyzer. If the analyzer is an unused access analyzer, the specified scope of unused access is used for the configuration. If the analyzer is an internal access analyzer, the specified internal access analysis rules are 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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_accessanalyzer.types.create_analyzer_request.CreateAnalyzerRequest]",
    ) -> AsyncOperationResponse[
        "capo_accessanalyzer.types.create_analyzer_response.CreateAnalyzerResponse"
    ]:
        import capo_accessanalyzer._operations.access_analyzer.create_analyzer

        (
            output,
            http_response,
        ) = await capo_accessanalyzer._operations.access_analyzer.create_analyzer.async_create_analyzer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAnalyzer")
    )
    input_: capo_accessanalyzer.types.create_analyzer_request.CreateAnalyzerRequest = {
        "analyzer_name": analyzer_name,
        "type": type,
    }
    if archive_rules is not None:
        input_["archive_rules"] = archive_rules
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if configuration is not None:
        input_["configuration"] = configuration

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output