Skip to content

Commit

Permalink
[Terraform] autogenerate resource_dns_managed_zone [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
drebes committed Nov 12, 2018
1 parent c1f4b72 commit 7b7bf12
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 246 deletions.
3 changes: 3 additions & 0 deletions products/dns/ansible.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ datasources: !ruby/object:Provider::ResourceOverrides
overrides: !ruby/object:Provider::ResourceOverrides
ManagedZone: !ruby/object:Provider::Ansible::ResourceOverride
editable: false
properties:
labels: !ruby/object:Provider::Ansible::PropertyOverride
version_added: '2.8'
ResourceRecordSet: !ruby/object:Provider::Ansible::ResourceOverride
access_api_results: true
editable: true
Expand Down
15 changes: 15 additions & 0 deletions products/dns/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ objects:
A mutable string of at most 1024 characters associated with this
resource for the user's convenience. Has no effect on the managed
zone's function.
update_verb: :PATCH
update_url: 'projects/{{project}}/managedZones/{{name}}'
required: true
- !ruby/object:Api::Type::String
name: 'dnsName'
description: |
The DNS name of this managed zone, for instance "example.com.".
required: true
- !ruby/object:Api::Type::Integer
name: 'id'
description: Unique identifier for the resource; defined by the server.
Expand Down Expand Up @@ -81,6 +85,17 @@ objects:
The time that this resource was created on the server.
This is in RFC3339 text format.
output: true
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: |
A set of key/value label pairs to assign to this ManagedZone.
update_verb: :PATCH
update_url: 'projects/{{project}}/managedZones/{{name}}'
references: !ruby/object:Api::Resource::ReferenceLinks
guides:
'Managing Zones':
'https://cloud.google.com/dns/zones/'
api: 'https://cloud.google.com/dns/api/v1/managedZones'
- !ruby/object:Api::Resource
name: 'Project'
kind: 'dns#project'
Expand Down
49 changes: 49 additions & 0 deletions products/dns/terraform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

--- !ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Provider::ResourceOverrides
ManagedZone: !ruby/object:Provider::Terraform::ResourceOverride
examples: |
```hcl
resource "google_dns_managed_zone" "prod" {
name = "prod-zone"
dns_name = "prod.mydomain.com."
description = "Production DNS zone"
labels = {
foo = "bar"
}
}
```
properties:
creationTime: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
description: !ruby/object:Provider::Terraform::PropertyOverride
description: |
A textual description field. Defaults to 'Managed by Terraform'.
default_value: 'Managed by Terraform'
id: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
nameServerSet: !ruby/object:Provider::Terraform::PropertyOverride
exclude: true
ResourceRecordSet: !ruby/object:Provider::Terraform::ResourceOverride
exclude: true
Project: !ruby/object:Provider::Terraform::ResourceOverride
exclude: true

# This is for copying files over
files: !ruby/object:Provider::Config::Files
# These files have templating (ERB) code that will be run.
# This is usually to add licensing info, autogeneration notices, etc.
compile:
<%= lines(indent(compile('provider/terraform/product~compile.yaml'), 4)) -%>
2 changes: 1 addition & 1 deletion provider/terraform/utils/provider.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func Provider() terraform.ResourceProvider {
// end beta-only products
<% end -%>
GeneratedComputeResourcesMap,
GeneratedDnsResourcesMap,
GeneratedRedisResourcesMap,
GeneratedResourceManagerResourcesMap,
GeneratedStorageResourcesMap,
Expand Down Expand Up @@ -174,7 +175,6 @@ func Provider() terraform.ResourceProvider {
"google_dataflow_job": resourceDataflowJob(),
"google_dataproc_cluster": resourceDataprocCluster(),
"google_dataproc_job": resourceDataprocJob(),
"google_dns_managed_zone": resourceDnsManagedZone(),
"google_dns_record_set": resourceDnsRecordSet(),
"google_endpoints_service": resourceEndpointsService(),
"google_folder": resourceGoogleFolder(),
Expand Down
182 changes: 0 additions & 182 deletions third_party/terraform/resources/resource_dns_managed_zone.go

This file was deleted.

63 changes: 0 additions & 63 deletions third_party/terraform/website/docs/r/dns_managed_zone.markdown

This file was deleted.

0 comments on commit 7b7bf12

Please sign in to comment.