Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smaeda-ks/fastly-service-clone
A shell script to copy Fastly service settings to another service.
https://github.com/smaeda-ks/fastly-service-clone
fastly fastly-api fastly-service
Last synced: 3 days ago
JSON representation
A shell script to copy Fastly service settings to another service.
- Host: GitHub
- URL: https://github.com/smaeda-ks/fastly-service-clone
- Owner: smaeda-ks
- Created: 2020-12-20T11:40:00.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-24T21:28:27.000Z (about 3 years ago)
- Last Synced: 2024-12-10T14:02:12.343Z (15 days ago)
- Topics: fastly, fastly-api, fastly-service
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# service-clone.sh
A shell script to copy service settings to another service.# Usage
## Setup
### Prerequisites
This script requires at least `curl` and `jq` commands to be available on your machine.
NOTE: If you run this script on macOS please install `gnu-getopt`.
https://formulae.brew.sh/formula/gnu-getopt### API Token
Please set `FASTLY_API_TOKEN` environment variable with your API token.
```sh
export FASTLY_API_TOKEN="your_api_token"
``````sh
$ chmod +x ./service-clone.sh
```## Help
```text
$ ./service-clone.sh -h
Usage: ./service-clone.sh [OPTIONS]List of available options
-s, --src SERVICE_ID [required] source service ID
-d, --dst SERVICE_ID [required] destinatuon service ID
-v, --version VERSION (optional) source version number (default: the current active version)
--no-logging (optional) exclude logging settings (default: include)
--no-acl (optional) exclude acl (default: include)
--no-dictionary (optional) exclude dictionry (default: include)
-h, --help show helpNeed more help? Visit: https://github.com/smaeda-ks/fastly-service-clone
```## Command
```sh
$ ./service-clone.sh -s ${source_service_id} -d ${destination_service_id}
```# Limitations
WASM services (Compute@Edge) are not supported.
Also, this tool does not copy over the following part of service settings.1. custom pragma settings
2. custom service limit (e.g., max domains, backends, etc)
3. Image Optimizer settings (IO needs to be explicitly enabled on the destination service as well)
4. WAF settings (WAF needs to be explicitly enabled on the destination service as well)If you need to retain those settings please ask Fastly Support for further assistance.