Skip to content

Commit

Permalink
add skipLookup argument for ANAME resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Nesbitt Callaghan committed Apr 11, 2022
1 parent e9de72a commit 31f688d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.4.4 (add skipLookup argument for ANAME resources, cncallaghan)
- added skipLookup argument for ANAME resources

## 0.3.1 (Unreleased)

IMPROVEMENTS:
Expand Down
7 changes: 7 additions & 0 deletions constellix/datasource_constellix_aname_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func datasourceConstellixAnamerecord() *schema.Resource {
Computed: true,
},

"skip_lookup": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
},

"note": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -247,6 +253,7 @@ func datasourceConstellixAnamerecordRead(d *schema.ResourceData, m interface{})
d.Set("ttl", tp["ttl"])
d.Set("record_option", tp["recordOption"])
d.Set("noanswer", tp["noAnswer"])
d.Set("skip_lookup", tp["skipLookup"])
d.Set("note", tp["note"])
d.Set("gtd_region", tp["gtdRegion"])
d.Set("type", tp["type"])
Expand Down
16 changes: 16 additions & 0 deletions constellix/resource_constellix_aname_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func resourceConstellixANAMERecord() *schema.Resource {
Computed: true,
},

"skip_lookup": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Computed: true,
},

"note": &schema.Schema{
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -264,6 +270,7 @@ func resourceConstellixANAMERecordImport(d *schema.ResourceData, m interface{})
d.Set("source_type", params[0])
d.Set("record_option", data["recordOption"])
d.Set("noanswer", data["noAnswer"])
d.Set("skip_lookup", data["skipLookup"])
d.Set("note", data["note"])
d.Set("pools", data["pools"])
d.Set("gtd_region", data["gtdRegion"])
Expand Down Expand Up @@ -298,6 +305,10 @@ func resourceConstellixANAMERecordCreate(d *schema.ResourceData, m interface{})
anameAttr.NoAnswer = noanswer.(bool)
}

if skip_lookup, ok := d.GetOk("skip_lookup"); ok {
anameAttr.SkipLookup = skip_lookup.(bool)
}

if note, ok := d.GetOk("note"); ok {
anameAttr.Note = note.(string)
}
Expand Down Expand Up @@ -478,6 +489,7 @@ func resourceConstellixANAMERecordRead(d *schema.ResourceData, m interface{}) er
d.Set("ttl", data["ttl"])
d.Set("record_option", data["recordOption"])
d.Set("noanswer", data["noAnswer"])
d.Set("skip_lookup", data["skipLookup"])
d.Set("note", data["note"])
d.Set("pools", data["pools"])
d.Set("gtd_region", data["gtdRegion"])
Expand Down Expand Up @@ -513,6 +525,10 @@ func resourceConstellixANAMERecordUpdate(d *schema.ResourceData, m interface{})
anameAttr.NoAnswer = d.Get("noanswer").(bool)
}

if _, ok := d.GetOk("skip_lookup"); ok {
anameAttr.SkipLookup = d.Get("skip_lookup").(bool)
}

if _, ok := d.GetOk("note"); ok {
anameAttr.Note = d.Get("note").(string)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 31f688d

Please sign in to comment.