By pan
What is the difference between the digitalocean_spaces_bucket and digitalocean_spaces_bucket_object providers in terraform?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
digitalocean_spaces_bucket is used to create a new Space (bucket in S3 terminology) and manage Space-wide settings like CORS policies. digitalocean_spaces_bucket_object is for adding an individual file to the Space.
They can be used together. For example:
resource "digitalocean_spaces_bucket" "static" {
name = "static"
region = "nyc3"
}
resource "digitalocean_spaces_bucket_object" "image" {
region = digitalocean_spaces_bucket.static.region
bucket = digitalocean_spaces_bucket.static.name
key = "remote/path/to/image.png"
source = "local/path/to/image.png
}
digitalocean_spaces_bucket_object can also be used with a Space created outside of Terraform by specifying its name and region rather than referencing a digitalocean_spaces_bucket
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.