Skip to content

create_subscription async

create_subscription(
    *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> CreateSubscriptionResponse

Activates Shield Advanced for an account.

For accounts that are members of an Organizations organization, Shield Advanced subscriptions are billed against the organization's payer account, regardless of whether the payer account itself is subscribed.

When you initially create a subscription, your subscription is set to be automatically renewed at the end of the existing subscription period. You can change this by submitting an UpdateSubscription request.

Raises:

  • InternalErrorException –

    Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.

  • ResourceAlreadyExistsException –

    Exception indicating the specified resource already exists. If available, this exception includes details in additional properties.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_shield/_services/async_shield.py
async def create_subscription(
    self, *, config_overrides: Optional[AsyncShieldClientConfig] = None
) -> "capo_shield.types.create_subscription_response.CreateSubscriptionResponse":
    """<p>Activates Shield Advanced for an account.</p> <note> <p>For accounts that are members of an Organizations organization, Shield Advanced subscriptions are billed against the organization's payer account, regardless of whether the payer account itself is subscribed. </p> </note> <p>When you initially create a subscription, your subscription is set to be automatically renewed at the end of the existing subscription period. You can change this by submitting an <code>UpdateSubscription</code> request. </p>

    Raises:
        capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
        capo_shield.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>Exception indicating the specified resource already exists. If available, this exception includes details in additional properties. </p>
        capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_shield.types.create_subscription_request.CreateSubscriptionRequest]",
    ) -> AsyncOperationResponse[
        "capo_shield.types.create_subscription_response.CreateSubscriptionResponse"
    ]:
        import capo_shield._operations.aws_shield_20160616.create_subscription

        (
            output,
            http_response,
        ) = await capo_shield._operations.aws_shield_20160616.create_subscription.async_create_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateSubscription")
    )
    input_: capo_shield.types.create_subscription_request.CreateSubscriptionRequest = {}

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