Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions lib/aws/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ const {
RemovePermissionCommand,
ListFunctionsCommand,
ListLayersCommand,
ListLayerVersionsCommand,
DeleteLayerVersionCommand,
} = require('@aws-sdk/client-lambda');

// S3 Commands
Expand All @@ -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
Expand Down Expand Up @@ -218,7 +236,9 @@ const COMMAND_MAP = {
listAliases: ListAliasesCommand,
listFunctions: ListFunctionsCommand,
listLayers: ListLayersCommand,
listLayerVersions: ListLayerVersionsCommand,
getLayerVersion: GetLayerVersionCommand,
deleteLayerVersion: DeleteLayerVersionCommand,
addPermission: AddPermissionCommand,
removePermission: RemovePermissionCommand,
},
Expand All @@ -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
},

Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/aws/deploy/lib/check-for-changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down