Skip to content

update_connector

update_connector(
    connector_id: NonEmptyString,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    description: Optional[NonEmptyString] = None,
    provider: Optional[CspmProviderUpdateConfiguration] = None,
) -> UpdateConnectorResponse

Updates a CSPM connector's configuration, such as the scope or regions for the connected cloud provider.

Parameters:

Raises:

Examples:

To update a CSPM connector This operation updates the configuration of a CSPM connector.

>>> client.update_connector(connector_id='cspm-a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', description='Updated connector description', provider={'Azure': {'ScopeConfiguration': {'ScopeType': 'SUBSCRIPTION', 'ScopeValues': ['sub-1234-5678-abcd', 'sub-9012-3456-efgh']}, 'AzureRegions': ['eastus', 'westus2', 'northeurope']}})
Source code in docs_src/capo_securityhub/_services/security_hub.py
def update_connector(
    self,
    connector_id: "capo_securityhub.types.non_empty_string.NonEmptyString",
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    description: Optional[
        "capo_securityhub.types.non_empty_string.NonEmptyString"
    ] = None,
    provider: Optional[
        "capo_securityhub.types.cspm_provider_update_configuration.CspmProviderUpdateConfiguration"
    ] = None,
) -> "capo_securityhub.types.update_connector_response.UpdateConnectorResponse":
    """<p>Updates a CSPM connector's configuration, such as the scope or regions for the connected cloud provider.</p>

    Args:
        connector_id: <p>The unique identifier of the connector to update.</p>
        description: <p>The updated description of the connector.</p>
        provider: <p>The updated cloud provider configuration for the connector.</p>

    Raises:
        capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
        capo_securityhub.errors.conflict_exception.ConflictException: <p>The request causes conflict with the current state of the service resource.</p>
        capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
        capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To update a CSPM connector
        This operation updates the configuration of a CSPM connector.

        >>> client.update_connector(connector_id='cspm-a1b2c3d4-5678-90ab-cdef-EXAMPLE11111', description='Updated connector description', provider={'Azure': {'ScopeConfiguration': {'ScopeType': 'SUBSCRIPTION', 'ScopeValues': ['sub-1234-5678-abcd', 'sub-9012-3456-efgh']}, 'AzureRegions': ['eastus', 'westus2', 'northeurope']}})
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.update_connector_request.UpdateConnectorRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.update_connector_response.UpdateConnectorResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.update_connector

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.update_connector.update_connector(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateConnector")
    )
    input_: capo_securityhub.types.update_connector_request.UpdateConnectorRequest = {
        "connector_id": connector_id
    }
    if description is not None:
        input_["description"] = description
    if provider is not None:
        input_["provider"] = provider

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output