The GCP Cloud DNS Plugin consumes the Google Cloud DNS API and exposes the supported resources to RightScale Self-Service. This allows for easy extension of a Self-Service Cloud Application to create, delete, and manage Cloud DNS resource.
- A general understanding CAT development and definitions
- Refer to the guide documentation for details SS Guides
admin
,ss_enduser
, &ss_designer
roles on a RightScale account with Self-Service enabled- the
admin
role is needed to set/retrieve the RightScale Credentials for the GCP Cloud DNS API.
- the
- GCP Service Account credentials
- Refer to the Getting Started section for details on creating this account.
- The following RightScale Credentials must exist with the appropriate values
GOOGLE_DNS_PLUGIN_ACCOUNT
GOOGLE_DNS_PLUGIN_PRIVATE_KEY
- The following packages are also required (See the Installation section for details):
This procedure will create a GCE Service account with the appropriate permissions to use this plugin.
- Review the Using OAuth 2.0 for Server to Server Applications documentation.
- Follow the section named Creating a service account
- Roles needs to include:
DNS Administrator
- Permissions can be restricted but may effect the permissions required to interact with certain resources with this plugin. Doing so is unsupported
- Enabling G Suite Domain-wide Delegation is not required
- Furnish a new private key selecting the JSON option
- Roles needs to include:
- Download the Private Key and record the Service account ID (These will be stored in a RightScale Credential in a future step)
This procedure will setup the Credentials required for the GCE Plugin to interact with the GCE API
- Review the Credentials documentation.
- Create a credential in the desired RightScale Account with the name of
GOOGLE_DNS_PLUGIN_ACCOUNT
- Paste the Service Account Id into the value of this credential and save
- Extract/Copy the private_key from the JSON downloaded when you created the GCE Service Account
- You will need to replace "\n" in the private_key with actual line returns to paste into the credential
- Create a credential in the desired RightScale Account with the name of
GOOGLE_DNS_PLUGIN_PRIVATE_KEY
- Paste the private_key into the value of the credential making sure to replace "\n" with actual line returns and save
- Be sure your RightScale account has Self-Service enabled
- Follow the Getting Started section to create a Service Account and RightScale Credentials
- Navigate to the appropriate Self-Service portal
- For more details on using the portal review the SS User Interface Guide
- In the Design section, use the
Upload CAT
interface to complete the following:- Upload each of packages listed in the Requirements Section
- Upload the
google_cloud_dns.rb
file located in this repository
The Cloud DNS Plugin has been packaged as plugins/googledns
. In order to use this plugin you must import this plugin into a CAT.
import "plugins/googledns"
For more information on using packages, please refer to the RightScale online documenataion. Importing a Package
- The Cloud DNS Plugin makes no attempt to support non-Cloud DNS resources. (i.e. Allow the passing the RightScale or other resources as arguments to a GCE resource.)
Field Name | Required? | Description |
---|---|---|
name | yes | Zone Name |
description | no | Zone Description |
dns_name | yes | Zone DNS Name |
nameserver_set | no | Nameservers to use for the newly created Zone. If left empty, nameservers will be auto-populated by GCP |
- creationTime
- description
- dnsName
- id
- kind
- name
- nameServerSet
- nameServers
GCP Cloud DNS resources can now be created by specifying a resource declaration with the desired fields. See the Supported Actions section for a full list of supported actions. The resulting resrouce can be manipulated just like the native RightScale resources in RCL and CAT. See the Examples Section for more examples and complete CAT's.
#Creates a new EFS File System
resource "my_zone", type: clouddns.managedZone do
name "zoneA"
description "DNS Zone A"
dns_name "example.com."
Action | API Implementation | Support Level |
---|---|---|
create | create | Supported |
delete | delete | Supported |
get | get | Supported |
list | list | Supported |
Link | Resource Type |
---|---|
project() | project |
resourceRecordSets() | resourceRecordSet |
Field Name | Required? | Description |
---|---|---|
name | yes | Full DNS Record name |
type | yes | Record Type (ie. A, CNAME, etc) |
ttl | yes | number value |
rrdatas | yes | IP address, hostname, etc |
See Google documentation here
- kind
- name
- type
- ttl
- rrdatas
# Creates an Address Record
resource "my_recordset", type: "clouddns.resourceRecordSet" do
name "foobar.example.com."
ttl 300
type "A"
rrdatas "192.168.1.33"
end
Action | API Implementation | Support Level |
---|---|---|
create | create | Supported |
delete | create | Supported |
get | list | Supported |
list | list | Supported |
Link | Resource Type |
---|---|
project() | project |
managedZone() | managedZone |
N/A
- kind
- number
- id
- managedZones_quota
- resourceRecordsPerRrset_quota
- rrsetAdditionsPerChange_quota
- rrsetDeletionsPerChange_quota
- rrsetsPerManagedZone_quota
- totalRrdataSizePerChange_quota
Project resources cannot be created via the Cloud DNS API, however by using the project()
link, you can retrieve the associate Project information available via the Cloud DNS API.
Action | API Implementation | Support Level |
---|---|---|
get | get | Supported |
N/A
- Project resources only allow a GET actions, which will return DNS Quotas allowed for the associated GCP Project.
The GCE Plugin source code is subject to the MIT license, see the LICENSE file.