This resolves a current issue whereby new zones are created in the wrong account when the api token isn't created on the account where the zone is intended to be created.
As an example, say that Contoso Inc has a Cloudflare organization/account and adds Alice as an authorized administrator. Alice sets up an api token under her alice@contoso.com Cloudflare user account. If Alice uses octodns to create a new zone, the zone will be created in Alice's account not Contoso Inc's account as desired because Cloudflare interprets a request to create a zone without an account_id as a request to create it on the current user's account.
With this change, if account_id is set to the Contoso Inc's account, the zone is properly created on the Contoso Inc account.
This PR adds support for creating zones in a specific Cloudflare account (as specified by the existing account_id param on the provider config).
With this change, when account_id is set on the provider it's included in the POST request to
/zones
when creating a new zone:(https://developers.cloudflare.com/api/operations/zones-post)
This resolves a current issue whereby new zones are created in the wrong account when the api token isn't created on the account where the zone is intended to be created.
As an example, say that Contoso Inc has a Cloudflare organization/account and adds Alice as an authorized administrator. Alice sets up an api token under her alice@contoso.com Cloudflare user account. If Alice uses octodns to create a new zone, the zone will be created in Alice's account not Contoso Inc's account as desired because Cloudflare interprets a request to create a zone without an
account_id
as a request to create it on the current user's account.With this change, if
account_id
is set to the Contoso Inc's account, the zone is properly created on the Contoso Inc account.