AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Delete

Custom resource provider requests with RequestType set to "Delete" are sent when the template developer deletes a stack that contains a custom resource.

Request

Delete requests contain the following fields:

RequestType

Will be "Delete".

RequestId

A unique ID for the request.

ResourceType

The template developer-chosen resource type of the custom resource in the AWS CloudFormation template.

ResponseURL

The response URL identifies a pre-signed Amazon S3 bucket that receives responses from the custom resource provider to AWS CloudFormation.

LogicalResourceId

The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template.

StackId

The Amazon Resource Name (ARN) that identifies the stack containing the custom resource.

PhysicalResourceId

A required custom resource provider-defined physical ID that is unique for that provider.

ResourceProperties

This field contains the contents of the Properties object sent by the template developer. Its contents are defined by the custom resource provider.

Example

{
   "RequestType" : "Delete",
   "RequestId" : "unique id for this delete request",
   "ResponseURL" : "pre-signed-url-for-delete-response",
   "StackId" : "arn:aws:cloudformation:us-east-1:namespace:stack/stack-name/guid",
   "ResourceType" : "Custom::MyCustomResourceType",
   "LogicalResourceId" : "name of resource in template",
   "PhysicalResourceId" : "custom resource provider-defined physical id",
   "ResourceProperties" : {
      "key1" : "string",
      "key2" : [ "list" ],
      "key3" : { "key4" : "map" }
   }
}           

Responses

Success

When the delete request is successful, a response must be sent to the S3 bucket with the following fields:

Status

Must be "SUCCESS".

LogicalResourceId

The template developer-chosen name (logical ID) of the custom resource in the AWS CloudFormation template. This response value should be copied verbatim from the request.

RequestId

A unique ID for the request. This response value should be copied verbatim from the request.

StackId

The Amazon Resource Name (ARN) that identifies the stack containing the custom resource. This response value should be copied verbatim from the request.

PhysicalResourceId

This value should be an identifier unique to the custom resource vendor, and can be up to 1Kb in size.

Example

{
   "Status" : "SUCCESS",
   "LogicalResourceId" : "name of resource in template (copied from request)",
   "RequestId" : "unique id for this delete request (copied from request)",
   "StackId" : "arn:aws:cloudformation:us-east-1:namespace:stack/stack-name/guid (copied from request)",
   "PhysicalResourceId" : "custom resource provider-defined physical id"
}              

Failed

When the delete request fails, a response must be sent to the S3 bucket with the following fields:

Status

Must be "FAILED".

Reason

The reason for the failure.

LogicalResourceId

The LogicalResourceId value copied from the delete request.

RequestId

The RequestId value copied from the delete request.

StackId

The StackId value copied from the delete request.

PhysicalResourceId

A required custom resource provider-defined physical ID that is unique for that provider.

Example

{
"Status" : "FAILED",
"Reason" : "Required failure reason string",
"LogicalResourceId" : "name of resource in template (copied from request)",
"RequestId" : "unique id for this delete request (copied from request)",
"StackId" : "arn:aws:cloudformation:us-east-1:namespace:stack/stack-name/guid (copied from request)",
"PhysicalResourceId" : "custom resource provider-defined physical id"
}