2/24/2022

How to migrate from AWS Route 53 to Scaleway DNS

I've spent the last 2 days talking with Scaleway DNS (domain) team reporting bugs I found while preparing Cloud-IAM DNS migration from Amazon AWS Route53 to Scaleway DNS and was amazed by how fast they fixed these bugs. It's so unusual for a cloud provider to be this responsive, I had to start this blog post saying it! What an amazing team! If you also use Scaleway for hosting, join their Slack.

Because Cloud-IAM DNS zone file is quite large and because we wanted to automate this migration as much as possible, I wrote a script to seamlessly migrate cloud-iam.com zone from AWS to SCW through a gitlab-ci job that we can manually start at will and also run at scheduled interval

Route53 does not have an "export to bind format" feature but I found cli53 that does that for me. On the other hand scaleway cli had the dns zone import command but it was not working out of the box thus the 2 days of exchange with their team to fix some edge cases.

First thing you will need to find and set the environment variables below:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
SCW_ACCESS_KEY
SCW_SECRET_KEY
SCW_DEFAULT_ORGANIZATION_ID
SCW_DEFAULT_PROJECT_ID

Then use the .gitlab-ci.yml below to automate the import, don't forget to rename DOMAIN.TLD to the zone you want to migrate.

stages:
  - run

sync:
  stage: run
  image: node:16
  script:
    - curl -L "https://github.com/barnybug/cli53/releases/download/0.8.18/cli53-linux-amd64" > /usr/local/bin/cli53
    - chmod +x /usr/local/bin/cli53
    - cli53 export --full --debug DOMAIN.TLD > DOMAIN.TLD.zone
    - curl -o /usr/local/bin/scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.4.0/scw-2.4.0-linux-x86_64"
    - chmod +x /usr/local/bin/scw
    - scw dns zone import -D DOMAIN.TLD bind-source.content="$(cat ./DOMAIN.TLD.zone)"
  tags:
    - build
  artifacts:
      when: always
      untracked: true
      expire_in: 1 day
      name: 'build'
      paths:
        - DOMAIN.TLD.zone

One last thing, don't forget to take a look at what we do at Cloud-IAM if you are looking for a fully managed Keycloak as a service.

« »
 
 
Made with on a hot august night from an airplane the 19th of March 2017.