Skip to content

CLI: Deprecate sls deploy -f <function-name> #9312

@medikoo

Description

@medikoo

Use case description

There's a dedicated CLI command deploy function -f <function-name> for single function deployment. Still same can theoretically be achieved via deploy -f <function-name>.

It's problematic alias as both commands accept different options:

  • options: {
    'conceal': {
    usage: 'Hide secrets from the output (e.g. API Gateway key values)',
    type: 'boolean',
    },
    'package': {
    usage: 'Path of the deployment package',
    shortcut: 'p',
    },
    'verbose': {
    usage: 'Show all stack events during deployment',
    shortcut: 'v',
    type: 'boolean',
    },
    'force': {
    usage: 'Forces a deployment to take place',
    type: 'boolean',
    },
    'function': {
    usage: "Function name. Deploys a single function (see 'deploy function')",
    shortcut: 'f',
    },
    'aws-s3-accelerate': {
    usage: 'Enables S3 Transfer Acceleration making uploading artifacts much faster.',
    type: 'boolean',
    },
    },
  • 'function': {
    usage: 'Name of the function',
    shortcut: 'f',
    required: true,
    },
    'force': {
    usage: 'Forces a deployment to take place',
    type: 'boolean',
    },
    'update-config': {
    usage: 'Updates function configuration, e.g. Timeout or Memory Size without deploying code',
    shortcut: 'u',
    type: 'boolean',
    },

Also they're backed with different lifecycle events, therefore there's a wide room for both variants to not behave perfectly same.

Ideally we should drop support for sls deploy -f functioname

Proposed solution

  1. Remove function option from schema of deploy command
  2. Show deprecation if user invokes sls deploy --function. I believe it should be configured in deploy internal plugin, in newly introduced initialize hook

PR's welcome

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions