When the template developer deletes a stack that contains a custom resource, Resource Orchestration Service (ROS) sends a request to the custom resource provider. The RequestType field in the request is set to Delete. To delete the stack, the custom resource provider must send a successful response to the Delete request.
Request
A Delete request contains the following fields:
RequestType
This field is set to Delete.
ResponseURL
The presigned public URL. The URL receives responses from the custom resource provider to ROS.
IntranetResponseURL
The presigned internal URL. You can use this URL in Elastic Compute Service (ECS). The URL receives responses from the custom resource provider 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 to which the stack with the custom resource belongs.
CallerId
The ID of the Alibaba Cloud account or Resource Access Management (RAM) user that is used to perform this operation.
RegionId
The region ID of the stack that contains the custom resource.
RequestId
The unique ID of the request.
ResourceType
The resource type selected by the template developer for the custom resource in the template. The name of the custom 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) selected by the template developer for the custom resource in the template.
PhysicalResourceId
The required physical ID defined by the custom resource provider. The ID is unique to the provider.
ResourceProperties
This field contains the parameters in the Properties section of the request sent by the template developer. 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" }
}
}
Responses
Success
When the Delete request is sent, the custom resource provider must send a response that contains the following fields to ROS:
Status
Only SUCCESS is returned for this field.
RequestId
The unique ID of the request. The response value must be copied from the request.
LogicalResourceId
The name (logical ID) specified by the template developer for the custom resource in the template. This response value must be copied from the request.
StackId
The ID of the stack that contains the custom resource. This response value must be copied from the request.
PhysicalResourceId
This value must be unique to the custom resource provider. The value can be up to 255 bytes in length. The value cannot be an empty string and must be identical 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
When the Delete request fails, the custom resource provider must send a response that contains the following fields to ROS:
Status
Only FAILED is returned for this field.
Reason
The reason for the response failure.
RequestId
The unique ID of the request. The response value must be copied from the request.
LogicalResourceId
The name (logical ID) specified by the template developer for the custom resource in the template. This response value must be copied from the request.
StackId
The ID of the stack that contains the custom resource. This response value must be copied from the 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)"
}