Setting up Google Cloud for DNS credentials
Create a service account, grant it the DNS Administrator role on the project that holds the zone, and create a JSON key.
- A public Cloud DNS managed zone, and the Cloud DNS API enabled in its project. For the full list of requirements, see Google Cloud DNS credentials.
- Permission to create a service account and a key, and to grant IAM roles on the project.
Complete these steps in the Google Cloud console, or use the gcloud CLI commands at the end of this topic.
The service account has the DNS Administrator role on the project, and you have a JSON key file. You can enter the content of the key file when you add the DNS credential.
To do the same steps with the gcloud CLI, run the following commands. Replace the placeholders with your values.
gcloud iam service-accounts create <service-account-name> --project <project-id> --display-name "CCF external-dns"
gcloud projects add-iam-policy-binding <project-id> \
--member "serviceAccount:<service-account-name>@<project-id>.iam.gserviceaccount.com" \
--role roles/dns.admin --condition=None
# Writes the key file
gcloud iam service-accounts keys create ccf-external-dns-key.json \
--iam-account <service-account-name>@<project-id>.iam.gserviceaccount.com
# Prints the DNS name of the zone for the Domain field
gcloud dns managed-zones list --project <project-id> --format="table(name,dnsName,visibility)"Next, see Adding a Google Cloud DNS credential.
