Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 2.47 KB

File metadata and controls

60 lines (41 loc) · 2.47 KB

AWS - Create

Creates a new service from a remote or local template.

osls does not include a maintained catalog of built-in template names. Use a local template directory, or a trusted remote Git URL, when creating a service from a template.

Create a service in a new folder using a local template:

osls create \
  --template-path path/to/my/template/folder \
  --path myService

Create a service in a new folder from a remote template:

osls create \
  --template-url https://github.com/<owner>/<repo>/tree/<branch>/<template-directory> \
  --path myService

Options

  • --template-url or -u A remotely hosted template URL. Supports plain Git URLs plus GitHub, GitHub Enterprise, GitLab, Bitbucket, and Bitbucket Server. Required if --template-path is not present.
  • --template-path The local path of your template. Required if --template-url is not present.
  • --path or -p The path where the service should be created.
  • --name or -n The name of the service in serverless.yml. If --path is omitted, osls also uses this as the target directory name.

Examples

Creating a named service in a new directory using a local template

osls create \
  --template-path path/to/my/template/folder \
  --path my-new-service \
  --name my-new-service

This example will copy the template into the my-new-service directory. This directory will be created if not present. osls will not overwrite an existing target directory when --path is used.

Additionally osls will rename the service according to the name you provide. If --path is omitted, osls uses --name as the target directory. If --name is omitted, the service name defaults to the target directory's final path segment.

Creating a named service in a new directory from a remote template

osls create \
  --template-url https://github.com/<owner>/<repo>/tree/<branch>/<template-directory> \
  --path my-new-service \
  --name my-new-service

This will download the template into the my-new-service directory. If --name is provided, the copied template's service name will be renamed to my-new-service. If --name is omitted, the service name defaults to the target directory's final path segment.

When using a local template, if neither --path nor --name is provided, osls will create a new directory named after the local template folder and preserve the template's existing service name.


← All Commands · Docs Home