Removes one or more resources from an existing subscription.
For subscriptions in the CloudFront plan family, the associated resources must always include exactly one Amazon CloudFront distribution and exactly one WAF web ACL. You cannot remove these required resources.
Parameters:
-
arn
(SubscriptionArn)
–
The ARN of the subscription to remove resources from.
-
resource_arns
(ResourceArns)
–
The ARNs of the resources to remove from the subscription. For subscriptions in the CloudFront plan family, you cannot remove the required CloudFront distribution or WAF web ACL.
-
if_match
(str)
–
The ETag value from a previous GetSubscription or ListSubscriptions response.
-
client_token
(Optional[IdempotencyToken], default:
None
)
–
A unique, case-sensitive identifier that you provide to ensure the request is handled only once.
Raises:
-
AccessDeniedException
–
You do not have the required permissions to perform this operation. Verify that your IAM policy grants access to this action.
-
ConflictException
–
The request conflicts with the current state of the resource. This typically occurs when the ETag value in the If-Match header does not match the current version of the subscription. Retrieve the latest version and retry.
-
InternalServerException
–
An unexpected error occurred on the server. Retry the request.
-
ResourceNotFoundException
–
The specified subscription was not found. Verify that the ARN is correct and that the subscription belongs to your account.
-
ThrottlingException
–
The request rate exceeds the allowed limit. Wait briefly and retry the request.
-
ValidationException
–
The request failed a business rule validation. For example, the specified resource might already be associated with another subscription, or the subscription might not be in the required state for this operation.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Remove a resource from a subscription
>>> client.disassociate_resources_from_subscription(arn='arn:aws:pricingplanmanager::123456789012:subscription/sub-1234567890', resource_arns=['arn:aws:route53:::hostedzone/Z0123456789EXAMPLE'], if_match='2')
Source code in docs_src/capo_pricing_plan_manager/_services/pricing_plan_manager.py
| def disassociate_resources_from_subscription(
self,
arn: "capo_pricing_plan_manager.types.subscription_arn.SubscriptionArn",
resource_arns: "capo_pricing_plan_manager.types.resource_arns.ResourceArns",
if_match: str,
*,
config_overrides: Optional[PricingPlanManagerClientConfig] = None,
client_token: Optional[
"capo_pricing_plan_manager.types.idempotency_token.IdempotencyToken"
] = None,
) -> "capo_pricing_plan_manager.types.disassociate_resources_from_subscription_output.DisassociateResourcesFromSubscriptionOutput":
"""<p>Removes one or more resources from an existing subscription.</p> <note> <p>For subscriptions in the CloudFront plan family, the associated resources must always include exactly one Amazon CloudFront distribution and exactly one WAF web ACL. You cannot remove these required resources.</p> </note>
Args:
arn: <p>The ARN of the subscription to remove resources from.</p>
resource_arns: <p>The ARNs of the resources to remove from the subscription. For subscriptions in the CloudFront plan family, you cannot remove the required CloudFront distribution or WAF web ACL.</p>
if_match: <p>The <code>ETag</code> value from a previous <code>GetSubscription</code> or <code>ListSubscriptions</code> response.</p>
client_token: <p>A unique, case-sensitive identifier that you provide to ensure the request is handled only once.</p>
Raises:
capo_pricing_plan_manager.errors.access_denied_exception.AccessDeniedException: <p>You do not have the required permissions to perform this operation. Verify that your IAM policy grants access to this action.</p>
capo_pricing_plan_manager.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource. This typically occurs when the <code>ETag</code> value in the <code>If-Match</code> header does not match the current version of the subscription. Retrieve the latest version and retry.</p>
capo_pricing_plan_manager.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred on the server. Retry the request.</p>
capo_pricing_plan_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified subscription was not found. Verify that the ARN is correct and that the subscription belongs to your account.</p>
capo_pricing_plan_manager.errors.throttling_exception.ThrottlingException: <p>The request rate exceeds the allowed limit. Wait briefly and retry the request.</p>
capo_pricing_plan_manager.errors.validation_exception.ValidationException: <p>The request failed a business rule validation. For example, the specified resource might already be associated with another subscription, or the subscription might not be in the required state for this operation.</p>
capo_pricing_plan_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Remove a resource from a subscription
>>> client.disassociate_resources_from_subscription(arn='arn:aws:pricingplanmanager::123456789012:subscription/sub-1234567890', resource_arns=['arn:aws:route53:::hostedzone/Z0123456789EXAMPLE'], if_match='2')
"""
def _handler(
req: "OperationRequest[capo_pricing_plan_manager.types.disassociate_resources_from_subscription_input.DisassociateResourcesFromSubscriptionInput]",
) -> OperationResponse[
"capo_pricing_plan_manager.types.disassociate_resources_from_subscription_output.DisassociateResourcesFromSubscriptionOutput"
]:
import capo_pricing_plan_manager._operations.aws_pricing_plan_manager.disassociate_resources_from_subscription
output, http_response = (
capo_pricing_plan_manager._operations.aws_pricing_plan_manager.disassociate_resources_from_subscription.disassociate_resources_from_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DisassociateResourcesFromSubscription")
)
input_: capo_pricing_plan_manager.types.disassociate_resources_from_subscription_input.DisassociateResourcesFromSubscriptionInput = {
"arn": arn,
"resource_arns": resource_arns,
"if_match": if_match,
}
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|