delete_resource
async
¶
delete_resource(
type_name: TypeName,
identifier: Identifier,
*,
config_overrides: Optional[AsyncCloudControlClientConfig] = None,
type_version_id: Optional[TypeVersionId] = None,
role_arn: Optional[RoleArn] = None,
client_token: Optional[ClientToken] = None,
) -> DeleteResourceOutput
Deletes the specified resource. For details, see Deleting a resource in the Amazon Web Services Cloud Control API User Guide.
After you have initiated a resource deletion request, you can monitor the progress of your request by calling GetResourceRequestStatus using the RequestToken of the ProgressEvent returned by DeleteResource.
Parameters:
-
type_name(TypeName) –The name of the resource type.
-
type_version_id(Optional[TypeVersionId], default:None) –For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.
-
role_arn(Optional[RoleArn], default:None) –The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the
handlerssection of the resource type definition schema.If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.
For more information, see Specifying credentials in the Amazon Web Services Cloud Control API User Guide.
-
client_token(Optional[ClientToken], default:None) –A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.
A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
For more information, see Ensuring resource operation requests are unique in the Amazon Web Services Cloud Control API User Guide.
-
identifier(Identifier) –The identifier for the resource.
You can specify the primary identifier, or any secondary identifier defined for the resource type in its resource schema. You can only specify one identifier. Primary identifiers can be specified as a string or JSON; secondary identifiers must be specified as JSON.
For compound primary identifiers (that is, one that consists of multiple resource properties strung together), to specify the primary identifier as a string, list the property values in the order they are specified in the primary identifier definition, separated by
|.For more information, see Identifying resources in the Amazon Web Services Cloud Control API User Guide.
Raises:
-
AlreadyExistsException–The resource with the name requested already exists.
-
ClientTokenConflictException–The specified client token has already been used in another resource request.
It's best practice for client tokens to be unique for each resource operation request. However, client token expire after 36 hours.
-
ConcurrentOperationException–Another resource operation is currently being performed on this resource.
-
GeneralServiceException–The resource handler has returned that the downstream service generated an error that doesn't map to any other handler error code.
-
HandlerFailureException–The resource handler has failed without a returning a more specific error code. This can include timeouts.
-
HandlerInternalFailureException–The resource handler has returned that an unexpected error occurred within the resource handler.
-
InvalidCredentialsException–The resource handler has returned that the credentials provided by the user are invalid.
-
InvalidRequestException–The resource handler has returned that invalid input from the user has generated a generic exception.
-
NetworkFailureException–The resource handler has returned that the request couldn't be completed due to networking issues, such as a failure to receive a response from the server.
-
NotStabilizedException–The resource handler has returned that the downstream resource failed to complete all of its ready-state checks.
-
NotUpdatableException–One or more properties included in this resource operation are defined as create-only, and therefore can't be updated.
-
PrivateTypeException–Cloud Control API hasn't received a valid response from the resource handler, due to a configuration error. This includes issues such as the resource handler returning an invalid response, or timing out.
-
ResourceConflictException–The resource is temporarily unavailable to be acted upon. For example, if the resource is currently undergoing an operation and can't be acted upon until that operation is finished.
-
ResourceNotFoundException–A resource with the specified identifier can't be found.
-
ServiceInternalErrorException–The resource handler has returned that the downstream service returned an internal error, typically with a
5XX HTTPstatus code. -
ServiceLimitExceededException–The resource handler has returned that a non-transient resource limit was reached on the service side.
-
ThrottlingException–The request was denied due to request throttling.
-
TypeNotFoundException–The specified extension doesn't exist in the CloudFormation registry.
-
UnsupportedActionException–The specified resource doesn't support this resource operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_cloudcontrol/_services/async_cloud_control.py
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |