Deployment

The best way to deploy your app is through the npm run deploy command.

This ensures that:

  1. Infrastructure defined in serverless.yml is deployed to AWS.
  2. Nuxt static site is built.
  3. Nuxt site is pushed to the S3 bucket created in step 1.

deployment-params.yml

The deploy command uses properties defined in deployment-params.yml.

ParameterTypeDescription
EmailEnabledbooleanEnables Email.
ForwardingEmailAddressstringAddress to which to forward inbound emails.
GitHubRepositoryNamestringName of repository running your CI workflow. Used to create GitHub role.
HostedZoneIdstringHosted zone for your Custom domain.
PaymentsEnabledbooleanEnables Payments.
RootDomainstringRoot domain for your Custom domain.
ServiceNamestringPrefix used to name resources created in AWS.
SignInEnabledbooleanEnables Sign in.
SiteNamestringName of your webapp, used in UI and email.
WaitListEnabledbooleanEnables Waitlist.

Advanced deployment commands

For faster feedback, it's helpful to also know the following commands.

  1. sls deploy - deploys infrastructure only.
  2. npm run generate - generates the Nuxt static site.
  3. sls s3sync - pushes the static site to the S3 bucket.

After modifying Lambda function code, quickly deploy the change using sls deploy function -f <function-name>.

Removing all infrastructure

To remove all dev infrastructure resources run sls remove.

Security

Take into account these security best-practices when deploying your webapp.

  • Custom domain - do not launch your webapp without a custom domain (i.e. using the default xxxxxxxxxxxxx.cloudfront.net domain). When you deploy without a custom domain, API calls can come from any * origin. With a custom domain, API calls are restricted to the RootDomain set in deployment-params.yml, which is more secure.
  • GitHub deployment permissions - GitHub assumes the AWS role that is created when you run npm run deployInitial. If you need to add other kinds of AWS resources to serverless.yml, modify the default GitHub role to avoid permissions errors in CI. Add permissions to initial-aws-setup.yml then run npm run deployInitial.