github.com/pmoroney/dnscontrol@v0.2.4-0.20171024134423-fad98f73f44a/docs/_providers/gcloud.md (about) 1 --- 2 name: Google Cloud DNS 3 title: Google Cloud DNS Provider 4 layout: default 5 jsId: GCLOUD 6 --- 7 8 # Google Cloud DNS Provider 9 10 ## Configuration 11 12 For Google cloud authentication, DNSControl requires a JSON 'Service Account Key' for your project. Newlines in the private key need to be replaced with `\n`.Copy the full JSON object into your `creds.json` like so: 13 14 {% highlight json %} 15 { 16 "gcloud": { 17 "type": "service_account", 18 "project_id": "mydnsproject", 19 "private_key_id": "a05483aa208364c56716b384efff33c0574d365b", 20 "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADL2dhlY7YZbx7tpsfksOX\nih0DbxhiQ==\n-----END PRIVATE KEY-----\n", 21 "client_email": "dnscontrolacct@mydnsproject.iam.gserviceaccount.com", 22 "client_id": "107996619231234567750", 23 "auth_uri": "https://accounts.google.com/o/oauth2/auth", 24 "token_uri": "https://accounts.google.com/o/oauth2/token", 25 "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", 26 "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dnscontrolsdfsdfsdf%40craigdnstest.iam.gserviceaccount.com" 27 } 28 } 29 {% endhighlight %} 30 31 **Note**: The `project_id`, `private_key`, and `client_email`, are the only fields that are strictly required, but it is sometimes easier to just paste the entire json object in. Either way is fine. 32 33 See [the Activation section](#activation) for some tips on obtaining these credentials. 34 35 ## Metadata 36 This provider does not recognize any special metadata fields unique to google cloud dns. 37 38 ## Usage 39 Use this provider like any other DNS Provider: 40 41 {% highlight js %} 42 var REG_NAMECOM = NewRegistrar("name.com","NAMEDOTCOM"); 43 var GCLOUD = NewDnsProvider("gcloud", GCLOUD); 44 45 D("example.tld", REG_NAMECOM, DnsProvider(GCLOUD), 46 A("test","1.2.3.4") 47 ); 48 {%endhighlight%} 49 50 ## Activation 51 1. Go to your app-engine console and select the appropriate project. 52 2. Go to "API Manager > Credentials", and create a new "Service Account Key" 53 54 <img src="{{ site.github.url }}/assets/gcloud-json-screen.png" alt="New Service Account" style="width: 900px;"/> 55 56 3. Choose an existing user, or create a new one. The user requires the "DNS Administrator" role. 57 4. Download the JSON key and copy it into your `creds.json` under the name of your gcloud provider. 58 59 ## New domains 60 If a domain does not exist in your Google Cloud DNS account, DNSControl 61 will *not* automatically add it with the `create-domains` account. You'll need to do that via the 62 control panel manually.