When a template developer deletes a stack that contains custom resources, Resource Orchestration Service (ROS) sends a custom resource request with `RequestType` set to `Delete`. To successfully delete a stack that contains custom resources, the custom resource provider must respond successfully to the delete request.
Request
The delete request contains the following fields:
- RequestType
Set to `Delete`.
- ResponseURL
A presigned Internet URL. The custom resource provider uses this URL to send responses to ROS.
- IntranetResponseURL
A presigned internal network URL that can be used in an Elastic Compute Service (ECS) instance. The custom resource provider uses this URL to send responses to ROS.
- StackId
The ID of the stack that contains the custom resource.
- StackName
The name of the stack that contains the custom resource.
- ResourceOwnerId
The ID of the Alibaba Cloud account that owns the stack.
- CallerId
The ID of the account that performs this stack operation. The account can be an Alibaba Cloud account or a Resource Access Management (RAM) user.
- RegionId
The region where the stack is located.
- RequestId
The unique ID of the request.
- ResourceType
The resource type of the custom resource, as specified by the template developer in the ROS template. The name of the resource type can be up to 68 characters in length and can contain letters, digits, underscores (_), at signs (@), and hyphens (-).
- LogicalResourceId
The name (logical ID) of the custom resource, as specified by the template developer in the ROS template.
- PhysicalResourceId
The unique physical ID that is defined by the custom resource provider.
- ResourceProperties
This field contains the content of the `Parameters` object within the `Properties` section that the template developer specifies. The content is defined by the custom resource provider.
Example:
{
"RequestType" : "Delete",
"RequestId" : "unique id for this delete request",
"ResponseURL" : "pre-signed-url-for-delete-response",
"IntranetResponseURL" : "pre-signed-intranet-url-for-create-response",
"ResourceType" : "Custom::MyCustomResourceType",
"LogicalResourceId" : "name of resource in template",
"PhysicalResourceId" : "custom resource provider-defined physical id",
"StackId" : "stack id",
"StackName" : "stack name",
"ResourceOwnerId": "resource owner id",
"CallerId": "caller id",
"RegionId": "region id",
"ResourceProperties" : {
"key1" : "string",
"key2" : [ "list" ],
"key3" : { "key4" : "map" }
}
} Response
Success
To indicate that the delete operation was successful, the provider's service must send a response to ROS that contains the following fields:
- Status
Must be `SUCCESS`.
- RequestId
The unique ID of the request. This value is copied from the original request.
- LogicalResourceId
The name (logical ID) of the custom resource, as specified by the template developer in the ROS template. This value is copied from the original request.
- StackId
The ID of the stack that contains the custom resource. This value is copied from the original request.
- PhysicalResourceId
A unique identifier for the custom resource. The value can be up to 255 bytes in length. This value must be a non-empty string and must be the same for the same resource in all responses.
Example
{
"Status" : "SUCCESS",
"RequestId" : "unique id for this delete request (copied from request)",
"LogicalResourceId" : "name of resource in template (copied from request)",
"StackId" : "stack id (copied from request)",
"PhysicalResourceId" : "custom resource provider-defined physical id"
}failed
If a delete request fails, the provider's service must send a response to ROS that contains the following fields:
- Status
Must be `FAILED`.
- Reason
The reason for the failed response.
- RequestId
The unique ID of the request. This value is copied from the original request.
- LogicalResourceId
The name (logical ID) of the custom resource, as specified by the template developer in the ROS template. This value is copied from the original request.
- StackId
The ID of the stack that contains the custom resource. This value is copied from the original request.
Example
{
"Status" : "FAILED",
"Reason" : "Required failure reason string",
"RequestId" : "unique id for this delete request (copied from request)",
"LogicalResourceId" : "name of resource in template (copied from request)",
"StackId" : "stack id (copied from request)"
}