Skip to content

Outputs logging twice in certain scenarios #68

@mikesouza

Description

@mikesouza

Version Info

Serverless: 2.x.x
Plugin: 1.5.2

Reproduction steps:

Run commands:

serverless deploy

Output:

Serverless: Creating deployment bucket 'some-bucket-blahblah'...
Serverless: Applied SSE (AES256) to deployment bucket
Serverless: Enabled acceleration on deployment bucket
Serverless: Applied deployment bucket policy
Serverless: Updated deployment bucket tags
Serverless: Updated deployment bucket public access block
Serverless: Packaging service...
Serverless: Using deployment bucket 'some-bucket-blahblah'
Serverless: Applied deployment bucket policy
Serverless: Updated deployment bucket public access block
Serverless: Ensuring that deployment bucket exists
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Validating template...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...

Explanation

The hook before:aws:common:validate:validate is unnecessary run twice by a serverless deploy (no --package option), first for packaging and then for deploying, which results in extraneous logging of Applied deployment bucket policy and Updated deployment bucket public access block. This bug was introduced in the fix for #20.

Proposed Fix

A few options to investigate:

  • Use a different hook for serverless deploy --package vs serverless deploy
  • Add smarter diffing logic to determine changes for bucket policy and public access block
  • Investigate using the hook before:deploy:deploy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions