Skip to content

Commit 6786ff0

Browse files
authored
🤖 Merge PR DefinitelyTyped#74602 [@types/cfn-response]: update types by @arturovt
1 parent 0cabbc5 commit 6786ff0

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

types/cfn-response/index.d.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
11
import { CloudFormationCustomResourceEvent, Context } from "aws-lambda";
22

3+
/**
4+
* Response status indicating the custom resource operation succeeded.
5+
*/
36
export const SUCCESS: "SUCCESS";
7+
8+
/**
9+
* Response status indicating the custom resource operation failed.
10+
* CloudFormation will roll back the stack if FAILED is returned during create or update.
11+
*/
412
export const FAILED: "FAILED";
13+
14+
/**
15+
* Union type of the two possible response statuses for a CloudFormation custom resource.
16+
*/
517
export type ResponseStatus = typeof SUCCESS | typeof FAILED;
618

19+
/**
20+
* Sends a response to the CloudFormation pre-signed S3 URL to signal the result
21+
* of a custom resource operation. Must be called in every code path of a Lambda-backed
22+
* custom resource — if not called, the CloudFormation stack will hang until it times out.
23+
*
24+
* Note: this function does not return a Promise. Lambda completion is signaled via
25+
* `context.done()` internally. Do not use `await` with this function.
26+
*
27+
* @param event - The CloudFormation custom resource event containing the ResponseURL,
28+
* StackId, RequestId, and LogicalResourceId.
29+
* @param context - The Lambda context object, used for the log stream name and signaling completion.
30+
* @param responseStatus - Whether the operation succeeded or failed. Use `SUCCESS` or `FAILED`.
31+
* @param responseData - Optional key-value data to return to CloudFormation,
32+
* accessible via `Fn::GetAtt` in the template.
33+
* @param physicalResourceId - The unique identifier of the custom resource.
34+
* Defaults to the Lambda log stream name if not provided.
35+
* WARNING: changing this value on an update will cause CloudFormation to delete the old resource.
36+
*/
737
export function send(
838
event: CloudFormationCustomResourceEvent,
939
context: Context,
1040
responseStatus: ResponseStatus,
11-
responseData?: object,
41+
responseData?: Record<string, unknown>,
1242
physicalResourceId?: string,
13-
noEcho?: boolean,
1443
): void;

types/cfn-response/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"owners": [
1515
{
16-
"name": "Artur Androsovych",
16+
"name": "arturovt",
1717
"githubUsername": "arturovt"
1818
}
1919
]

0 commit comments

Comments
 (0)