Skip to content

associate_context_store async

associate_context_store(
    context_store_id: ContextStoreId,
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    transit_gateway_arn: Optional[TransitGatewayArn] = None,
) -> AssociateContextStoreResponse

Associates a transit gateway with a context store. The transit gateway must be registered with the global network of the context store, and can't be associated with more than one context store. The context store must be in the AVAILABLE state.

The association is in the ASSOCIATING state when it's created, and changes to ASSOCIATED when it's complete.

Parameters:

  • context_store_id (ContextStoreId) –

    The ID of the context store.

  • transit_gateway_arn (Optional[TransitGatewayArn], default: None ) –

    The Amazon Resource Name (ARN) of the transit gateway to associate with the context store.

Raises:

Source code in docs_src/capo_networkmanager/_services/async_network_manager.py
async def associate_context_store(
    self,
    context_store_id: "capo_networkmanager.types.context_store_id.ContextStoreId",
    *,
    config_overrides: Optional[AsyncNetworkManagerClientConfig] = None,
    transit_gateway_arn: Optional[
        "capo_networkmanager.types.transit_gateway_arn.TransitGatewayArn"
    ] = None,
) -> "capo_networkmanager.types.associate_context_store_response.AssociateContextStoreResponse":
    """<p>Associates a transit gateway with a context store. The transit gateway must be registered with the global network of the context store, and can't be associated with more than one context store. The context store must be in the <code>AVAILABLE</code> state.</p> <p>The association is in the <code>ASSOCIATING</code> state when it's created, and changes to <code>ASSOCIATED</code> when it's complete.</p>

    Args:
        context_store_id: <p>The ID of the context store.</p>
        transit_gateway_arn: <p>The Amazon Resource Name (ARN) of the transit gateway to associate with the context store.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_networkmanager.types.associate_context_store_request.AssociateContextStoreRequest]",
    ) -> AsyncOperationResponse[
        "capo_networkmanager.types.associate_context_store_response.AssociateContextStoreResponse"
    ]:
        import capo_networkmanager._operations.network_manager.associate_context_store

        (
            output,
            http_response,
        ) = await capo_networkmanager._operations.network_manager.associate_context_store.async_associate_context_store(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateContextStore")
    )
    input_: capo_networkmanager.types.associate_context_store_request.AssociateContextStoreRequest = {
        "context_store_id": context_store_id
    }
    if transit_gateway_arn is not None:
        input_["transit_gateway_arn"] = transit_gateway_arn

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