Creates the Collector for the caller's account. Provisions an AWS Config service-linked recorder using the caller's federated access session and begins recording infrastructure changes.
Parameters:
-
type
(Optional[CollectorType], default:
None
)
–
Source to collect. Defaults to AWS_COLLECTOR when omitted.
-
kubernetes_cluster_role
(Optional[KubernetesClusterRoleConfiguration], default:
None
)
–
IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
-
client_token
(Optional[CollectorClientToken], default:
None
)
–
Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
Raises:
-
AccessDeniedException
–
The request is not authorized. Verify that your credentials and request signature are valid and that you have permission to perform this action.
-
ConflictException
–
The request could not be completed due to a conflict with the current state of the resource.
-
InternalServerException
–
The request couldn't be processed because of an internal server issue. Try again later. If the problem persists, contact AWS Support.
-
ServiceQuotaExceededException
–
The request would exceed a service quota. Review your quota and request an increase if needed.
-
ThrottlingException
–
The request was denied due to request throttling.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_continuum/_services/continuum.py
| def create_collector(
self,
*,
config_overrides: Optional[ContinuumClientConfig] = None,
type: Optional["capo_continuum.types.collector_type.CollectorType"] = None,
kubernetes_cluster_role: Optional[
"capo_continuum.types.kubernetes_cluster_role_configuration.KubernetesClusterRoleConfiguration"
] = None,
client_token: Optional[
"capo_continuum.types.collector_client_token.CollectorClientToken"
] = None,
) -> "capo_continuum.types.create_collector_output.CreateCollectorOutput":
"""Creates the Collector for the caller's account. Provisions an AWS Config service-linked recorder using the caller's federated access session and begins recording infrastructure changes.
Args:
type: Source to collect. Defaults to AWS_COLLECTOR when omitted.
kubernetes_cluster_role: IAM role configuration used to collect Kubernetes cluster metadata. The authenticated caller must be allowed to pass its exact roleArn to Continuum.
client_token: Caller-provided token that makes retried create requests return the original Collector rather than creating a duplicate.
Raises:
capo_continuum.errors.access_denied_exception.AccessDeniedException: The request is not authorized. Verify that your credentials and request signature are valid and that you have permission to perform this action.
capo_continuum.errors.conflict_exception.ConflictException: The request could not be completed due to a conflict with the current state of the resource.
capo_continuum.errors.internal_server_exception.InternalServerException: The request couldn't be processed because of an internal server issue. Try again later. If the problem persists, contact AWS Support.
capo_continuum.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: The request would exceed a service quota. Review your quota and request an increase if needed.
capo_continuum.errors.throttling_exception.ThrottlingException: The request was denied due to request throttling.
capo_continuum.errors.validation_exception.ValidationException
capo_continuum.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_continuum.types.create_collector_input.CreateCollectorInput]",
) -> OperationResponse[
"capo_continuum.types.create_collector_output.CreateCollectorOutput"
]:
import capo_continuum._operations.continuum_control_plane.create_collector
output, http_response = (
capo_continuum._operations.continuum_control_plane.create_collector.create_collector(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_continuum.types.create_collector_input.CreateCollectorInput",
) -> dict[str, Any]:
import capo_continuum.types.create_collector_input
return capo_continuum.types.create_collector_input.redact_sensitive(input_)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreateCollector", redact_input=_redact_input),
)
input_: capo_continuum.types.create_collector_input.CreateCollectorInput = {}
if type is not None:
input_["type"] = type
if kubernetes_cluster_role is not None:
input_["kubernetes_cluster_role"] = kubernetes_cluster_role
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
|