Is there a way to create a space using terraform?
I’m trying to setup my database backups so that they are stored in a DO Space.
My infrastructure on DO is created using Terraform and provisioned using Ansible.
So my approach was to use Terraform’s digitaloceanspacesbucket resource (it’s the only one that seems to handle Spaces) and then use Ansible to push the backup script that will use s3cmd.
My problem is that Terraform can’t create the Space. It gives me this error:
Error creating Spaces bucket: RequestError: send request failed
caused by: Put https://**.digitaloceanspaces.com/: dial tcp: lookup *.digitaloceanspaces.com on *...:*: no such host
The * are the identifiable parts I removed.
My assumption here is that Terraform can only create a bucket after the Space exists.
Is this correct? And if so how would you go about setting this up?
Thanks in advance for your insights