Skip to content

associate_tracker_consumer

associate_tracker_consumer(
    tracker_name: ResourceName,
    consumer_arn: Arn,
    *,
    config_overrides: Optional[LocationClientConfig] = None,
) -> AssociateTrackerConsumerResponse

Creates an association between a geofence collection and a tracker resource. This allows the tracker resource to communicate location data to the linked geofence collection.

You can associate up to five geofence collections to each tracker resource.

Currently not supported — Cross-account configurations, such as creating associations between a tracker resource in one account and a geofence collection in another account.

Parameters:

  • tracker_name (ResourceName) –

    The name of the tracker resource to be associated with a geofence collection.

  • consumer_arn (Arn) –

    The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all Amazon Web Services.

    • Format example: arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer

Raises:

Source code in docs_src/capo_location/_services/location.py
def associate_tracker_consumer(
    self,
    tracker_name: "capo_location.types.resource_name.ResourceName",
    consumer_arn: "capo_location.types.arn.Arn",
    *,
    config_overrides: Optional[LocationClientConfig] = None,
) -> "capo_location.types.associate_tracker_consumer_response.AssociateTrackerConsumerResponse":
    """<p>Creates an association between a geofence collection and a tracker resource. This allows the tracker resource to communicate location data to the linked geofence collection. </p> <p>You can associate up to five geofence collections to each tracker resource.</p> <note> <p>Currently not supported — Cross-account configurations, such as creating associations between a tracker resource in one account and a geofence collection in another account.</p> </note>

    Args:
        tracker_name: <p>The name of the tracker resource to be associated with a geofence collection.</p>
        consumer_arn: <p>The Amazon Resource Name (ARN) for the geofence collection to be associated to tracker resource. Used when you need to specify a resource across all Amazon Web Services.</p> <ul> <li> <p>Format example: <code>arn:aws:geo:region:account-id:geofence-collection/ExampleGeofenceCollectionConsumer</code> </p> </li> </ul>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.conflict_exception.ConflictException: <p>The request was unsuccessful because of a conflict.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource that you've entered was not found in your AWS account.</p>
        capo_location.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The operation was denied because the request would exceed the maximum <a href="https://docs.aws.amazon.com/location/previous/developerguide/location-quotas.html">quota</a> set for Amazon Location Service.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_location.types.associate_tracker_consumer_request.AssociateTrackerConsumerRequest]",
    ) -> OperationResponse[
        "capo_location.types.associate_tracker_consumer_response.AssociateTrackerConsumerResponse"
    ]:
        import capo_location._operations.location_service.associate_tracker_consumer

        output, http_response = (
            capo_location._operations.location_service.associate_tracker_consumer.associate_tracker_consumer(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateTrackerConsumer")
    )
    input_: capo_location.types.associate_tracker_consumer_request.AssociateTrackerConsumerRequest = {
        "tracker_name": tracker_name,
        "consumer_arn": consumer_arn,
    }

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