Started as an email spam tracker, Cloudflare today offers extensive ability to help users register, manage their domain as a registrar and monitor, secure, configure user's entire IT infrastructure.
In this section we will walk you through how to configure Cloudflare as your default cloud provider to deploy and version your application with Zephyr Cloud, using Cloudflare's global edge network, KV namespace, Workers & Pages project to deliver your content on the edge.
After sign in, click on your selected organization.
Before you move to the next step, you will need two details and one DNS configuration from Cloudflare:
1. Zone ID
2. API token
Resource | Resource Type | Permission |
---|---|---|
Account | Worker KV Storage | Edit |
Account | Worker Scripts | Edit |
Account | Cloudflare Pages | Edit |
Zone | Worker Routes | Edit |
Zone Resources: When asked to whether include a specific zone to this API token, you to Include a Specific zone under your domain.
The rest of configuration details (Account resources, Client IP Address Filtering etc.) are not required by us and you can leave them as default.
Scroll to bottom to select Continue to summary to confirm if the configurations are correct and then Create Token, you will see your token on the next page.
3. Configure your DNS record
Type | Name | IPv4 Address | Proxy status | TTL |
---|---|---|---|---|
A | * | 99.83.190.102 | Proxied | Auto |
A | <domain.com> | 99.83.190.102 | Proxied | Auto |
Additional details for each inputs after clicking on Add integration under Cloudflare:
A unique name within your organization. It will be used as a slug.
The name of integration shown on dashboard.
Obtained from Cloudflare. The instruction above should walk you through how to get your API token.
Obtained from Cloudflare. You will need a valid domain on Cloudlfare.
This operation is idempotent, it will create a cloudflare pages project on Cloudflare.
Make every repository deployed through Zephyr will attempt to deploy through this integration setting. This won't change until you delete this integration or add new integration as default.
Navigate to our recipes to try one of the application, you should see your next deployment deployed through your designated domain! (if not come talk to us)
:::tip
If you are using our managed cloud (Cloudflare) or custom deployment integration through Cloudflare, when you are adding assets, naming your application in package.json
or module federation configuration, make sure the name doesn't include capital letter to avoid query problem with Cloudflare.
:::
After you add Cloudflare as your cloud provider on Zephyr, several properties will be modified and added on your Cloudflare account.
Three namespaces will be added:
ze-worker-for-static-upload
(used for uploading and serving assets)ze.<domain.com>/*
on worker ze-worker-for-static-upload
*-ze.<domain.com>/*
on worker ze-worker-for-static-upload
Once you finish your first deployment on Cloudflare, you can inspect your assets on Cloudflare.
Navigate to your cloudflare account's main dashboard page, you can click on Workers & Pages and then KV to inspect your assets by clicking on View next to ze_files
.
ze_files
stores your actual assets.ze_envs
stores you application's environment, access right etc.ze_snapshot
stores your application's snapshots comparing against previous build.rm -rf ~/.zephyr
before deployment.If you want to delete your existing Cloudflare integration, you will need to finish below steps:
Sign in to your Cloudflare account, on the left side of the navigation bar click on Workers & Pages.
Find and click on ze-worker-for-static-upload, and then on the top navigation bar select Manage, click on Delete on this page.
Go back to the Workers & Pages main page and find these two properties:
Choose both projects and select Manage on the top when you are in the project. Click on the Delete button.
Under Workers & Pages on the left navigation bar on the main dashboard, select KV.
Select KV namespaces with below names:
···
on the right of each items and select Delete.On the main dashboard, select the domain you added to Zephyr dashboard for Deployment integration.
Choose Workers Routes on the left side of the navigation bar. Find the Worker routes with prefix ze
and *-ze
and click on Edit.
On the pop up modal select Remove.
Log into your account and select the organization associated with the deployment integration you want to delete.
Select Settings on the organization dashboard. On the left side choose Deployment Integration.
Choose the name of integration you want to delete and select Remove on the next page.