Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

WIP RFC: Automatically configure account_id and zone_id #331

Closed
xortive opened this issue Jul 18, 2019 · 7 comments · Fixed by #1966
Closed

WIP RFC: Automatically configure account_id and zone_id #331

xortive opened this issue Jul 18, 2019 · 7 comments · Fixed by #1966
Labels
onboarding Issues with installation or login

Comments

@xortive
Copy link
Contributor

xortive commented Jul 18, 2019

TL;DR - if config has perms for only one account id / zone id, fill it in automatically on generate/init

  • The configured route in wrangler.toml must include a zone name for a zoned publish
  • Zoneless publish don't need a zone_id or route, just account_id and script_name
  • Global config has the global api key and email

We have all the ingredients to infer the account_id and zone_id instead of requiring the user to configure it manually using https://api.cloudflare.com/#zone-properties and https://api.cloudflare.com/#accounts-list-accounts.

Open questions:

  • How does this look from a developer experience perspective? when should we fetch these parameters and how should we provide choice between them
  • Is this a good idea?
@xortive xortive added the RFC label Jul 18, 2019
@xortive xortive changed the title RFC: Automatically configure account_id and zone_id WIP RFC: Automatically configure account_id and zone_id Jul 18, 2019
@xortive
Copy link
Contributor Author

xortive commented Jul 18, 2019

Made this WIP while we define those open questions

@EverlastingBugstopper
Copy link
Contributor

This is a nice to have feature that we could implement for any single account profiles. Cloudflare allows a single profile to be associated with multiple accounts (or collections of zones), so inferring account id only works for profiles with a single account. The same goes for zone id - there can be multiple zone ids per account so you could only infer them if an account had a single associated zone. If I had to guess, the majority of folks using Wrangler would benefit from this.

@ashleymichal
Copy link
Contributor

i think this should be pretty easy to do with the work that's already been done for whoami. if the user already has their config set when we go to generate a manifest, we can request the relevant account id; if there is exactly one we will fill it in, else we can message next steps.

@stale
Copy link

stale bot commented Jul 14, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Sep 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 12, 2020
@Electroid
Copy link
Contributor

@xortive Would wrangler login make this outdated?

@stale stale bot removed the wontfix label Sep 18, 2020
@rita3ko
Copy link
Contributor

rita3ko commented Sep 18, 2020

@Electroid i actually think we can make this better with wrangler login. once you're logged in, when you wrangler init or wrangler generate a project we could let you pick an account and then zone interactively and prefill it for you in wrangler.toml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
onboarding Issues with installation or login
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants