-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS: support for private dns zones #1404
Merged
tombuildsstuff
merged 8 commits into
hashicorp:master
from
andyliuliming:andliu-private_dns_zones
Jul 2, 2018
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a540fc0
DNS: upgrade to the 2018-03-01 Preview SDK
stintel db23bf4
Privat dns zone support. resolved https://github.com/terraform-provid…
andyliuliming d4e68de
Refactoring from PR comments:
tombuildsstuff 1616693
Making the spacing of the DNS tests consistent
tombuildsstuff f5a8e19
Making the Zone Type case sensitive
tombuildsstuff 6b89d9e
Merge pull request #1 from terraform-providers/andliu-private_dns_zones
andyliuliming e0458f4
Merge branch 'master' into andliu-private_dns_zones
andyliuliming c766dfc
Fixing the Govendor file
tombuildsstuff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import ( | |
"context" | ||
"fmt" | ||
|
||
"github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2017-10-01/dns" | ||
"github.com/Azure/azure-sdk-for-go/services/preview/dns/mgmt/2018-03-01-preview/dns" | ||
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" | ||
"github.com/hashicorp/terraform/helper/schema" | ||
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" | ||
|
@@ -43,6 +43,23 @@ func dataSourceArmDnsZone() *schema.Resource { | |
Set: schema.HashString, | ||
}, | ||
|
||
"zone_type": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
|
||
"registration_virtual_network_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
}, | ||
|
||
"resolution_virtual_network_ids": { | ||
Type: schema.TypeList, | ||
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we document these three fields in the Data Source too? |
||
|
||
"tags": tagsForDataSourceSchema(), | ||
}, | ||
} | ||
|
@@ -87,15 +104,36 @@ func dataSourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error { | |
if props := resp.ZoneProperties; props != nil { | ||
d.Set("number_of_record_sets", props.NumberOfRecordSets) | ||
d.Set("max_number_of_record_sets", props.MaxNumberOfRecordSets) | ||
d.Set("zone_type", props.ZoneType) | ||
|
||
registrationVNets := make([]string, 0) | ||
if rvns := props.RegistrationVirtualNetworks; rvns != nil { | ||
for _, rvn := range *rvns { | ||
registrationVNets = append(registrationVNets, *rvn.ID) | ||
} | ||
} | ||
if err := d.Set("registration_virtual_network_ids", registrationVNets); err != nil { | ||
return err | ||
} | ||
|
||
resolutionVNets := make([]string, 0) | ||
if rvns := props.ResolutionVirtualNetworks; rvns != nil { | ||
for _, rvn := range *rvns { | ||
resolutionVNets = append(resolutionVNets, *rvn.ID) | ||
} | ||
} | ||
if err := d.Set("resolution_virtual_network_ids", resolutionVNets); err != nil { | ||
return err | ||
} | ||
|
||
nameServers := make([]string, 0) | ||
if ns := props.NameServers; ns != nil { | ||
nameServers := make([]string, 0, len(*ns)) | ||
for _, ns := range *ns { | ||
nameServers = append(nameServers, ns) | ||
} | ||
if err := d.Set("name_servers", nameServers); err != nil { | ||
return err | ||
} | ||
} | ||
if err := d.Set("name_servers", nameServers); err != nil { | ||
return err | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we update the documentation to include these new fields? This is kept in
./website/docs/d/dns_zone.html.markdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.