Skip to content

Commit 6c2ae4c

Browse files
committed
more doc changes
1 parent 0373c1c commit 6c2ae4c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/utilities/custom_resources.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ You should generate a `physicalResourceId` during the `CREATE` operation, CloudF
4949

5050
Here an example of how to implement a Custom Resource using the powertools-cloudformation library:
5151

52-
```java hl_lines="8 9 10 11"
52+
```java hl_lines="10-16 21-27 32-38"
5353
import com.amazonaws.services.lambda.runtime.Context;
5454
import com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent;
5555
import software.amazon.lambda.powertools.cloudformation.AbstractCustomResourceHandler;
@@ -101,7 +101,7 @@ In both of the scenarios, powertools-java will assign the `physicalResourceId` b
101101
- if present, use the `physicalResourceId` provided in the `CloudFormationCustomResourceEvent`
102102
- if it is not present, use the `LogStreamName` from the Lambda context
103103

104-
#### Why does this matter?
104+
#### Why do you need a physicalResourceId?
105105

106106
It is recommended that you always provide a `physicalResourceId` in your response because `physicalResourceId` has a crucial role in the lifecycle of a CloudFormation custom resource.
107107
If the `physicalResourceId` changes between calls from Cloudformation, for instance in response to an `Update` event, Cloudformation [treats the resource update as a replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cfn-customresource.html).
@@ -114,7 +114,7 @@ You customise the responses when you need additional attributes to be shared wit
114114
In the example below, the Lambda function creates a [Chime AppInstance](https://docs.aws.amazon.com/chime/latest/dg/create-app-instance.html)
115115
and maps the returned ARN to a "ChimeAppInstanceArn" attribute.
116116

117-
```java hl_lines="11 12 13 14"
117+
```java hl_lines="12-17"
118118
public class ChimeAppInstanceHandler extends AbstractCustomResourceHandler {
119119
@Override
120120
protected Response create(CloudFormationCustomResourceEvent createEvent, Context context) {
@@ -163,7 +163,7 @@ retrieve the attribute value and make it available to other resources in the sta
163163
If any attributes are sensitive, enable the "noEcho" flag to mask the output of the custom resource when it's retrieved
164164
with the Fn::GetAtt function.
165165

166-
```java hl_lines="6"
166+
```java hl_lines="9"
167167
public class SensitiveDataHandler extends AbstractResourceHandler {
168168
@Override
169169
protected Response create(CloudFormationCustomResourceEvent createEvent, Context context) {
@@ -184,7 +184,7 @@ Although using a `Map` as the Response's value is the most straightforward way t
184184
any arbitrary `java.lang.Object` may be used. By default, these objects are serialized with an internal Jackson
185185
`ObjectMapper`. If the object requires special serialization logic, a custom `ObjectMapper` can be specified.
186186

187-
```java hl_lines="21 22 23 24"
187+
```java hl_lines="14-16 26"
188188
public class CustomSerializationHandler extends AbstractResourceHandler {
189189
/**
190190
* Type representing the custom response Data.

0 commit comments

Comments
 (0)