Skip to content

associate_collector async

associate_collector(
    environment_id: EnvironmentId,
    collector_arn: CollectorArn,
    collector_data_access_role_arn: EnvironmentSourceRoleArn,
    *,
    config_overrides: Optional[AsyncContinuumClientConfig] = None,
    client_token: Optional[AssociationClientToken] = None,
) -> AssociateCollectorOutput

Associates one Collector with this Environment and configures the customer role Continuum uses to authorize access to associated Collector data. The caller must have permission on the Environment and permission to pass the role. Continuum assumes the supplied role and calls GetCollectorDataAccessAuthorization on the requested Collector; only a successful authorization response permits the association. The caller does not need Collector data-access permission. The Environment retains its other Collector associations. Calling again with an existing association is safe and does not create a duplicate.

Parameters:

  • environment_id (EnvironmentId) –

    The unique identifier of the Environment making the association.

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

    Caller-provided token that makes retried association requests idempotent. The first successful request binds the token to the complete Collector ARN, supplied role, and result for at least 24 hours. During that retry window, reusing it with a different request fails with ConflictException. A matching replay still requires the supplied role to have current Collector access. Once authorized, a matching replay returns the stored result without changing association state. Revocation can deny a replay; it does not remove the stored association or its original result.

  • collector_arn (CollectorArn) –

    The ARN of the Collector to associate with this Environment.

  • collector_data_access_role_arn (EnvironmentSourceRoleArn) –

    IAM role in the Environment account that Continuum assumes before authorizing access to associated Collector inventory. Every association, including a same-account association, requires this role. The supplied ARN replaces the Environment's previously stored role. The customer is responsible for granting the role access to every Collector that should contribute data.

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.

  • ResourceNotFoundException –

    The specified resource was not found. Verify that the resource identifier is correct and that the resource exists.

  • 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/async_continuum.py
async def associate_collector(
    self,
    environment_id: "capo_continuum.types.environment_id.EnvironmentId",
    collector_arn: "capo_continuum.types.collector_arn.CollectorArn",
    collector_data_access_role_arn: "capo_continuum.types.environment_source_role_arn.EnvironmentSourceRoleArn",
    *,
    config_overrides: Optional[AsyncContinuumClientConfig] = None,
    client_token: Optional[
        "capo_continuum.types.association_client_token.AssociationClientToken"
    ] = None,
) -> "capo_continuum.types.associate_collector_output.AssociateCollectorOutput":
    """Associates one Collector with this Environment and configures the customer role Continuum uses to authorize access to associated Collector data. The caller must have permission on the Environment and permission to pass the role. Continuum assumes the supplied role and calls GetCollectorDataAccessAuthorization on the requested Collector; only a successful authorization response permits the association. The caller does not need Collector data-access permission. The Environment retains its other Collector associations. Calling again with an existing association is safe and does not create a duplicate.

    Args:
        environment_id: The unique identifier of the Environment making the association.
        client_token: Caller-provided token that makes retried association requests idempotent. The first successful request binds the token to the complete Collector ARN, supplied role, and result for at least 24 hours. During that retry window, reusing it with a different request fails with ConflictException. A matching replay still requires the supplied role to have current Collector access. Once authorized, a matching replay returns the stored result without changing association state. Revocation can deny a replay; it does not remove the stored association or its original result.
        collector_arn: The ARN of the Collector to associate with this Environment.
        collector_data_access_role_arn: IAM role in the Environment account that Continuum assumes before authorizing access to associated Collector inventory. Every association, including a same-account association, requires this role. The supplied ARN replaces the Environment's previously stored role. The customer is responsible for granting the role access to every Collector that should contribute data.

    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.resource_not_found_exception.ResourceNotFoundException: The specified resource was not found. Verify that the resource identifier is correct and that the resource exists.
        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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_continuum.types.associate_collector_input.AssociateCollectorInput]",
    ) -> AsyncOperationResponse[
        "capo_continuum.types.associate_collector_output.AssociateCollectorOutput"
    ]:
        import capo_continuum._operations.continuum_control_plane.associate_collector

        (
            output,
            http_response,
        ) = await capo_continuum._operations.continuum_control_plane.associate_collector.async_associate_collector(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateCollector")
    )
    input_: capo_continuum.types.associate_collector_input.AssociateCollectorInput = {
        "environment_id": environment_id,
        "collector_arn": collector_arn,
        "collector_data_access_role_arn": collector_data_access_role_arn,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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