serverless-components / Website

Licence: other
⚡️ Instantly deploy static website on serverless infrastructure with zero configuration using Serverless Components.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Website

Json Serverless
Transform a JSON file into a serverless REST API in AWS cloud
Stars: ✭ 108 (-8.47%)
Mutual labels:  aws, serverless, deployment
S3 Sync Action
🔄 GitHub Action to sync a directory with a remote S3 bucket 🧺
Stars: ✭ 497 (+321.19%)
Mutual labels:  aws, s3, deployment
Vue Cli Plugin S3 Deploy
A vue-cli plugin that uploads your built Vue.js project to an S3 bucket
Stars: ✭ 304 (+157.63%)
Mutual labels:  aws, s3, deployment
Scar
Deploy static websites in seconds - with HTTPS, a global CDN, and custom domains.
Stars: ✭ 1,715 (+1353.39%)
Mutual labels:  aws, serverless, s3
Aws Testing Library
Chai (https://chaijs.com) and Jest (https://jestjs.io/) assertions for testing services built with aws
Stars: ✭ 52 (-55.93%)
Mutual labels:  aws, serverless, s3
Aws Mobile React Native Starter
AWS Mobile React Native Starter App https://aws.amazon.com/mobile
Stars: ✭ 2,247 (+1804.24%)
Mutual labels:  aws, serverless, s3
Discharge
⚡️ A simple, easy way to deploy static websites to Amazon S3.
Stars: ✭ 483 (+309.32%)
Mutual labels:  aws, s3, deployment
Cartoonify
Deploy and scale serverless machine learning app - in 4 steps.
Stars: ✭ 157 (+33.05%)
Mutual labels:  aws, serverless, deployment
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-77.12%)
Mutual labels:  aws, serverless, s3
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+597.46%)
Mutual labels:  aws, serverless, s3
Serverless Architectures Aws
The code repository for the Serverless Architectures on AWS book
Stars: ✭ 120 (+1.69%)
Mutual labels:  aws, serverless, s3
Historical
A serverless, event-driven AWS configuration collection service with configuration versioning.
Stars: ✭ 85 (-27.97%)
Mutual labels:  aws, serverless, s3
Nodb
NoDB isn't a database.. but it sort of looks like one.
Stars: ✭ 353 (+199.15%)
Mutual labels:  aws, serverless, s3
Aws Mobile React Sample
A React Starter App that displays how web developers can integrate their front end with AWS on the backend. The App interacts with AWS Cognito, API Gateway, Lambda and DynamoDB on the backend.
Stars: ✭ 650 (+450.85%)
Mutual labels:  aws, serverless, s3
Up
Up focuses on deploying "vanilla" HTTP servers so there's nothing new to learn, just develop with your favorite existing frameworks such as Express, Koa, Django, Golang net/http or others.
Stars: ✭ 8,439 (+7051.69%)
Mutual labels:  aws, serverless, deployment
Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+8285.59%)
Mutual labels:  aws, serverless, s3
S3transfer
Amazon S3 Transfer Manager for Python
Stars: ✭ 108 (-8.47%)
Mutual labels:  aws, s3
Serverless
⚡ Serverless Framework – Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more! –
Stars: ✭ 41,584 (+35140.68%)
Mutual labels:  aws, serverless
Auto Remediate
Cloud Conformity Auto Remediate
Stars: ✭ 119 (+0.85%)
Mutual labels:  aws, serverless
Seldon Server
Machine Learning Platform and Recommendation Engine built on Kubernetes
Stars: ✭ 1,435 (+1116.1%)
Mutual labels:  aws, deployment

Serverless Components


Click Here for Version 1.0


Serverless Website Component ⎯⎯⎯ Instantly deploy static website on serverless infrastructure with zero configuration, powered by Serverless Components.


  • [x] Zero Configuration - Just let us know the component name, then just deploy.
  • [x] Fast Deployments - Deploy your entire website or frontend in seconds.
  • [x] CDN, SSL & Custom Domains - Comes with free CDN, SSL & custom domains out of the box.
  • [x] Team Collaboration - Collaborate with your teammates with shared state and outputs.
  • [x] Built-in Monitoring - Monitor your website right from the Serverless Dashboard.

Check out the Serverless Fullstack Application for a ready-to-use boilerplate and overall great example of how to use this Component.


 

Install

To get started with this component, install the latest version of the Serverless Framework:

$ npm install -g serverless

After installation, make sure you connect your AWS account by setting a provider in the org setting page on the Serverless Dashboard.

Initialize

The easiest way to start using the website component is by initializing one of its templates using the init command:

For React:

serverless init react-starter
cd react-starter

For Vue:

serverless init vue-starter
cd vue starter

This will also run npm install for you.

Deploy

Once you have the directory set up, you're now ready to deploy. Just run the following command from within the directory containing the serverless.yml file:

$ serverless deploy

Your first deployment might take a little while, but subsequent deployment would just take few seconds. For more information on what's going on during deployment, you could specify the --debug flag, which would view deployment logs in realtime:

$ serverless deploy --debug

Configure

The Website component is a zero configuration component, meaning that it'll work out of the box with no configuration and sane defaults. With that said, there are still some optional configuration that you can specify.

Here's a complete reference of the serverless.yml file for the website component:

component: website               # (required) name of the component. In that case, it's website.
name: my-website                 # (required) name of your website component instance.
org: serverlessinc               # (optional) serverless dashboard org. default is the first org you created during signup.
app: my-app                      # (optional) serverless dashboard app. default is the same as the name property.
stage: dev                       # (optional) serverless dashboard stage. default is dev.

inputs:
  src: ./src                     # (optional) path to the source folder. default is a hello world html file.
  domain: serverless.com         # (optional) domain name. this could also be a subdomain.
  region: us-east-2              # (optional) aws region to deploy to. default is us-east-1.
  bucketName: my-bucket          # (optional) aws bucket name. default is an auto generated name.
  indexDocument: index.html      # (optional) index document for your website. default is index.html.
  errorDocument: index.html      # (optional) error document for your website. default is index.html.

You could also provide a build hook to run before the source gets uploaded by turning the src input into an object:

inputs:
  src:
    src: ./src          # the input source folder
    hook: npm run build # the hook you want to run
    dist: ./dist        # the output dist folder

Once you've chosen your configuration, run serverless deploy again (or simply just serverless) to deploy your changes.

Dev Mode

Now that you've got your basic website up and running, it's time to develop that into a real world application. Instead of having to run serverless deploy everytime you make changes you wanna test, you could enable dev mode, which allows the CLI to watch for changes in your source directory as you develop, and deploy instantly on save.

To enable dev mode, simply run the following command from within the directory containing the serverless.yml file:

$ serverless dev

Get Info

Anytime you need to know more about your running website instance, you can run the following command to view the most critical info.

$ serverless info

This is especially helpful when you want to know the outputs of your instances so that you can reference them in another instance. It also shows you the status of your instance, when it was last deployed, and how many times it was deployed. You will also see a url where you'll be able to view more info about your instance on the Serverless Dashboard.

To digg even deeper, you can pass the --debug flag to view the state of your component instance in case the deployment failed for any reason.

$ serverless info --debug

Remove

If you wanna tear down your entire website infrastructure that was created during deployment, just run the following command in the directory containing the serverless.yml file.

$ serverless remove

The website component will then use all the data it needs from the built-in state storage system to delete only the relavent cloud resources that it created. Just like deployment, you could also specify a --debug flag for realtime logs from the website component running in the cloud.

$ serverless remove --debug

FAQs

What AWS Resources Does This Component Create?

  • AWS S3 Bucket for hosting
  • AWS CloudFront for CDN

And if you set a domain:

  • AWS ACM Certificate for SSL
  • AWS Route53 for DNS

How to use a custom domain registered outside of AWS?

If your domain is not on AWS Route53, you will have to set this up manually because the component does not have access to your registrar. Here are the general steps involved.

  1. Create an AWS ACM certificate for your domain. Make sure you set the "Additional Names" field to *.yourdomain.com as well to include all subdomains as well.
  2. After you create the certificate, it should be in a PENDING_VALIDATION status. Now you will need to validate your domain. We suggest you follow the DNS steps by adding the validation CNAME record you see on the AWS console to your domain via your registrar dashboard.
  3. After you add the validation record, it might take a while, but eventually the certificate should change status to ISSUED. Usually it takes around 5 minutes.
  4. Add your domain to the serverless.yml file as shown above and deploy. This step is important as it adds your domain to the cloudfront distribution.
  5. Notice the cloudfront url that is returned as an output. Copy this URL, get back to your registrar and add another CNAME record with your domain or subdomain name and a value of this cloudfront url. This ensures that your domain points to that cloudfront URL.
  6. After around 20 mins, your SSL certificate and domain should all be working and pointing to your URL. Keep in mind that if you change the name, stage, app or org properties in serverless.yml, this would result in a completely new instance with a new cloudfront url. This allows you to setup different domains for each stage or instance
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].