- Notifications
You must be signed in to change notification settings - Fork3
Python code to deploy your Webflow static website in AWS using Cloud Formation.
License
odfdata/webflow-aws
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
| 🛑 | If you already deployed one website using thev1 version of the tool, follow theMigration from v1 to v2 section before updating the tool version. |
|---|
An out-of-the box tool written in Python to deploy yourWebflow static website on AWS with a serverless architecture.
This tool uses the power of Cloud Formation to let you have your website up in minutes, with CDN and SSL Certificate enabled.
You can manage up to an infinite number of websites in the same AWS account, paying only for the real traffic. That's the beautiful part of serverless 😉
| ☝️ | In this version, everything needs to be hosted in AWS, also your domain. |
|---|
In order to use this tool, you need to have:
- Access to an Active AWS account with all required permissions
- NodeJS 10.3.0 or later installed(instructions).
- Python 3.6 or later with pip3 installed (instructions)
- AWS CLI installed and configured (instructions).
Finally, install theAWS CDK command line tool with the following command
npm install -g aws-cdk
You can download and install the latest version of this tool from the Python package index (Pypi)as follows:
pip3 install webflow-aws
This section explains how build and install the Python package using the source code.
To use our tool, you have to clone this repository and install:
- Clone using HTTPs:
git clone https://github.com/odfdata/webflow-aws.git
- Clone using SSH:
git clone git@github.com:odfdata/webflow-aws.git
After you cloned the repository, go inside thewebflow-aws folder and generate the.whl package to be installed.
cd webflow-awspython3 setup.py sdist bdist_wheelThe build file (generate above) will be visible in thedist/ folder. You will have awheel andtar.gz file.If you previously installed another version ofwebflow-aws, it's recommended to uninstall it running the followingcommand:
pip3 uninstall dist/webflow_aws-{version}-py3-none-any.whlNow you're ready to install the package inside thedist/folder. Without renaming them, you can install our tool onany computer with the following command
pip3 install dist/webflow_aws-{version}-py3-none-any.whlYou can find the{version} inside thesetup.py file.
At this point, on your target machine, you will be able to use the tool by typingwebflow-aws from any folder. To seethe available commands, and check if it's correctly installed, run the following command
webflow-aws --help
If you used thev1 version of the tool and you plan to migrate to thev2, remember this:
| Running the commands below will put your current website offline for couple of minutes. Plan to run the migration when you don't have traffic on your website. |
|---|
To migrate fromv1 tov2, you have to delete the current deployed website from the AWS Console.Unfortunately is not possible to do it using our tool since there are resources that are running at edge and it takestime to complete the deletion on AWS side.
These are the steps to delete your current website:
- Open the configuration file you have locally (namedwebflow-aws-config.yaml), and search for the keywords
- stack_name andbucket_name and copy the values.
- Go to AWS Console and login in the account you have deployed your website.
- Search for the AWS service namedS3 and open it.
- Search for the Bucket with the same name copied before and click on the circle on the left of the name.
- Click on theEmpty button, and now you are ready to click onDelete button
- Search for the AWS service namedCloudFormation and open it.
- Search for the stack deployed, click on it and click onDelete
- After a couple of minutes, you will see the status stack equal toDELETE_FAILED
- You can now click onDelete again, and check the square on the left of the resource name
- Now you can click onDelete stack, and you are ready to upgrade your local tool.
Run the following command to update the tool:
pip3 install --upgrade webflow-aws
Now you are ready to deploy your website using the new version running:
webflow-aws publish
You are now ready to deploy your website. Start by going toWebflow and download your created website as a.zip file(click here to see a detailed guide on how to do it).
Once you downloaded it, create a folder and put the.zip file inside. The folder's name does not matter, but make it meaningful for you. In our guide we will use theexample-website folder
Once your website is deployed, you will need a DNS Record to point to the file location. Withwebflow-aws you can do that in two ways:
- create ahosted zone inside Route53 (guide) on the AWS account you're using to deploy the website. In this scenario
webflow-awsautomatically manages the creation of all needed configuration, both for DNS Records and for SSL Certificate verification. - [beta] use acustom DNS manager, such as GoDaddy or your domain registrant. In this scenario, do not configure Route 53 properties and, once website is published, instructions with CNAMEs to set will be shown to you, so that you can manually configure them. Moreover, during first website deployment, you will need to publish a TXT record to verify your SSL Certificate.
Withwebflow-aws you can have one or more subdomain point at your website, such asexample.com andwww.example.com.
In thewebflow-aws-config.yaml file you will need to set the list of domains you would like to have your website pointing at. For example, you can haveexample.com andwww.example.com enabled.
Thewebflow-aws-config.yaml file allows you to customize the website you want to publish online. To create it, youhave to run this command:
webflow-aws create-config
It will guide you through the creation of the configuration. At the end of this procedure, you will see thewebflow-aws-config.yaml in your current directory.
If you want to create the configuration file on your own, this is an example file you can customize:
# REQUIRED parametersbucket_name:"www.example.com"domain_name:"example.com"CNAMEs: -"www.example.com"route_53_hosted_zone_id:"Z05234556KK8DIAQM"route_53_hosted_zone_name:"example.com"stack_name:"WwwExampleComStack"# OPTIONAL parametersaws_profile_name:"default"
- bucket_name: the AWS S3 bucket name you want to create. In most of the cases, it's equal to the domain name.
- domain_name: the domain name you want to use to expose your website.
- CNAMEs: the list of alternative domain names you want to redirect to the domain name.
- route_53_hosted_zone_id: the AWS Route53 hosted zone created. This
guide shows how to create anew hosted zone and get hisid. - route_53_hosted_zone_name: the AWS Route53 hosted zone domain name.
- stack_name: the name of the stack which all the resources will be grouped in. In most of the cases, it's thedomain name without dots
.
- aws_profile_name: (optional) the AWS profile name configured in AWS CLI. If you didn't specify it,the profile name is
default
Place this file inside theexample-website/ folder previously created. The content of that folder should be
|—— example-website||—— weblfow-files.zip||—— webflow-aws-config.yaml
Now you are ready to publish your website online.
Go inside the folder created before that contains:
webflow-aws-config.yamlfile.zipfile
To deploy your website, you have to execute this command:
webflow-aws publish
In 2 minutes, the content will be public available under the specifieddomain names.
About
Python code to deploy your Webflow static website in AWS using Cloud Formation.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.