Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Resolve #1517] Updated the Cloudformation Hook logging message
The Cloudformation hook logging message was bit confusing as it stated the hookmode at the end of the hook log. The log is shown as below for the successful hook execution: 07:17:25 [2024-09-17 01:47:24] - sbox-01/sbucket Bucket AWS::S3::Bucket CREATE_IN_PROGRESS sample::Generic::Megahookblock HOOK_COMPLETE_SUCCEEDED Hook succeeded with message: Hook Successfully completed **FAIL** Even though the hook completed successfully, it mode mentioned at the end of the message is misleading to the end user looking into the logs. As the failure/warn is mentioned in the hook message after the execution, removing the HOOKMODE from this log message. Log when Hook Fails in the FAIL mode 07:17:33 [2024-09-17 01:47:33] - sbox-01/sbucket Bucket AWS::S3::Bucket CREATE_IN_PROGRESS sample::Generic::Megahook HOOK_COMPLETE_FAILED Hook failed with message: Rule [ 07:17:33 [CT.S3.PR.1]: Require an Amazon S3 bucket to have block public access settings configured 07:17:33 [FIX]: The parameters 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', 'RestrictPublicBuckets' must be set to "true" under the bucket-level 'PublicAccessBlockConfiguration'. 07:17:33 ] failed. FAIL 07:17:33 [2024-09-17 01:47:33] - sbox-01/sbucket Bucket AWS::S3::Bucket CREATE_FAILED The following hook(s) failed: [sample::Generic::Megahook] Log when Hook Fails in the WARN mode 13:14:32 [2024-09-12 07:44:32] - sbox-01/sbucket Bucket AWS::S3::Bucket CREATE_IN_PROGRESS sample::Generic::Megahook HOOK_COMPLETE_FAILED Hook failed with message: Rule [ 13:14:32 [CT.S3.PR.1]: Require an Amazon S3 bucket to have block public access settings configured 13:14:32 [FIX]: The parameters 'BlockPublicAcls', 'BlockPublicPolicy', 'IgnorePublicAcls', 'RestrictPublicBuckets' must be set to "true" under the bucket-level 'PublicAccessBlockConfiguration'. 13:14:32 ] failed.. Failure was ignored under WARN mode. WARN 13:14:32 [2024-09-12 07:44:32] - sbox-01/sbucket Bucket AWS::S3::Bucket CREATE_IN_PROGRESS Hook invocations complete. Resource creation initiated Hence removing the HOOKMODE at the end of the hook logging. Have not updated any logic.
- Loading branch information