From b5dadab9b156b81dcdf7cb0c6de8395177b76fcf Mon Sep 17 00:00:00 2001 From: Kenneth Wong Date: Mon, 10 Nov 2025 07:07:42 +0800 Subject: [PATCH 1/3] fix: adding missing AWS SDK v3 - S3 commands --- lib/aws/commands.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/aws/commands.js b/lib/aws/commands.js index f46c0c054..6f8cf7273 100644 --- a/lib/aws/commands.js +++ b/lib/aws/commands.js @@ -114,6 +114,22 @@ const { HeadBucketCommand, GetBucketNotificationConfigurationCommand, PutBucketNotificationConfigurationCommand, + CreateBucketCommand, + GetBucketEncryptionCommand, + PutBucketEncryptionCommand, + GetBucketVersioningCommand, + GetBucketLoggingCommand, + PutBucketVersioningCommand, + PutBucketLoggingCommand, + GetBucketAccelerateConfigurationCommand, + PutBucketAccelerateConfigurationCommand, + PutBucketPolicyCommand, + GetBucketTaggingCommand, + PutBucketTaggingCommand, + DeleteBucketTaggingCommand, + GetPublicAccessBlockCommand, + PutPublicAccessBlockCommand, + DeletePublicAccessBlockCommand, } = require('@aws-sdk/client-s3'); // SSM Commands @@ -234,6 +250,22 @@ const COMMAND_MAP = { headBucket: HeadBucketCommand, getBucketNotificationConfiguration: GetBucketNotificationConfigurationCommand, putBucketNotificationConfiguration: PutBucketNotificationConfigurationCommand, + createBucket: CreateBucketCommand, + getBucketEncryption: GetBucketEncryptionCommand, + putBucketEncryption: PutBucketEncryptionCommand, + getBucketVersioning: GetBucketVersioningCommand, + getBucketLogging: GetBucketLoggingCommand, + putBucketVersioning: PutBucketVersioningCommand, + putBucketLogging: PutBucketLoggingCommand, + getBucketAccelerateConfiguration: GetBucketAccelerateConfigurationCommand, + putBucketAccelerateConfiguration: PutBucketAccelerateConfigurationCommand, + putBucketPolicy: PutBucketPolicyCommand, + getBucketTagging: GetBucketTaggingCommand, + putBucketTagging: PutBucketTaggingCommand, + deleteBucketTagging: DeleteBucketTaggingCommand, + getPublicAccessBlock: GetPublicAccessBlockCommand, + putPublicAccessBlock: PutPublicAccessBlockCommand, + deletePublicAccessBlock: DeletePublicAccessBlockCommand, // Note: upload is handled separately as it's not a direct API call }, From d02ea0ae7c8319a740e08174e0eb61edb846d8bc Mon Sep 17 00:00:00 2001 From: Kenneth Wong Date: Mon, 10 Nov 2025 07:38:34 +0800 Subject: [PATCH 2/3] fix: adding missing AWS SDK v3 - Lambda commands --- lib/aws/commands.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/aws/commands.js b/lib/aws/commands.js index 6f8cf7273..9e082862e 100644 --- a/lib/aws/commands.js +++ b/lib/aws/commands.js @@ -100,6 +100,8 @@ const { RemovePermissionCommand, ListFunctionsCommand, ListLayersCommand, + ListLayerVersionsCommand, + DeleteLayerVersionCommand, } = require('@aws-sdk/client-lambda'); // S3 Commands @@ -115,21 +117,21 @@ const { GetBucketNotificationConfigurationCommand, PutBucketNotificationConfigurationCommand, CreateBucketCommand, - GetBucketEncryptionCommand, - PutBucketEncryptionCommand, - GetBucketVersioningCommand, - GetBucketLoggingCommand, - PutBucketVersioningCommand, - PutBucketLoggingCommand, - GetBucketAccelerateConfigurationCommand, - PutBucketAccelerateConfigurationCommand, - PutBucketPolicyCommand, - GetBucketTaggingCommand, - PutBucketTaggingCommand, - DeleteBucketTaggingCommand, - GetPublicAccessBlockCommand, - PutPublicAccessBlockCommand, - DeletePublicAccessBlockCommand, + GetBucketEncryptionCommand, + PutBucketEncryptionCommand, + GetBucketVersioningCommand, + GetBucketLoggingCommand, + PutBucketVersioningCommand, + PutBucketLoggingCommand, + GetBucketAccelerateConfigurationCommand, + PutBucketAccelerateConfigurationCommand, + PutBucketPolicyCommand, + GetBucketTaggingCommand, + PutBucketTaggingCommand, + DeleteBucketTaggingCommand, + GetPublicAccessBlockCommand, + PutPublicAccessBlockCommand, + DeletePublicAccessBlockCommand, } = require('@aws-sdk/client-s3'); // SSM Commands @@ -234,7 +236,9 @@ const COMMAND_MAP = { listAliases: ListAliasesCommand, listFunctions: ListFunctionsCommand, listLayers: ListLayersCommand, + listLayerVersions: ListLayerVersionsCommand, getLayerVersion: GetLayerVersionCommand, + deleteLayerVersion: DeleteLayerVersionCommand, addPermission: AddPermissionCommand, removePermission: RemovePermissionCommand, }, From 3d1ad0f8212f692defe31efb38084decc0958180 Mon Sep 17 00:00:00 2001 From: Kenneth Wong Date: Mon, 10 Nov 2025 07:49:20 +0800 Subject: [PATCH 3/3] fix: check if existing deployment bucket is exist but empty --- lib/plugins/aws/deploy/lib/check-for-changes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugins/aws/deploy/lib/check-for-changes.js b/lib/plugins/aws/deploy/lib/check-for-changes.js index f2603dbff..1bb372d25 100644 --- a/lib/plugins/aws/deploy/lib/check-for-changes.js +++ b/lib/plugins/aws/deploy/lib/check-for-changes.js @@ -70,10 +70,10 @@ module.exports = { ); } })(); - const objects = result.Contents.filter(({ Key: key }) => + const objects = result?.Contents?.filter(({ Key: key }) => isDeploymentDirToken(key.split('/')[3]) ); - if (!objects.length) return []; + if (!objects?.length) return []; const ordered = _.orderBy(objects, ['Key'], ['desc']);