Skip to content

Commit

Permalink
Ato - support site id in import command (#449)
Browse files Browse the repository at this point in the history
* Adding account export capability for ATO

- Introducing subb account level ATO allowlist fetching

* Formatting logs to be consistent across the source code

* Enable backwards compatibility support for ATO site allowlist ID, where both <siteId> as well as <accountId>/<siteId> are supported
  • Loading branch information
Kapkan-hash authored Jun 26, 2024
1 parent 474d879 commit e1ebb6b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion incapsula/resource_ato_site_allowlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ func resourceATOSiteAllowlistRead(d *schema.ResourceData, m interface{}) error {
d.Set("id", "")
} else {
// Set ID for all other cases as siteId
d.SetId(strconv.Itoa(siteId))
if accountId == 0 {
d.SetId(strconv.Itoa(siteId))
} else {
d.SetId(fmt.Sprintf("%d/%d", accountId, siteId))
}
}

err = d.Set("allowlist", atoAllowlistEntry["allowlist"])
Expand Down

0 comments on commit e1ebb6b

Please sign in to comment.