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/shield.py
| def create_subscription(
self, *, config_overrides: Optional[ShieldClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_shield.types.create_subscription_request.CreateSubscriptionRequest]",
) -> OperationResponse[
"capo_shield.types.create_subscription_response.CreateSubscriptionResponse"
]:
import capo_shield._operations.aws_shield_20160616.create_subscription
output, http_response = (
capo_shield._operations.aws_shield_20160616.create_subscription.create_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateSubscription")
)
input_: capo_shield.types.create_subscription_request.CreateSubscriptionRequest = {}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|