twilio / terraform-provider-twilio

Terraform Twilio provider
MIT License
63 stars 13 forks source link

Support for creating sub-accounts? #99

Open bberzinskas-tw opened 2 years ago

bberzinskas-tw commented 2 years ago

Issue Summary

I would like the ability to create sub-accounts under my master account, allocate them API keys + MessagingService and pass that and the SIDs back into my TF state.

childish-sambino commented 2 years ago

Looks like creating subaccounts is not supported by the provider because there's no API to delete a subaccount, which is a prereq to support. Code where we filter out resources that don't support create/read/delete: https://github.com/twilio/twilio-oai-generator/blob/80de0e3b7a7c92f951917b24ef4ef13cc6fcea4e/src/main/java/com/twilio/oai/TwilioTerraformGenerator.java#L237

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

bberzinskas-tw commented 2 years ago

is that not loosely equivalent to suspend / close subaccount endpoints?

childish-sambino commented 2 years ago

Yes, it's loosely equivalent, but it would need to be added as an exceptional case because there's no explicit DELETE operation as there are with other resources.

enchorb commented 2 years ago

Really would love for this to be added, only thing holding us back from using this in production. 'Close' seems to be the best option since closed subaccounts will be automatically deleted after 30 days anyways.

This other Twilio provider seems to be working just fine with subaccounts https://registry.terraform.io/providers/RJPearson94/twilio/latest/docs/resources/account_sub_account

Stono commented 1 year ago

+1 for this. I'm trying to ensure subaccounts are created consistently across our environments, as code.

I've been fighting terraform every step of the way with this goal (initially i wanted to create accounts in the organisation consistently too but there isn't even an API for that), and was really surprised when i saw we can't manage sub accounts either.