serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.69k stars 5.74k forks source link

Serverless v4 does not fail CI/CD pipeline on S3 bucket deletion failure #13054

Open coolloic opened 1 month ago

coolloic commented 1 month ago

Issue description

Framework Version:

serverless@4.11.1

Plugin(s):

serverless-python-requirements

CI/CD Environment:

CircleCI


Description

When deploying a Lambda layer using serverless deploy, the CI/CD pipeline continues successfully even if CloudFormation returns a BucketNotEmpty error during the cleanup phase.

This behavior is different from Serverless v3, which would fail the deploy step and terminate the pipeline if it couldn't delete the deployment bucket due to remaining artefacts.

Expected Behavior

Serverless v4 should fail the deployment if:

This ensures visibility of cleanup failure and prevents CI from proceeding under a false-positive status.

Actual Behavior

Image Image

Context

No response

czubocha commented 1 month ago

Hey @coolloic,

Serverless Framework’s cleanup phase doesn’t remove the deployment bucket itself - it only deletes objects from the bucket if there are more than service.provider.deploymentBucketObject.maxPreviousDeploymentArtifacts (default is 5). Could you clarify in what case you're seeing the S3 deployment bucket being removed when running the deploy command?