Skip to content

Commit 13b5137

Browse files
committed
Add support to download hook target data for stack-level hooks
Stack level hooks will not be provided with invocation payload information, unlike resource level hooks. Instead, Hooks Service will pass in an S3 presigned URL that points to a file that contains the stack-level invocation payload. The base hook handler (before it reaches the customer's handler code), will use that URL to download the data and set it on the target model that is passed to the customer's handler.
1 parent 2e26056 commit 13b5137

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/software/amazon/cloudformation/HookAbstractWrapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.io.InputStream;
2424
import java.io.OutputStream;
25+
import java.net.URISyntaxException;
2526
import java.net.URL;
2627
import java.nio.charset.StandardCharsets;
2728
import java.time.Instant;
@@ -405,7 +406,7 @@ public Map<String, Object> retrieveHookInvocationPayloadFromS3(final String s3Pr
405406
String str = byteArrayOutputStream.toString(StandardCharsets.UTF_8);
406407

407408
return this.serializer.deserialize(str, hookStackPayloadS3TypeReference);
408-
} catch (Exception exp) {
409+
} catch (RuntimeException | IOException | URISyntaxException exp) {
409410
loggerProxy.log("Failed to retrieve hook invocation payload" + exp.toString());
410411
}
411412
}

0 commit comments

Comments
 (0)