@@ -3,12 +3,12 @@ title: Custom Resources description: Utility
3
3
---
4
4
5
5
[ Custom resources] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources.html )
6
- provide a way for [ AWS lambdas ] (
6
+ provide a way for [ AWS Lambda functions ] (
7
7
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources-lambda.html ) to execute
8
8
provisioning logic whenever CloudFormation stacks are created, updated, or deleted. The CloudFormation utility enables
9
- developers to write these lambdas in Java.
9
+ developers to write these Lambda functions in Java.
10
10
11
- The utility provides a base ` AbstractCustomResourceHandler ` class that listens for [ custom resource request events] (
11
+ The utility provides a base ` AbstractCustomResourceHandler ` class which handles [ custom resource request events] (
12
12
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-requests.html ), constructs
13
13
[ custom resource responses] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/crpg-ref-responses.html ) , and
14
14
sends them to the custom resources. Subclasses implement the provisioning logic and configure certain properties of
@@ -43,8 +43,8 @@ To install this utility, add the following dependency to your project.
43
43
Create a new ` AbstractCustomResourceHandler ` subclass and implement the ` create ` , ` update ` , and ` delete ` methods with
44
44
provisioning logic in the appropriate methods(s).
45
45
46
- As an example, if a lambda only needs to provision something when a stack is created, put the provisioning logic
47
- exclusively within the ` create ` method; the other methods can just return ` null ` .
46
+ As an example, if a Lambda function only needs to provision something when a stack is created, put the provisioning
47
+ logic exclusively within the ` create ` method; the other methods can just return ` null ` .
48
48
49
49
``` java hl_lines="8 9 10 11"
50
50
import com.amazonaws.services.lambda.runtime.Context ;
@@ -82,8 +82,8 @@ If provisioning fails, the stack creation/modification/deletion as a whole can b
82
82
When provisioning results in data to be shared with other parts of the stack, include this data within the returned
83
83
` Response ` instance.
84
84
85
- This lambda creates a [ Chime AppInstance] ( https://docs.aws.amazon.com/chime/latest/dg/create-app-instance.html ) and maps
86
- the returned ARN to a "ChimeAppInstanceArn" attribute.
85
+ This Lambda function creates a [ Chime AppInstance] ( https://docs.aws.amazon.com/chime/latest/dg/create-app-instance.html )
86
+ and maps the returned ARN to a "ChimeAppInstanceArn" attribute.
87
87
88
88
``` java hl_lines="11 12 13 14"
89
89
public class ChimeAppInstanceHandler extends AbstractCustomResourceHandler {
@@ -104,8 +104,7 @@ public class ChimeAppInstanceHandler extends AbstractCustomResourceHandler {
104
104
}
105
105
```
106
106
107
- Assuming the method executes successfully, the handler will send a response to the custom resource with a payload that
108
- looks something like the following:
107
+ For the example above the following response payload will be sent.
109
108
110
109
``` json
111
110
{
0 commit comments