diff --git a/lib/aws/commands.js b/lib/aws/commands.js index f46c0c054..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 @@ -114,6 +116,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 @@ -218,7 +236,9 @@ const COMMAND_MAP = { listAliases: ListAliasesCommand, listFunctions: ListFunctionsCommand, listLayers: ListLayersCommand, + listLayerVersions: ListLayerVersionsCommand, getLayerVersion: GetLayerVersionCommand, + deleteLayerVersion: DeleteLayerVersionCommand, addPermission: AddPermissionCommand, removePermission: RemovePermissionCommand, }, @@ -234,6 +254,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 }, 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']);