Skip to content

Commit 206c883

Browse files
Brianwithay21kddejong
authored andcommitted
Updated initial hook boilerplate code to target a real resource type (aws-cloudformation#188)
1 parent 159c6eb commit 206c883

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/rpdk/python/templates/hook_handlers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@ def pre_update_handler(
6868

6969
# Example:
7070
try:
71-
# A Hook that does not allow a resource's encryption algorithm to be modified
71+
# A Hook that does not allow a S3 bucket's encryption to be modified
7272

7373
# Reading the Resource Hook's target current properties and previous properties
7474
resource_properties = target_model.get("resourceProperties")
7575
previous_properties = target_model.get("previousResourceProperties")
7676

77-
if resource_properties.get("encryptionAlgorithm") != previous_properties.get("encryptionAlgorithm"):
77+
if resource_properties.get("BucketEncryption") != previous_properties.get("BucketEncryption"):
7878
progress.status = OperationStatus.FAILED
79-
progress.message = "Encryption algorithm can not be changed"
79+
progress.message = "Encryption configuration can not be changed"
8080
else:
8181
progress.status = OperationStatus.SUCCESS
8282
except TypeError as e:

0 commit comments

Comments
 (0)